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

MongoError: Mod on _id not allowed #835

Closed
Surfoo opened this issue Sep 19, 2015 · 17 comments
Closed

MongoError: Mod on _id not allowed #835

Surfoo opened this issue Sep 19, 2015 · 17 comments

Comments

@Surfoo
Copy link
Contributor

Surfoo commented Sep 19, 2015

Hello,

I tried to install Rocket.Chat (from master) on my own server (Debian Wheezy with Apache, no nginx, no ssl), and on the startup, I have a 503 error.

In the err-0.log I have:

MongoError: Mod on _id not allowed
    at Object.Future.wait (/var/www/rocket.chat/bundle/programs/server/node_modules/fibers/future.js:398:15)
    at [object Object].<anonymous> (packages/meteor/helpers.js:119:1)
    at [object Object].MongoConnection.(anonymous function) [as update] (packages/mongo/mongo_driver.js:678:1)
    at OptimizedApply (packages/meteorhacks:kadira/lib/utils.js:35:1)
    at Object.ret.(anonymous function) (packages/meteorhacks:kadira/lib/hijack/db.js:20:1)
    at Object.fields (packages/matb33:collection-hooks/update.js:80:1)
    at Object.collection.(anonymous function) [as update] (packages/matb33:collection-hooks/collection-hooks.js:103:1)
    at [object Object].Mongo.Collection.(anonymous function) (packages/mongo/collection.js:575:1)
    at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/dispatch:run-as-user/lib/collection.overwrites.js:51:1)
    at [object Object].Mongo.Collection.upsert (packages/mongo/collection.js:609:1)
    - - - - - 
    at Object.toError (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
    at /var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/collection/core.js:636:22
    at Server.Base._callHandler (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
    at /var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
    at [object Object].MongoReply.parseBody (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at [object Object].<anonymous> (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
    at [object Object].emit (events.js:95:17)
    at [object Object].<anonymous> (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
    at [object Object].emit (events.js:98:17)
    at Socket.<anonymous> (/var/www/rocket.chat/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:440:22)

What can I do to fix the issue?

@geekgonecrazy
Copy link
Contributor

What version of mongo are you running? Meteor requires 2.6 or greater. We've been trying to stay compatible with the 2.4 but its on ongoing battle.

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 19, 2015

With wheezy-backports, it's 2.4.8

@geekgonecrazy
Copy link
Contributor

Give 2.6 or 3.0 a shot. Check mongodb's website. I think the have Debian repos for more up to date versions

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 19, 2015

Thanks it works with the 3.0.6 version! I registered the first account, but I can't find the Administration.. Where it is?

@geekgonecrazy
Copy link
Contributor

@Surfoo did you create the user before upgrading? Its possible it didn't successfully make it admin.

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 19, 2015

Hum, no after the upgrade, because with mongo 2.4 I had a 503 error. How can I fix that?

@rwakida
Copy link
Contributor

rwakida commented Sep 19, 2015

Hi @Surfoo there was a bug with assigning 'admin' role to the first created user. I submitted a fix, but until that gets merged to master, you can simply restart meteor. At startup, RocketChat will assign the oldest user the 'admin' role IF no admin already exists.

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 19, 2015

OK, thanks. How can I restart meteor?

@rwakida
Copy link
Contributor

rwakida commented Sep 19, 2015

Or you can manually update the user in mongo. The user should have the following role:

"roles" : {
        "__global_roles__" : [
            "admin"
        ]
    },

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 19, 2015

I'm totally newbie with mongodb, I think restart meteor is easier than update the db :)

@geekgonecrazy
Copy link
Contributor

@Surfoo how did you start meteor? If you just cloned and then typed meteor. Then a ctrl+c will work. If you used pm2 you will have to do a pm2 restart like you did during setup.

@rwakida
Copy link
Contributor

rwakida commented Sep 20, 2015

@Surfoo, I've been using mongodb for a while and I still feel like a newb. 😄 .

If @geekgonecrazy's advice doesn't work for you, join the rocket chat demo and talk to the devs for realtime feedback.

https://demo.rocket.chat

@Surfoo
Copy link
Contributor Author

Surfoo commented Sep 20, 2015

ok, I restarted the app with pm2, it works, and I have my admin account :-)

@Surfoo Surfoo closed this as completed Sep 20, 2015
@Q-efx
Copy link

Q-efx commented May 14, 2016

Upgrading to newset MongoDB Version fixed the isee

@geekgonecrazy
Copy link
Contributor

👍

@mikevanwinkle
Copy link

👍 updating mongodb worked for me

@r00t4bl3
Copy link

👍 I use mongodb version 2.4 and after node main.js it shows this error. After upgrading to 2.6 and it runs perfectly. I think the manual should be updated so it says minimal mongodb version is 2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants