Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.6.2-beta.3] Meteor can't start Mongo server after switching mongo versions #9591

Closed
jamesmillerburgess opened this issue Jan 29, 2018 · 8 comments

Comments

@jamesmillerburgess
Copy link
Contributor

@jamesmillerburgess jamesmillerburgess commented Jan 29, 2018

Switching between 32 and 64-bit versions of MongoDB causes apps to crash when attempting to start MongoDB.

Reproduction steps:

meteor --release 1.6.0.1 create --bare .
meteor --release 1.6.0.1                 // kill once the app has started
meteor npm install @babel/runtime
meteor --release 1.6.2-beta.3

[[[[[ ~/projects/mongo-64-bit ]]]]]

=> Started proxy.
Unexpected mongo exit code 62. Restarting.
Unexpected mongo exit code 62. Restarting.
Unexpected mongo exit code 62. Restarting.
Can't start Mongo server.

meteor --release 1.6.0.1                 // it won't work on the original version now either

[[[[[ ~/projects/mongo-64-bit ]]]]]

=> Started proxy.
Unexpected mongo exit code 14. Restarting.
Unexpected mongo exit code 14. Restarting.
Unexpected mongo exit code 14. Restarting.
Can't start Mongo server.
Unspecified unrecoverable error. Exit was not clean

Alternatively:

meteor --release 1.6.2-beta.3 create --bare .
meteor --release 1.6.2-beta.3                    // kill once the app has started
meteor --release 1.6.0.1            

[[[[[ ~/projects/mongo-64-bit ]]]]]

=> Started proxy.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.

meteor --release 1.6.2-beta.3                    // but this version still works, unlike the first scenario

There is a workaround: meteor reset

@hwillson
Copy link
Member

@hwillson hwillson commented Jan 29, 2018

@jamesmillerburgess I wasn't able to reproduce the first part of your repro steps (I was able to create the 1.6.0.1 project and run it using 1.6.2-beta.3 without any errors), but I did get the Unexpected mongo exit code 14. Restarting. error when jumping back to 1.6.0.1.

I'll mark this as confirmed but I have a feeling addressing this might not be worth the headache involved (especially if Mongo is updating the database files in a way that isn't backwards compatible). In theory the number of people impacted by this should be low, but we'll need to dig into this a bit further. Thanks!

@KoenLav
Copy link

@KoenLav KoenLav commented Jan 30, 2018

We're also experiencing this issue moving from 1.6.1 to 1.6.2-beta.3 and back.

Meteor reset fixes it, but that's not ideal.

@hwillson
Copy link
Member

@hwillson hwillson commented Jan 31, 2018

Thanks guys - the 1.6.2 beta Mongo 3.6 changes have been reverted until we can track down what's happening (85d74f8).

@brookback
Copy link

@brookback brookback commented Feb 8, 2018

I also get this, but not in 1.6.2-beta 👋

Switched back from a branch with Meteor 1.6.1, to a master branch with Meteor 1.4.x. Getting:

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.
make: *** [start] Error 254

before app crashes. I've tried:

  • rm -rf .meteor/local/db/mongod.lock
  • killall mongod

but to no avail.

@hwillson
Copy link
Member

@hwillson hwillson commented Feb 21, 2018

Hi all - just a quick update on this. The database can be repaired by finding the dev_bundle/mongodb/bin/mongod binary that lines up with the Meteor version you're jumping back to, and running a Mongo repair. So in the case of the repro (and using MacOS as an example):

/Users/jsmith/.meteor/packages/meteor-tool/1.6.0_1/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod --dbpath /your/app/.meteor/local/db --repair

Not an ideal fix, but this should at least help get anyone who was hit by this back up and running. We're working on a proper fix for this in #9632. Thanks!

@hwillson hwillson added this to the Release 1.6.2 milestone Mar 5, 2018
@benjamn
Copy link
Member

@benjamn benjamn commented Mar 21, 2018

@hwillson Can we close this now, since we decided to solve this problem with documentation rather than doing something automatic?

@hwillson
Copy link
Member

@hwillson hwillson commented Mar 22, 2018

Sure thing @benjamn - I was just waiting for #9632 to be merged (since it includes the documentation). Now that it's in, we're all set here. Thanks!

@VikR0001
Copy link

@VikR0001 VikR0001 commented Jun 5, 2018

I've got this anomaly too. I'll try some of the fixes described here.

xet7 added a commit to wekan/wekan that referenced this issue Dec 29, 2018
  Note that if MongoDB does not start, you could try fixing meteor's local database with
  command from meteor/meteor#9591 (comment) that for
  Linux is `cd ~ && .meteor/packages/meteor-tool/1.8.0/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod --dbpath ./repos/wekan/.meteor/local/db --repair`
  but that did not work for me, so I needed to move away (or delete) repos/wekan/.meteor/local/db file
  so that it was created again and with command `mongo` database could start correctly.

Thanks to xet7 !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.