Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Upgrade to 0.53.0 failed

Open sirchojin opened this issue 9 years ago • 9 comments

Rocket.Chat Version: 0.53.0 Running Instances: 1 DB Replicaset OpLog: Nope Node Version: Docker version

I just upgraded docker from 0.52.0 to rocketchat/rocket.chat:0.53.0.

During start, rocket.chat crashes with the following message: Attaching to rocketchat_rocketchat_1 rocketchat_1 | rocketchat_1 | /app/bundle/programs/server/node_modules/fibers/future.js:313 rocketchat_1 | throw(ex); rocketchat_1 | ^ rocketchat_1 | MongoError: failed to connect to server [mongo:27017] on first connect rocketchat_1 | at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15) rocketchat_1 | at new MongoConnection (packages/mongo/mongo_driver.js:217:27) rocketchat_1 | at [object Object]._.extend._startTailing (packages/mongo/oplog_tailing.js:200:33) rocketchat_1 | at new OplogHandle (packages/mongo/oplog_tailing.js:76:8) rocketchat_1 | at new MongoConnection (packages/mongo/mongo_driver.js:220:25) rocketchat_1 | at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16) rocketchat_1 | at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10) rocketchat_1 | at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19) rocketchat_1 | at new Mongo.Collection (packages/mongo/collection.js:99:40) rocketchat_1 | at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18) rocketchat_1 | - - - - - rocketchat_1 | at [object Object].<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:325:35) rocketchat_1 | at emitOne (events.js:77:13) rocketchat_1 | at [object Object].emit (events.js:169:7) rocketchat_1 | at [object Object].<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:270:12) rocketchat_1 | at [object Object].g (events.js:260:16) rocketchat_1 | at emitTwo (events.js:87:13) rocketchat_1 | at [object Object].emit (events.js:172:7) rocketchat_1 | at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:173:49) rocketchat_1 | at Socket.g (events.js:260:16) rocketchat_1 | at emitOne (events.js:77:13) rocketchat_rocketchat_1 exited with code 1

I rolled back to 0.52.0, it starts without any problem.

sirchojin avatar Mar 01 '17 20:03 sirchojin

Can confirm.

I upgraded Mongo (docker instance - for the first time in a year at least), grabbed the rocket.chat/latest docker image, and got the same as above.

Was worried that the new Mongo blew everything up, but as stated by @gpoudrel reverting to 0.52.0 cleared everything up and I'm back in business.

Flitterkill avatar Mar 02 '17 04:03 Flitterkill

@Flitterkill @gpoudrel can you give us more info? If you use docker, you use for sure docker-compose? How looks youre docker-compose file?

TheReal1604 avatar Mar 02 '17 07:03 TheReal1604

I use for sure docker-compose. Here is my docker-compose.yml:

db: image: mongo volumes: - ./data/runtime/db:/data/db - ./data/dump:/dump command: mongod --smallfiles

rocketchat: image: rocketchat/rocket.chat:0.52.0 environment: - MONGO_URL=mongodb://db:27017/rocketchat - ROOT_URL=https://bla - Accounts_UseDNSDomainCheck=True - MAIL_URL=smtp://172.17.0.1:25 links: - db:db ports: - 3000:3000

hubot: image: rocketchat/hubot-rocketchat:latest volumes: - ./scripts:/home/hubot/scripts environment: - ROCKETCHAT_URL=172.17.0.4:3000 - ROCKETCHAT_ROOM=bla - ROCKETCHAT_USER=bli - ROCKETCHAT_PASSWORD=blu - BOT_NAME=bluuuu - EXTERNAL_SCRIPTS=hubot-help links: - rocketchat:rocketchat

this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier

ports: - 3001:8080

sirchojin avatar Mar 02 '17 08:03 sirchojin

Confirmed, we have also seen the connection problem with mongo with the last image of docker

docker run -it --rm -e MONGO_URL=mongodb://rock01.example.com:27017/rocketchat -e ROOT_URL=https://rocket.example.com rocketchat/rocket.chat:latest                                          

/app/bundle/programs/server/node_modules/fibers/future.js:313
                                                throw(ex);
                                                ^
MongoError: failed to connect to server [mongo:27017] on first connect
    at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
    at new MongoConnection (packages/mongo/mongo_driver.js:217:27)
    at [object Object]._.extend._startTailing (packages/mongo/oplog_tailing.js:200:33)
    at new OplogHandle (packages/mongo/oplog_tailing.js:76:8)
    at new MongoConnection (packages/mongo/mongo_driver.js:220:25)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
    at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
    at new Mongo.Collection (packages/mongo/collection.js:99:40)
    at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
    - - - - -
    at [object Object].<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:325:35)
    at emitOne (events.js:77:13)
    at [object Object].emit (events.js:169:7)
    at [object Object].<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:270:12)
    at [object Object].g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at [object Object].emit (events.js:172:7)
    at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:173:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)

vmalaga avatar Mar 02 '17 10:03 vmalaga

I had a similar problem, but instead of connection error my error message was that MONGO_OPLOG_URL needs to be set (it never needed to be set in 0.52). While not the exact same error message as the one posted here, maybe it helps nonetheless.

It seems like Rocket.Chat now assumes a replica set exists.

If you are using docker-compose, the following steps got it working again:

  1. docker-compose stop (just to be safe)
  2. in docker-compose, in the mongo section, add a "--replSet rs0" to the command, for example: command: mongod --smallfiles --oplogSize 128 --replSet rs0
  3. Add the following container (taken from rocket.chat docs):
# this container's job is just run the command to initialize the replica set.
# it will run the command and remove himself (it will not stay running)
mongo-init-replica:
  image: mongo:3.2
  command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
  links:
  - mongo:mongo
  1. Add the following environment variable to the rocketchat container: MONGO_OPLOG_URL=mongodb://mongo:27017/local
  2. docker-compose up -d

You should be up and running again. And you should be able to just remove the mongo-init-replica container from the compose file after the first start

brakhane avatar Mar 02 '17 11:03 brakhane

Confirm the problem using docker-compose, upgrading from 0.49 to 0.53. Upgrading to 0.52 works.

s17t avatar Mar 02 '17 14:03 s17t

Also can confirm that this happens on OpenShift Origin/OCP deployments as well. Downgrading to 0.52 recovered our installation.

michaelryanmcneill avatar Mar 02 '17 19:03 michaelryanmcneill

Can confirm the problem when using docker-compose, upgrade to 0.53 did not work, upgrade to 0.52 worked. Error message related to MONGO_OPLOG_URL.

tholu avatar Mar 03 '17 09:03 tholu

@rocket-cat close

Closing this. If it is still an issue, please get back to us. Latest version is 0.61.2 and should be the one being tested against.

Cheers Thomas

TwizzyDizzy avatar Feb 26 '18 16:02 TwizzyDizzy