1

Can you help me with this problem please? I have updated (apt-get upgrade) my system Debian GNU/Linux 7.6 (wheezy) but for problem with disk space operation failed. After I have released disk space, but MongoDB does not start. I have tried several procedures.

First apt-get --purge remove mongodb-org:

invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
 mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

In /etc/init.d/ was:

mongod -> /lib/init/upstart-job 

I removed this and replace it with mongod from other mongoDB installation from other system. Then uninstallation was correct.

After I run apt-get install -y mongodb-org but it failed with:

invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100
Setting up MongoDB package-org-Mongos (2.6.4) ...
Setting up MongoDB package-org-tools (2.6.4) ...
dpkg: unmet dependencies prevent configuration package MongoDB-org:
  MongoDB-org depends on MongoDB-org-server; but:
   MongoDB package-org-server is not configured yet.

In /etc/init.d/ was:

mongod -> /lib/init/upstart-job 
mongod.dpkg-bak

I removed mongod and renamed mongod.dpkg-bak to mongod. Then installation was correct. But MongoDB does not start.

Reading package lists ... Done
It creates a dependency tree
Reading state information ... Done
MongoDB-org is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation will be used to drive other 0 B.
Setting up MongoDB package-org-server (2.6.4) ...
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing MongoDB-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: unmet dependencies prevent configuration package MongoDB-org:
MongoDB-org depends on MongoDB-org-server; but:
MongoDB package-org-server is not configured yet.

dpkg: error processing MongoDB-org (--configure):
   dependency problem - leave it unconfigured
Errors were encountered while processing:

MongoDB-org-server MongoDB-org E: Sub-process /usr/bin/dpkg returned an error code (1)

If I run service mongod start:

[FAIL] Starting database: mongodb failed!

But /var/log/mongod/mongod.log does not contain any entries from this time. Thank you very much for help.

dpkg-query -l "MongoDB-org *" output:

+++-=================================-=====================-=====================-=======================================================================
    iU  mongodb-org                       2.6.4                 i386                  MongoDB open source document-oriented database system (metapackage)
    ii  mongodb-org-mongos                2.6.4                 i386                  MongoDB sharded cluster query router
    iF  mongodb-org-server                2.6.4                 i386                  MongoDB database server
    ii  mongodb-org-shell                 2.6.4                 i386                  MongoDB shell client
    ii  mongodb-org-tools                 2.6.4                 i386                  MongoDB tools
    un  mongodb-org-unstable              <none>                                  (no description available)
    un  mongodb-org-unstable-mongos       <none>                                  (no description available)
    un  mongodb-org-unstable-server       <none>                                 (no description available)
    un  mongodb-org-unstable-shell        <none>                                  (no description available)
    un  mongodb-org-unstable-tools        <none>                                  (no description available)

dpkg --configure mongodb-org-server mongodb-org:

Setting up mongodb-org-server (2.6.4) …
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: unmet dependencies prevent configuration package MongoDB-org:
MongoDB-org depends on MongoDB-org-server; but:
MongoDB package-org-server is not configured yet.

dpkg: error processing MongoDB-org (--configure):
dependency problem - leave it unconfigured
Errors were encountered while processing:
MongoDB-org-server
MongoDB-org

dpkg --configure --force-depends mongodb-org-server mongodb-org:

Setting up mongodb-org-server (2.6.4) …
[FAIL] Starting database: mongodb failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems, but configuring as per your requirement:
 mongodb-org depends on mongodb-org-server; however:
  MongoDB package-org-server is not configured yet.

Setting org-package MongoDB (2.6.4) ...
Errors were encountered while processing:
 mongodb-org-server
  • When you say you've updated the system, during which there was the issue of lacking disk space, were you just upgrading mongodb or doing e.g. full dist-upgrade from older version of Debian or something else? As for the logs, you might find something in /var/log/daemon.log. – zagrimsan Sep 29 '14 at 12:28
  • @zagrimsan Thanks, I described my problem with disk space here: unix.stackexchange.com/questions/157760/…. My /var/log/deamon.log is empty, /var/log/deamon.log.1 does not contain anything about this... :-( I have used apt-get upgrade only... – Mato Sep 30 '14 at 17:39
  • Given that you seemed to care about the DB content (based on the other Q) I really hope you've backed it up since the purge operation you mention at the top of this Q would have wiped it (at least if it had succeeded)... – zagrimsan Oct 1 '14 at 9:51
  • Please post the output of `dpkg-query -l "mongodb-org*"' so that we can see the state the various packages are in. – zagrimsan Oct 1 '14 at 10:04
  • @zagrimsan thanks, I have backup of /var/lib/mongodb and this directory is still on my system with content... But I does not run or reinstall MongoDB as application itself... :-( I have added dpkg-query -l "mongodb-org*" output to main post. – Mato Oct 1 '14 at 19:01
2

Option 1:

As you seem to have half-configured mongodb-org-server and unpacked but (not configured) mongodb-org, please try the following command:

dpkg --configure mongodb-org-server mongodb-org

If also that fails for dependency issues, try this:

dpkg --configure --force-depends mongodb-org-server mongodb-org

Option 2:

As package configuration doesn't seem to get done ok in your case, I'd suggest next to try to clean up the system of the previous installation and then do a fresh install. However, the following is pretty rough way of doing it and I suggest you to first read it through and keep in mind that I haven't actually tested it.

First, obtain the list of files installed by the mongodb-org packages:

dpkg-query -L mongodb-org mongodb-org-server mongodb-org-mongos mongodb-org-shell mongodb-org-tools | grep "^\/[^\.]" > mongo.files

Then, do validate the contents of mongo.files (to make sure it only contains paths that are ok to be deleted) by doing:

less mongo.files

Then, remove those files from the system by issuing:

 rm `cat mongo.files`

Next it is time to tell the package manager that those packages are not currently installed in the system by modifying manually /var/lib/dpkg/status. Before doing anything to that file, back it up in case something goes wrong (remember, we're doing surgery on the package manager internal data...). The file is formatted in sections of sequential lines of text with the sections separated by an empty line. Find out all sections in the file that begin by Package: mongodb-org and remove those up (delete all lines from the line starting with 'Package' up to the empty line). When done, save the file and run apt-get update followed by apt-get install mongodb-org.

I certainly hope that doesn't break anything and in the end you get a functioning copy of MongoDB.

  • thanks, but it is unsuccessful I have added output to main post. – Mato Oct 3 '14 at 16:34
  • thanks, but it did not help me, but finally I have installed MongoDB from other repository deb ftp.debian.org/debian wheezy-backports main and it works correctly... – Mato Oct 5 '14 at 11:33
  • Good to hear @Mato that you were able to solve it. But do you mean you just installed the Debian mongodb packages over the existing broken installation? In that case you probably will end up struggling with the broken packages later on. – zagrimsan Oct 5 '14 at 13:01
  • before new installation I had uninstalled MongoDB with apt-get remove --purge this way, that I copied mongod to /etc/init.d from other system, where mongodb works correctly... After this I could uninstall mongodb correctly... – Mato Oct 5 '14 at 14:24
  • 1
    @pstrag That is most unfortunate :( but also a good lesson on validating all file lists before doing anything with them. I hope you had backups... Anyway, thank you for posting, I have now adjusted the command line so that (rather odd) path should not be included so that no-one else would suffer the same result. It's beyond my understanding why a package would include the root dir anyway. – zagrimsan Aug 17 '15 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.