[COMPASS-6741] Compass displays malformed date Created: 19/Apr/23  Updated: 19/Apr/23

Status: In Progress
Project: Compass
Component/s: CRUD
Affects Version/s: None
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Michal Kit Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:
node.js / npm versions:
Additional info:


Attachments: PNG File Screenshot 2023-03-07 at 12.22.09 (1).png    
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

We are using spring boot to connect to Mongo DB and save the documents there. Everything seems to be configured correctly. Out of several million documents and daily saves we have spotted 2 weird cases with dates being malformed. See the ``birthday`` field in the attached screenshot. In other instance we had a date that was of "0000.01.01". I am seeing those errors in Compass but our internal tools are failing whenever such malformed date happens. Could you advise me where could be the problem? It happened only twice and we have around few thousands documents saved. We control what is being saved and all dates are converted in Java and MongoDB drivers are used.

Please be sure to attach relevant logs with any sensitive data redacted.

Steps to Reproduce

N/A

Expected Results

Correct date format - always

Actual Results

Not always a correct date format

Additional Notes

Any additional information that may be useful to include.



 Comments   
Comment by Michal Kit [ 19/Apr/23 ]

Could you tell me what language is the Compass written in?

Comment by Le Roux Bodenstein [ 19/Apr/23 ]

Oh once you have isolated your date insertion code I'd recommend asking in the forums: https://www.mongodb.com/community/forums/

Comment by Michal Kit [ 19/Apr/23 ]

It seems that Python client of mongodb is also failing to parse this date. As I mentioned, after inserting the date to the db we use tools to retrieve it. Those tools are written in python and they fail as well. Do you think you could shed some light then what could be the cause for this wrong interpretation of the date field? If Java inserts it correctly, I presume those that read it (compass/python) do it in an incorrect manner? Could you advise what could be a problem? Have you heard about that issue before?

Comment by Le Roux Bodenstein [ 19/Apr/23 ]

Hi Michal

It seems like the date was inserted into the database correctly. You should be able to confirm by using the mongosh shell. If you get a different date showing up there it might suggest a bug in compass.

I'd suggest you look at your java code.

Le Roux

Comment by PM Bot [ 19/Apr/23 ]

Hello michal.kit@ada.com, thank you for reaching out to us! The team will review your issue and get back to you soon as soon as possible.

Please review your issue to ensure you've included your environment details and have attached relevant logs (with any sensitive data redacted), so that we're best able to provide you a timely and thorough response. Thanks again!

Generated at Wed Feb 07 22:44:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.