Trying to set up a collaboration platform for our club in this time of pandemic

Description

Server Setup Information

  • Version of Rocket.Chat Server: 3.0.4

  • Operating System: Debian 9 Stretch (5.3.18-1-pve)

  • Deployment Method: tar

  • Number of Running Instances: 1

  • DB Replicaset Oplog: (how do I find this ? :thinking: )

  • NodeJS Version: v13.11.0

  • MongoDB Version: 4.0.16

  • Proxy: apache2

  • Firewalls involved: IPtables

Hello world ! I am new here, simply trying to get a server organised for our extended family / club of friends, to get through this ‘lockdown’ in Western Europe. I thought it would be nice to have our own (encrypted) video chat server, to maintain social contact :slight_smile:

I installed node + Rocket.chat by following this guide: https://www.vultr.com/docs/how-to-install-rocket-chat-on-debian-9
After that I (tried to) set up the proxy, by making use of the apache2 instance already running on our server by following this page: https://rocket.chat/docs/installation/manual-installation/configuring-ssl-reverse-proxy/

I do not have nginx installed, so I changed the line in /etc/systemd/system/rocketchat.service from
After=network.target remote-fs.target nss-lookup.target mongod.target nginx.target
to
After=network.target remote-fs.target nss-lookup.target mongod.target apache2.target

When I start the Rocket.chat server by issuing the command ‘systemctl start rocketchat’, I do not get any errors. All seems to be well when I ‘systemctl sttus rocketchat’.

I cannot connect to the server in a browser afterwards: ‘connection timed out’.

I did discover some information in syslog:

Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on #, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on Remove, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on or, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on Replace, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on nginx, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on with, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on your, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:4] Failed to add dependency on proxy, ignoring: Invalid argument
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:8] Failed to parse service restart specifier, ignoring: always # When is set to always, the service will be restarted in any case (hit a timeout, got terminated)
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:9] Failed to parse sec value, ignoring: 15 # If node service crashes, restart the service after 15 seconds
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:10] Failed to parse output specifier, ignoring: syslog # Output to syslog
Mar 17 21:18:17 trapper systemd[1]: [/etc/systemd/system/rocketchat.service:11] Failed to parse output specifier, ignoring: syslog # Output to syslog

I also noticed troubles with this ‘meteor’-thing (which I have never used before, tbh), while trying to check if mongo was running ok:

mongo mongo/meteor --eval “rs.initiate({ _id: ‘‘rs0’’, members: [ { _id: 0, host: ‘‘mongo:27017’’ } ]})”
MongoDB shell version v4.0.16
connecting to: mongodb://mongo:27017/meteor?gssapiServiceName=mongodb
2020-03-17T22:38:06.529+0100 E QUERY [js] Error: couldn’t connect to server mongo:27017, connection attempt failed: SocketException: Error connecting to mongo:27017 (134.x.x.5:27017) :: caused by :: Connection timed out :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed

It seems like mongo wants to connect to ‘localhost’, but somehow this is resolved to an external IP. My /etc/hosts looks like this:

127.0.0.1 localhost.localnet localhost
::1 localhost.localnet localhost

I have been looking into this for several hours now and I am ready to abandon my project. As a last resort I turn to the Community here, for help :smiley:

Thanks in advance for your time !

D

Any additional Information

Not atm, but please ask me for more !

It looks like you might have followed a combo of different tutorials. Maybe consider following the debian guide from our documentation?

https://rocket.chat/docs/installation/manual-installation/debian/

the mongo section you have there kinda looks like instructions from a docker install :see_no_evil:

First of all: thank you very much for your time, Mr Aaron!

I had no idea I was following different tutorials. I should indeed follow the ‘official’ ones first. My apologies :relaxed:

I tried to ‘clean the board’ as much as possible: I purged mongo and node and deleted as many config files as I could remember creating.
I have not yet figured out how to delete/uninstall/remove this meteor-thing, but I went ahead and followed the tutorial you so kindly pointed me to.

I did get mongod & mongodb up and running, but the rocketchat service errors out after a few seconds.

Please refer to the syslog output for more info:

