Unable to connect to MongoDB - duplicate key error collection: graylog.traffic index

hi guys

Sorry I made a typo on my last msg

I just updated graylog from 5.1.8 to 5.2.0 and I am getting the following error in the log files.

2023-11-14T15:34:51.707-05:00 ERROR [CmdLineTool] Guice error (more detail on log level debug): com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message 'Index build failed: de47eef6-9a8d-42023-11-14T15:34:51.707-05:00 ERROR [CmdLineTool] Guice error (more detail on log level debug): com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message ‘Index build failed: de47eef6-9a8d-4663-bd3e-e5d86bb94498: Collection graylog.traffic ( 08552ae8-1be3-4820-bf85-dc9876a60d66 ) :: caused by :: E11000 duplicate key error collection: graylog.traffic index: bucket_1 dup key: { bucket: new Date(1699988400000) }’ eyException: Write failed with error code 11000 and error message 'Index build failed: a8eeb149-edea-42023-11-14T15:34:51.707-05:00 ERROR [CmdLineTool] Guice error (more detail on log level debug): com.mongodb.DuplicateKeyException: Write failed with error code 11000 and error message ‘Index build failed: a8eeb149-edea-49b8-aa6e-8dcfce362b54: Collection graylog.traffic ( 08552ae8-1be3-4820-bf85-dc9876a60d66 ) :: caused by :: E1160d66 ) :: caused by :: E11000 duplicate key error collection: graylog.traffic index: bucket_1 dup key: { bucket: new Date(1699988400000) }’
2023-11-14T15:34:51.707-05:00 ERROR [Server]

################################################################################

ERROR: Unable to connect to MongoDB. Is it running and the configuration correct?
Details: Write failed with error code 11000 and error message ‘Index build failed: 3e536d8b-7337-448f-87f4-f1ed41bbb463: Collection graylog.traffic ( 08552ae8-1be3-4820-bf85-dc9876a60d66 ) :: caused by :: E11000 duplicate key error collection: graylog.traffic index: bucket_1 dup key: { bucket: new Date(1699988400000) }’

However in the logs before the error I see its able to connect to Mongodb
2023-11-14T15:34:46.022-05:00 INFO [MongoDBPreflightCheck] Connected to MongoDB version 6.0.9

Can anoyone help me on this one.
Thanks

Hey @badaboom

Ensure you have a backups prior to my suggestion.

If you able check MongoDb simply drop the collection thats making the request. This should work just fine. If this is in Production becareful.