RocketChat / server-snap

Rocket.Chat server snap
MIT License
18 stars 17 forks source link

rocketchat-server fails to start after install #6

Open Sing-Li opened 7 years ago

Sing-Li commented 7 years ago

With 0.50.1 , the rocketchat-server does not restart. Instead, the following causes it to stop the service:

Feb 03 01:26:53 vps105588 snap[16633]: /snap/rocketchat-server/x1/node_modules/fibers/future.js:313
Feb 03 01:26:53 vps105588 snap[16633]:                                                 throw(ex);
Feb 03 01:26:53 vps105588 snap[16633]:                                                 ^
Feb 03 01:26:53 vps105588 snap[16633]: MongoError: no primary found in replicaset
Feb 03 01:26:53 vps105588 snap[16633]:     at Object.Future.wait (/snap/rocketchat-server/x1/node_modules/fibers/future.js:
Feb 03 01:26:53 vps105588 snap[16633]:     at new MongoConnection (meteor://💻app/packages/mongo/mongo_driver.js:219:27)
Feb 03 01:26:53 vps105588 snap[16633]:     at OplogHandle._startTailing (meteor://💻app/packages/mongo/oplog_tailing.js:200:
Feb 03 01:26:53 vps105588 snap[16633]:     at new OplogHandle (meteor://💻app/packages/mongo/oplog_tailing.js:76:8)
Feb 03 01:26:53 vps105588 snap[16633]:     at new MongoConnection (meteor://💻app/packages/mongo/mongo_driver.js:222:25)
Feb 03 01:26:53 vps105588 snap[16633]:     at new MongoInternals.RemoteCollectionDriver (meteor://💻app/packages/mongo/remot
Feb 03 01:26:53 vps105588 snap[16633]:     at Object.<anonymous> (meteor://💻app/packages/mongo/remote_collection_driver.js:
Feb 03 01:26:53 vps105588 snap[16633]:     at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
Feb 03 01:26:53 vps105588 snap[16633]:     at new Mongo.Collection (meteor://💻app/packages/mongo/collection.js:103:40)
Feb 03 01:26:53 vps105588 snap[16633]:     at AccountsServer.AccountsCommon (meteor://💻app/packages/accounts-base/accounts_
Feb 03 01:26:53 vps105588 snap[16633]:     - - - - -
Feb 03 01:26:53 vps105588 snap[16633]:     at /snap/rocketchat-server/x1/programs/server/npm/node_modules/meteor/npm-mongo/
Feb 03 01:26:53 vps105588 snap[16633]:     at null.<anonymous> (/snap/rocketchat-server/x1/programs/server/npm/node_modules
Feb 03 01:26:53 vps105588 snap[16633]:     at null.g (events.js:260:16)
Feb 03 01:26:53 vps105588 snap[16633]:     at emitOne (events.js:77:13)
Feb 03 01:26:53 vps105588 snap[16633]:     at null.emit (events.js:169:7)
Feb 03 01:26:53 vps105588 snap[16633]:     at /snap/rocketchat-server/x1/programs/server/npm/node_modules/meteor/npm-mongo/
Feb 03 01:26:53 vps105588 snap[16633]:     at /snap/rocketchat-server/x1/programs/server/npm/node_modules/meteor/npm-mongo/
Feb 03 01:26:53 vps105588 snap[16633]:     at nextTickCallbackWith0Args (node.js:436:9)
Feb 03 01:26:53 vps105588 snap[16633]:     at process._tickCallback (node.js:365:13)
Feb 03 01:26:53 vps105588 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Main process exited, code=exited, s
Feb 03 01:26:53 vps105588 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Unit entered failed state.
Feb 03 01:26:53 vps105588 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Failed with result 'exit-code'.
Feb 03 01:26:53 vps105588 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Service hold-off time over, schedul
Feb 03 01:26:53 vps105588 systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.
Feb 03 01:26:53 vps105588 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Start request repeated too quickly.
Feb 03 01:26:53 vps105588 systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-server.

Mongo will not be ready for at least 40 seconds but RC no longer retires.

Sing-Li commented 7 years ago

A lot of work has been on-going to solve this problem behind the scene. Thanks totally to @elespike

He has been in communications with Ubuntu's snapcraft team and has made a PR that will make our startup attempt more resilient to RC's seasonal code changes (sometimes we fail fast on first error, sometimes we re-try forever. sometimes ....).

https://bugs.launchpad.net/snapcraft/+bug/1662240

https://github.com/snapcore/snapcraft/pull/1109

We will wait for snapcraft's 2.27 release (where his PR will become part of distro) and subsequent testing before closing this issue.