I have a fairly archaic webapp setup that relies on MongoDB running on a server with Debian 8.5. Unfortunately MongoDB was recently upgraded on the server and the application broke. MongoDB was upgraded to version 2.4.10 which gives this error on startup
need to upgrade database admin with pdfile version 4.22, new version: 4.5
When I try to run upgrade the admin database, I get
error: exception cloning object in admin.system.users system.users entry must have either a 'pwd' or a 'userSource' field, but not both
Basically I can't upgrade the database. I've tried repairing the database and that doesn't work either. It seems like the problem may be caused by having duplicate users in the database. One potential solution is to remove the duplicates, but because mongod won't run, I'm not sure how to do that.
I tried downgrading mongodb via apt, but was unable to find a version that apt recognized. For example
sudo apt-get install mongodb=2.2.7
E: version '2.2.7' for 'mongodb' was not found
After googling around, it seems that mongodb 2.6 might not have the same problem, unforunately I can't get apt to install anything newer than what it currently has, 2.4.10. I've run apt-get update, but apt-cache policy shows that the candidate is the same as the installed version.
Basically it seems like there are three ways that I could get this site up and running again.
- Successfully upgrade the admin database so that it works with the version of MongoDB that was recently installed.
- Downgrade MongoDB to 2.2.7
- Upgrade MongoDB to 2.6.x
Anyone know how I can get any of those things to happen?