I faced hours of searching for answers.
I was attempting to run a snapshot on Docker. In my case, after running also the commands to switch the owner to mongodb, what worked was the following command
mongod --repair