Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uninstalled mongodb manually and reinstalled it then mongodb cannot be launched with this error.
2016-02-06T18:10:44.893+0900 I CONTROL [main] ***** SERVER RESTARTED *****
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] MongoDB starting : pid=46957 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=P23722.local
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] db version v3.2.1
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] allocator: system
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] modules: none
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] build environment:
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] distarch: x86_64
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] target_arch: x86_64
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] options: { config: "/usr/local/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/usr/local/var/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/usr/local/var/log/mongodb/mongo.log" } }
2016-02-06T18:10:44.911+0900 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-02-06T18:10:44.913+0900 E STORAGE [initandlisten] WiredTiger (2) [1454749844:913596][46957:0x7fff75fbc000], file:WiredTiger.wt, connection: /usr/local/var/mongodb/WiredTiger.wt: No such file or directory
2016-02-06T18:10:44.923+0900 I - [initandlisten] Assertion: 28595:2: No such file or directory
2016-02-06T18:10:44.923+0900 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating
2016-02-06T18:10:44.923+0900 I CONTROL [initandlisten] dbexit: rc: 100
@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 6, 2016

What I did

rm -rf /usr/local/var/mongodb
brew uninstall --force mongodb
brew install mongodb
@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 6, 2016

@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 6, 2016

The error message looks like one in this report. https://jira.mongodb.org/browse/SERVER-20729

@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 7, 2016

The major difference between 3.2 and 3.0 is the default storage engine. https://docs.mongodb.org/manual/core/storage-engines/
AFAIK, this problem happened after updating mongodb from 3.0 to 3.2.1 with homebrew then removed the entire db files.

@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 7, 2016

The storage engine of the current my mongodb is wiredTiger 🐯

> db.serverStatus().storageEngine
{ "name" : "wiredTiger", "supportsCommittedReads" : true }

its config file is here:

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1
@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 7, 2016

Now my application uses an instance hosted by MongLab. its mongodb's version is 3.0.7.
So I'm guessing this problem is caused by using different storage engines between on my Mac and on heroku. :suspect:

@satoryu

This comment has been minimized.

Copy link
Owner Author

satoryu commented Feb 7, 2016

Bingooooooooo 🎉 🎉 🎉

Fixed the problems by specifying storage engine in its configuration file like this.

storage:
  dbPath: /usr/local/var/mongoedb
  engine: mmpav1

After this change, restarting a mongodb process is required.

@emxjay

This comment has been minimized.

Copy link

emxjay commented Nov 29, 2016

@satoryu I have the same issue, and switching to MMapv1 would not solve my problem, since I already have an existing database.

Do you, by chance, how can I convert my data?

@eliwilliamson

This comment has been minimized.

Copy link

eliwilliamson commented Jan 4, 2017

fixed some typos in your snippet @satoryu

storage:
  dbPath: /usr/local/var/mongodb
  engine: mmapv1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.