Services connections to mongo using vault randomly start failing - Command failed with error 13

Has anyone had an issue where services will connect to mongo, through vault but then randomly start failing with an error like the one below. This is happening across all of our services. Restarting the services clears up the issue.

com.mongodb.MongoCommandException: Command failed with error 13: ‘Not authorized to execute command’

I don’t know Mongo, so I can’t help you with that error but after the auth has been generated Vault is no longer in the picture unless the TTL runs out on that token and the temporary user is removed/deleted.

From the sounds of it, if something is working and then stops working (same command, parameters) it sounds like the TTL is running out on that user and Vault is deleting it from Mongo, which could represent the error you’re seeing. That’s a complete guess though.