Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:23:48+00:00 2026-06-15T10:23:48+00:00

My Ubuntu computer had crashed, and when I restarted it MongoDB wasn’t working. I

  • 0

My Ubuntu computer had crashed, and when I restarted it MongoDB wasn’t working. I tried the following commands, and got the following output:

$ mongo
Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed

$ service mongodb status
mongodb stop/waiting

$ service mongodb restart
stop: Unknown instance: 
start: Rejected send message, 1 matched rules; type="method_call",
       sender=":1.57" (uid=1000 pid=2227 comm="start mongodb ")
       interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)"
       requested_reply="0"
       destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

$ tail /var/log/mongodb/mongodb.log
[initandlisten] exception in initAndListen: 12596 old lock file, terminating
dbexit: 
[initandlisten] shutdown: going to close listening sockets...
[initandlisten] shutdown: going to flush diaglog...
[initandlisten] shutdown: going to close sockets...
[initandlisten] shutdown: waiting for fs preallocator...
[initandlisten] shutdown: closing all files...
[initandlisten] closeAllFiles() finished
dbexit: really exiting now

(Output reformatted to match website layout.)

What happened? How can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:23:49+00:00Added an answer on June 15, 2026 at 10:23 am

    The log file is telling you that you have an “old lock file”. MongoDB keeps a lock file while it’s running. It creates this file when it is started, and deletes it when it’s stopped. When the computer crashes (or MongoDB crashes, e.g. via kill), this file is not deleted, and thus the database does not start. The existence of this file indicates unclean shutdown of MongoDB.

    Two things can be done:

    1. If this is a development machine and you haven’t been using your database (and neither have your programs), you can remove the file manually. For MongoDB 2.2.2 running on Ubuntu 12.10, it’s in /var/lib/mongodb/mongod.lock. For other versions, the file could be in a different path or it could be named mongo.lock.

    2. The safer route is to follow MongoDB’s Durability and Repair guide. In summary, for a machine with the above configuration, you should execute the following commands:

      sudo -u mongodb mongod --repair --dbpath /var/lib/mongodb/
      sudo service mongod start
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Linux-based (Ubuntu 11.10) Before my computer crashed I had a binary on my computer:
I restarted my computer, and rebooted my VM with Ubuntu 12.04 on it and,
I have computer (ubuntu server). Server have internet and share internet for local network.
Recently I updated my computer to Ubuntu 11.10 64-bits. I have a problem when
This is in Java, cross platform and being debugged on a computer running Ubuntu
Hi I recently Updated my computer so I've installed Ubuntu 11.10 64-bits. to install
I have an ubuntu server (11.10) on a single-board computer that occasionally is subject
Ubuntu Server 9.10, Here is my file, test.py import commands blkid = commands.getoutput('blkid') print
I recently had to re-install my operating system (Ubuntu). The only thing I did
Due to using both Windows and Ubuntu on my computer I'd like to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.