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

  • Home
  • SEARCH
  • 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 6854167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:36:01+00:00 2026-05-27T01:36:01+00:00

I needed to learn node.js and mongodb which requires me to use my mac

  • 0

I needed to learn node.js and mongodb which requires me to use my mac osx, so I am new to the shell command line interface.

Problem: When I followed the instructs on mongodb website and installed mongodb and tried to run, I get the following error messages. Any idea what went wrong?

What I Did:

  1. brew install mongodb
  2. sudo mkdir -p /data/db
  3. sudo chmod 0755 /data/db
  4. sudo chown mongod:mongod /data/db

Error: chown: mongod: Invalid argument

What I Did Next:

  1. mongod

Error:

Mon Nov 21 18:55:08 [initandlisten] MongoDB starting : pid=28304 port=27017 dbpath=/data/db/ 64-bit host=MacBook-Air.local
Mon Nov 21 18:55:08 [initandlisten] db version v2.0.1, pdfile version 4.5
Mon Nov 21 18:55:08 [initandlisten] git version: 3a5cf0e2134a830d38d2d1aae7e88cac31bdd684
Mon Nov 21 18:55:08 [initandlisten] build info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Mon Nov 21 18:55:08 [initandlisten] options: {}
Mon Nov 21 18:55:08 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Mon Nov 21 18:55:08 dbexit: 
Mon Nov 21 18:55:08 [initandlisten] shutdown: going to close listening sockets...
Mon Nov 21 18:55:08 [initandlisten] shutdown: going to flush diaglog...
Mon Nov 21 18:55:08 [initandlisten] shutdown: going to close sockets...
Mon Nov 21 18:55:08 [initandlisten] shutdown: waiting for fs preallocator...
Mon Nov 21 18:55:08 [initandlisten] shutdown: lock for final commit...
Mon Nov 21 18:55:08 [initandlisten] shutdown: final commit...
Mon Nov 21 18:55:08 [initandlisten] shutdown: closing all files...
Mon Nov 21 18:55:08 [initandlisten] closeAllFiles() finished
Mon Nov 21 18:55:08 [initandlisten] shutdown: removing fs lock...
Mon Nov 21 18:55:08 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
Mon Nov 21 18:55:08 dbexit: really exiting now

Doing a ls -ld /data/db gives:

drwxr-xr-x  2 root  wheel  68 Nov 21 18:46 /data/db
  • 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-05-27T01:36:01+00:00Added an answer on May 27, 2026 at 1:36 am

    Nyxynyx-

    It looks like a file permissions problem. You created the /data/db as root, so root is the owner, and the chown command failed (do you already have a user on your system named mongod? if not, that command will fail) so the owner was still root. But then you ran mongod as a normal user so it was unable to create any lock file in the data directory.
    You could:

    1. Run mongod as root
    2. Or, create a mongod user, and run “chown” again for mongod, and run mongod as the user mongod
    3. Or, change the ownership of the data directory to your current user account, and run mongo as your user account.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a learn-by-example C# coder who isn't very advanced, which is why this problem
I'm trying to learn JPA and I want create a simple Java command line
I know DefaultTemplate.xaml does everything needed. But I gonna learn team build this by
On Learn C++, they wrote this to free memory: int *pnValue = new int;
Stemming is something that's needed in tagging systems. I use delicious, and I don't
Question: What kind of resources are needed to learn how to create one's own
I'm super new to programming and I've been using appengine to help me learn
I am new to silverlight and want to learn silverlight. I have installed Visual
I'm trying to learn how to use recursive functions, but am not understanding what
Needed Finfo but deleted msi package, so uninstalled php 5.3.0, downloaded 5.3.2 and installed.

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.