[SERVER-59846] Structured Logging in Mongo Shell Generates Invalid JSON Created: 09/Sep/21 Updated: 24/Sep/21 Resolved: 24/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging, Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Peter Garafano (Inactive) | Assignee: | Gabriel Marks |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Sprint: | Security 2021-10-04 |
| Participants: |
| Description |
|
The Mongo Shell (not mongosh) produces structured log entries using --verbose that contain invalid JSON:
Note that the error is in the attr.error field where the quotes around the hostname are not escaped. The issue appears to be here. |
| Comments |
| Comment by Gabriel Marks [ 24/Sep/21 ] | |
|
Most likely not an issue coming from the server side of things – possibly an issue of how the log was processed after being output. | |
| Comment by Gabriel Marks [ 20/Sep/21 ] | |
|
I'm getting:
which looks correctly escaped to me.
| |
| Comment by Peter Garafano (Inactive) [ 20/Sep/21 ] | |
|
Hi Gabriel, In this case, simply connecting to an Atlas Cluster using the Mongo Shell
The key here is, the required TXT record describing the authSource and replicaSet, needs to be missing/inaccessible. | |
| Comment by Gabriel Marks [ 20/Sep/21 ] | |
|
Hi Peter, would it be possible for you to provide a list of commands leading up to this log entry being produced? Thanks so much! |