Mar 19 16:07:29 escout systemd[1]: rocketchat.service: Failed to reset devices.list: Operation not permitted
Mar 19 16:07:36 escout nodejs-example[9115]: /opt/Rocket.Chat/programs/server/node_modules/fibers/future.js:280
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#011#011#011throw(ex);
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#011#011#011^
Mar 19 16:07:36 escout nodejs-example[9115]: Error: Error: Unable to find Mongodb Oplog. You must run the server with oplog enabled. Try the following:
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#0111. Start your mongodb in a replicaset mode: mongod --smallfiles --oplogSize 128 --replSet rs0
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#0112. Start the replicaset via mongodb shell: mongo mongo/meteor --eval “rs.initiate({ _id: ‘‘rs0’’, members: [ { _id: 0, host: ‘‘localhost:27017’’ } ]})”
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#0113. Start your instance with OPLOG configuration: export MONGO_OPLOG_URL=mongodb://localhost:27017/local MONGO_URL=mongodb://localhost:27017/meteor node main.js
Mar 19 16:07:36 escout nodejs-example[9115]: #011#011#011#011
Mar 19 16:07:36 escout nodejs-example[9115]: at BaseDb.handleListener (app/models/server/models/_BaseDb.js:51:11)
Mar 19 16:07:36 escout nodejs-example[9115]: at BaseDb.emit (events.js:210:5)
Mar 19 16:07:36 escout nodejs-example[9115]: at BaseDb.EventEmitter.emit (domain.js:475:20)
Mar 19 16:07:36 escout nodejs-example[9115]: at _addListener (events.js:236:14)
Mar 19 16:07:36 escout nodejs-example[9115]: at BaseDb.addListener (events.js:284:10)
Mar 19 16:07:36 escout nodejs-example[9115]: at new Base (app/models/server/models/_Base.js:21:12)
Mar 19 16:07:36 escout nodejs-example[9115]: at new Settings (app/models/server/models/Settings.js:5:3)
Mar 19 16:07:36 escout nodejs-example[9115]: at module (app/models/server/models/Settings.js:243:16)
Mar 19 16:07:36 escout nodejs-example[9115]: at fileEvaluate (packages/modules-runtime.js:336:7)
Mar 19 16:07:36 escout nodejs-example[9115]: at Module.require (packages/modules-runtime.js:238:14)
Mar 19 16:07:36 escout nodejs-example[9115]: at Module.moduleLink [as link] (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/modules/node_modules/reify/lib/runtime/index.js:52:22)
Mar 19 16:07:36 escout nodejs-example[9115]: at module (app/settings/server/functions/settings.js:1:251)
Mar 19 16:07:36 escout nodejs-example[9115]: at fileEvaluate (packages/modules-runtime.js:336:7)
Mar 19 16:07:36 escout nodejs-example[9115]: at Module.require (packages/modules-runtime.js:238:14)
Mar 19 16:07:36 escout nodejs-example[9115]: at Module.moduleLink [as link] (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/modules/node_modules/reify/lib/runtime/index.js:52:22)
Mar 19 16:07:36 escout nodejs-example[9115]: at module (app/settings/server/index.js:1:60)
Mar 19 16:07:36 escout systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
Mar 19 16:07:36 escout systemd[1]: rocketchat.service: Unit entered failed state.
Mar 19 16:07:36 escout systemd[1]: rocketchat.service: Failed with result ‘exit-code’.

Thanks again for your time and please let me know if you want me to post other config settings or logs :nerd_face:

This makes it look like you hadn’t initialized the mongo replicaset?

Thank you for your input, Mr Aaron.
I did as you suggested. Please have a look at my syslog:

Mar 21 10:17:08 escout systemd[1]: rocketchat.service: Failed to reset devices.list: Operation not permitted
Mar 21 10:17:10 escout nodejs-example[20665]: /opt/Rocket.Chat/programs/server/node_modules/fibers/future.js:313
Mar 21 10:17:10 escout nodejs-example[20665]: #011#011#011#011#011#011throw(ex);
Mar 21 10:17:10 escout nodejs-example[20665]: #011#011#011#011#011#011^
Mar 21 10:17:10 escout nodejs-example[20665]: MongoError: not master and slaveOk=false
Mar 21 10:17:10 escout nodejs-example[20665]: at Connection. (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:443:61)
Mar 21 10:17:10 escout nodejs-example[20665]: at Connection.emit (events.js:210:5)
Mar 21 10:17:10 escout nodejs-example[20665]: at processMessage (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:364:10)
Mar 21 10:17:10 escout nodejs-example[20665]: at Socket. (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:533:15)
Mar 21 10:17:10 escout nodejs-example[20665]: at Socket.emit (events.js:210:5)
Mar 21 10:17:10 escout nodejs-example[20665]: at addChunk (_stream_readable.js:309:12)
Mar 21 10:17:10 escout nodejs-example[20665]: at readableAddChunk (stream_readable.js:290:11)
Mar 21 10:17:10 escout nodejs-example[20665]: at Socket.Readable.push (stream_readable.js:224:10)
Mar 21 10:17:10 escout nodejs-example[20665]: at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
Mar 21 10:17:10 escout nodejs-example[20665]: operationTime: Timestamp { bsontype: ‘Timestamp’, low: 0, high
: 0 },
Mar 21 10:17:10 escout nodejs-example[20665]: ok: 0,
Mar 21 10:17:10 escout nodejs-example[20665]: errmsg: ‘not master and slaveOk=false’,
Mar 21 10:17:10 escout nodejs-example[20665]: code: 13435,
Mar 21 10:17:10 escout nodejs-example[20665]: codeName: ‘NotMasterNoSlaveOk’,
Mar 21 10:17:10 escout nodejs-example[20665]: ‘$clusterTime’: {
Mar 21 10:17:10 escout nodejs-example[20665]: clusterTime: Timestamp { bsontype: ‘Timestamp’, low: 0, high
: 0 },
Mar 21 10:17:10 escout nodejs-example[20665]: signature: { hash: [Binary], keyId: 0 }
Mar 21 10:17:10 escout nodejs-example[20665]: },
Mar 21 10:17:10 escout nodejs-example[20665]: name: ‘MongoError’,
Mar 21 10:17:10 escout nodejs-example[20665]: [Symbol(mongoErrorContextSymbol)]: {}
Mar 21 10:17:10 escout nodejs-example[20665]: }
Mar 21 10:17:10 escout systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
Mar 21 10:17:10 escout systemd[1]: rocketchat.service: Unit entered failed state.
Mar 21 10:17:10 escout systemd[1]: rocketchat.service: Failed with result ‘exit-code’.