Mongo 4 & Meteor 1.8

Hi,

I upgraded meteor version to 1.8 on my app.
I had an error on DB then i did reset DB. Wrong idea but anyway…

Now i’m trying to dump the new DB with mongodump command and i can see that meteor mongo version is 4 and my version on server is 3.6. I can’t upgrade to 4 on server. So i can’t do a dump via mongodump. Is there a way to achieve this? Maybe a way to downgrade meteor mongo version to 3.6? An other solution to enable mongodump?

Thx!

You might find this interesting

I finally upgraded mongo on my computer.
I can use mongodump again now.
I was wrong to upgrade then reset without having dump … it was silly.
i will know for the next time.

Thank’s for your answer!

@fredhasselot - how did you upgrade mongo? I’m on Meteor 1.7.0.5 with Mongo v3.6.4 and once I upgrade to 1.8 I get the Mongo exit code 62. I’ve tried to search how to upgrade Mongo but can’t seem to find something reliable enough to try with Meteor.

1 Like

I’m working on ubuntu OS. I upgraded via the update manager but i could via apt-update.
It depend on your OS.

The problem is similar to this one: Updating to 1.7.1: Unexpected mongo exit code 62. Restarting

In my case the solution was:

  1. to do a “mongodump” BEFORE upgrade (but i did not)
  2. then upgrade meteor,
  3. type “meteor reset” in case of exit 62 error (empty the database)
  4. upgrade mongo on the system to version 4 if needed (like i needed) because meteor 1.8 use mongo 4 so if you wanna use dump commands from your system later, it’s necessary.
  5. finally “mongorestore” the dump.

in my case like i wrote.

I don’t know if there is a way to specify version of mongo to use on meteor to have the same version on meteor and the system running it. It would be a solution, i guess.

Gotcha. I’m on a Mac OS so it’s step #4 in your bullets above that I need to do. I’m getting the same error (62) and need to upgrade mongo itself. I don’t have the mongodump capabilities and I’m hoping to not need to reset meteor altogether.

How did you go? Any tips… I remember spending far too long getting the mongo upgrade to 1.7 to work. Don’t really want to go through it again…

This command:

~/.meteor/packages/meteor-tool/1.8.0/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod --dbpath my-app/.meteor/local/db --repair

Has not worked…

I’ll give it a bit of time and if I get it to work, will post here, if not, I’ll just roll back and wait for a solution until I have a bit more time to spare for this

Righto, to help anyone else stuck in this situation (assuming you have upgraded already).

Steps:

  1. In a terminal, run the following command: Note that the ‘1.7.0_5’ may be different in your case. That is what it should be if you were on the latest version of 1.7 when you upgraded to 1.8
~/.meteor/packages/meteor-tool/1.7.0_5/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod --dbpath path-to-your-app/.meteor/local/db
  1. In a different terminal, run the following two commands:
    A -To start the mongo shell
mongo --port 27017

B - Once the shell is started, to get mongo ready/upgradable or whatever the case is (I’m not actually sure what is going on under the hood here)

db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )

That should do it. Close both terminals and run meteor 1.8…

3 Likes

do i need to install mongodb on my local if i just use the meteor bundled mongodb?

No, if you’re just using Meteor’s bundled mongo versions, you don’t need mongodb installed

Thanks for this. I think there’s a missing command in #2. I’m not able to get anything working so far. Can you paste the first of the two mongo commands? Also, will the feature-compatibility version mean mongo v4 isn’t used, but instead stays at 3.6? I’m hoping to reap performance benefits with the latest mongo, if any.

Hmm - I had an extra backtick by mistake which I have removed.

But the command is right besides that. What version of Meteor were you on prior? That may need replacing. Also have you replaced the path to your db?

With regards to 3.6 vs 4.0 - I’m not 100% certain what that final command does tbh. Perhaps test out a Meteor 4.0 specific operation you may have in mind and report back here?

I had the same issue after performing a Meteor update to version 1.8.

I’m using Cordova and Mongo so, as a sanity check, I deleted my .meteor/local folder and re-ran the build command in my project.

This solved the Error Code 62 thus indicating that the Mongo had been updated correctly but my /local build files had not. Deleting and re-building the app made sure all correct versions were in the correct places.

Hopefully this is useful to someone :slight_smile:

I followed these steps and started getting this error:

Unexpected mongo exit code 14. Restarting.

Any ideas? I see issues on this from a few years back, but no recent issues