{"action":"created","issue":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/12308","repository_url":"https://api.github.com/repos/RocketChat/Rocket.Chat","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/12308/labels{/name}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/12308/comments","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/12308/events","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/12308","id":368799560,"node_id":"MDU6SXNzdWUzNjg3OTk1NjA=","number":12308,"title":"snap fails to start after every update; restart works","user":{"login":"Bubu","id":105185,"node_id":"MDQ6VXNlcjEwNTE4NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/105185?v=4","gravatar_id":"","url":"https://api.github.com/users/Bubu","html_url":"https://github.com/Bubu","followers_url":"https://api.github.com/users/Bubu/followers","following_url":"https://api.github.com/users/Bubu/following{/other_user}","gists_url":"https://api.github.com/users/Bubu/gists{/gist_id}","starred_url":"https://api.github.com/users/Bubu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bubu/subscriptions","organizations_url":"https://api.github.com/users/Bubu/orgs","repos_url":"https://api.github.com/users/Bubu/repos","events_url":"https://api.github.com/users/Bubu/events{/privacy}","received_events_url":"https://api.github.com/users/Bubu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-10T18:42:01Z","updated_at":"2018-10-11T16:16:50Z","closed_at":null,"author_association":"NONE","body":"### Description:\r\n\r\n\r\n\r\n### Steps to reproduce:\r\n\r\nEither: Run `snap refresh rocketchat-server` in case there's an update available.\r\nOr: Run `snap disable rocketchat-server && snap enable rocketchat-server`\r\n\r\n### Expected behavior:\r\n\r\n`snap.rocketchat-server.rocketchat-server.service` is in started state\r\n\r\n### Actual behavior:\r\n\r\n`snap.rocketchat-server.rocketchat-server.service` is in failed state:\r\n\r\n```\r\n$ sudo systemctl status snap.rocketchat-server.rocketchat-server.service \r\n● snap.rocketchat-server.rocketchat-server.service - Service for snap application rocketchat-server.rocketchat-server\r\n   Loaded: loaded (/etc/systemd/system/snap.rocketchat-server.rocketchat-server.service; enabled; vendor preset: enabled)\r\n   Active: failed (Result: exit-code) since Wed 2018-10-10 20:18:17 CEST; 17s ago\r\n  Process: 10423 ExecStart=/usr/bin/snap run rocketchat-server (code=exited, status=1/FAILURE)\r\n Main PID: 10423 (code=exited, status=1/FAILURE)\r\n      CPU: 673ms\r\n\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Unit entered failed state.\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Failed with result 'exit-code'.\r\nOkt 10 20:18:17 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Service hold-off time over, scheduling restart.\r\nOkt 10 20:18:17  systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.\r\nOkt 10 20:18:17 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Start request repeated too quickly.\r\nOkt 10 20:18:17  systemd[1]: Failed to start Service for snap application rocketchat-server.rocketchat-server.\r\nOkt 10 20:18:17 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Unit entered failed state.\r\nOkt 10 20:18:17 systemd[1]: snap.rocketchat-server.rocketchat-server.service: Failed with result '\r\n```\r\n\r\nThe mongo service is working. The rocketchat-server service starts working again with a simple systemctl restart\r\n\r\n### Server Setup Information:\r\n\r\n- Version of Rocket.Chat Server: 0.69.2\r\n- Operating System: Debian stretch (9.5)\r\n- Deployment Method: snap\r\n- Number of Running Instances: 1\r\n- DB Replicaset Oplog: ?\r\n- NodeJS Version: these come from the snap\r\n- MongoDB Version: same\r\n\r\n### Server logs\r\n\r\n```\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Service hold-off time over, scheduling restart.\r\nOkt 10 20:18:17  systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.\r\nOkt 10 20:18:17  systemd[1]: Started Service for snap application rocketchat-server.rocketchat-server.\r\nOkt 10 20:18:17  /usr/bin/snap[10423]: cmd.go:105: DEBUG: restarting into \"/snap/core/current/usr/bin/snap\"\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: Checking if oplog has been enabled, and enabling if not\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: MongoDB shell version: 3.2.7\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: connecting to: test\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: 2018-10-10T20:18:17.171+0200 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: 2018-10-10T20:18:17.171+0200 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: connect@src/mongo/shell/mongo.js:229:14\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: @(connect):1:6\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: exception: connect failed\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: /snap/rocketchat-server/1324/programs/server/node_modules/fibers/future.js:313\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:                                                 throw(ex);\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:                                                 ^\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]: MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Pool.<anonymous> (/snap/rocketchat-server/1324/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at emitOne (events.js:116:13)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Pool.emit (events.js:211:7)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Connection.<anonymous> (/snap/rocketchat-server/1324/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-co\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Object.onceWrapper (events.js:317:30)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at emitTwo (events.js:126:13)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Connection.emit (events.js:214:7)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Socket.<anonymous> (/snap/rocketchat-server/1324/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/l\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Object.onceWrapper (events.js:315:30)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at emitOne (events.js:116:13)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at Socket.emit (events.js:211:7)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at emitErrorNT (internal/streams/destroy.js:64:8)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at _combinedTickCallback (internal/process/next_tick.js:138:11)\r\nOkt 10 20:18:17  rocketchat-server.rocketchat-server[10423]:     at process._tickCallback (internal/process/next_tick.js:180:9)\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Main process exited, code=exited, status=1/FAILURE\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Unit entered failed state.\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Failed with result 'exit-code'.\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Service hold-off time over, scheduling restart.\r\nOkt 10 20:18:17  systemd[1]: Stopped Service for snap application rocketchat-server.rocketchat-server.\r\nOkt 10 20:18:17  systemd[1]: snap.rocketchat-server.rocketchat-server.service: Start request repeated too quickly.\r\n```\r\n\r\nThis is a serious problem for us because we can't disable snap's auto updates and then rocketchat breaks on every release at a random time of day until an admin can restart it. :-/"},"comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments/429019233","html_url":"https://github.com/RocketChat/Rocket.Chat/issues/12308#issuecomment-429019233","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/12308","id":429019233,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTAxOTIzMw==","user":{"login":"Bubu","id":105185,"node_id":"MDQ6VXNlcjEwNTE4NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/105185?v=4","gravatar_id":"","url":"https://api.github.com/users/Bubu","html_url":"https://github.com/Bubu","followers_url":"https://api.github.com/users/Bubu/followers","following_url":"https://api.github.com/users/Bubu/following{/other_user}","gists_url":"https://api.github.com/users/Bubu/gists{/gist_id}","starred_url":"https://api.github.com/users/Bubu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bubu/subscriptions","organizations_url":"https://api.github.com/users/Bubu/orgs","repos_url":"https://api.github.com/users/Bubu/repos","events_url":"https://api.github.com/users/Bubu/events{/privacy}","received_events_url":"https://api.github.com/users/Bubu/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T16:16:50Z","updated_at":"2018-10-11T16:16:50Z","author_association":"NONE","body":"> For other users making changes to the unit file be aware that a 'disable/enable' will trash your modifications.\r\n\r\nYes.\r\n\r\n>  Back them up before you try.\r\n\r\nBetter yet, don't modify those files but use `systemctl edit <unit>` to create and edit a [override file](https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services)."}}
{"actor":{"display_login":"Bubu"}}