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

hi guys

I just updated graylog from 5.1.8 to 5.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

Did you really mean to downgrade from 5.1 to 5.0? Not sure how you got into this state, but it might be related to downgrading.

For a quick fix: delete the offending entry from the traffic collection in MongoDB.

Actually its a typo, I upgraded from 5.1.8 to 5.2.
Sorry for that