Ladrek Posted May 12, 2019 Share Posted May 12, 2019 (edited) 4 hours ago, Frank76 said: It was working before I updated all my dockers in preparation for upgrading to 6.7, now I can't get Rocket.Chat working again. My MongoDB seems to be running just fine, but rocket.chat is giving an error on startup saying MongoError: not master and slaveOk=false I have found some documentation on how to allow reading from the slave, but it is per connection, and RC creates a new connection and I can't figure out how to set that variable for RC to use. I'm getting very close to just installing it on my centos VM and be done with it. yeah i'm getting the same error i'll prob roll it back tonight, what version was it working on? Edited May 12, 2019 by Ladrek Quote Link to comment
Ladrek Posted May 12, 2019 Share Posted May 12, 2019 4 hours ago, Frank76 said: It was working before I updated all my dockers in preparation for upgrading to 6.7, now I can't get Rocket.Chat working again. My MongoDB seems to be running just fine, but rocket.chat is giving an error on startup saying MongoError: not master and slaveOk=false I have found some documentation on how to allow reading from the slave, but it is per connection, and RC creates a new connection and I can't figure out how to set that variable for RC to use. I'm getting very close to just installing it on my centos VM and be done with it. i have it on ubuntu VM for now but i'm trying to keep it as a docker lol Quote Link to comment
Ladrek Posted May 12, 2019 Share Posted May 12, 2019 5 hours ago, RichardU said: The new conf also did not work for me. I could get MongoDB to start if I remove "-f /data/db/mongod.conf" from post arguments. Could that be the problem? # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: /data/db journal: enabled: true # engine: # mmapv1: # wiredTiger: # where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log # network interfaces net: port: 27017 bindIp: 127.0.0.1 # how the process runs processManagement: timeZoneInfo: /usr/share/zoneinfo #security: #operationProfiling: #replication: #sharding: ## Enterprise-Only Options: #auditLog: #snmp: replication: replSetName: "rs01" Quote Link to comment
Ladrek Posted May 13, 2019 Share Posted May 13, 2019 5 minutes ago, RichardU said: How Spoke too soon Quote Link to comment
mhlnstdt25 Posted June 21, 2019 Share Posted June 21, 2019 (edited) I got it! Create folder mongodb in /mnt/user/appdata/ add mongod.conf in that folder: # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: /data/db journal: enabled: true # engine: # mmapv1: # wiredTiger: # network interfaces net: port: 27017 bindIp: 127.0.0.1 # how the process runs processManagement: timeZoneInfo: /usr/share/zoneinfo #security: #operationProfiling: replication: replSetName: "rs01" #sharding: ## Enterprise-Only Options: #auditLog: #snmp: Install MongoDB via communityapps. With added postargument "-f /data/db/mongod.conf" watch the log of mongodb if it start correctly. Install rocket.chat from communityapp Set Mono DB to your mongoDB, in my case it is "mongodb://10.0.0.4:27017/rocketchat" Set RocketChat URL to yor ip, in my case: "http://10.0.0.4:3000" Add another variable (plus icon) Start RocketChat watch the log and after a few minutes it should start up and you can connect. Edited June 21, 2019 by mhlnstdt25 Quote Link to comment
CyprienDlp Posted July 17, 2019 Share Posted July 17, 2019 @mhlnstdt25 I tried you way but I can't manage to start mongoDB on step n°4. Do you have any idea it come from ? Quote Link to comment
mhlnstdt25 Posted July 17, 2019 Share Posted July 17, 2019 7 hours ago, CyprienDlp said: @mhlnstdt25 I tried you way but I can't manage to start mongoDB on step n°4. Do you have any idea it come from ? what is the error message in you are getting ? Quote Link to comment
CyprienDlp Posted July 17, 2019 Share Posted July 17, 2019 Now I don't know why I made all the steps fine but it is still not working. 2 thing I noted : MongoDB log still show : "WARNING: Access control is not enabled for the database." When I launch Rocket Chat I still have "ERR_CONNECTION_REFUSED" Quote Link to comment
mhlnstdt25 Posted July 18, 2019 Share Posted July 18, 2019 (edited) 11 hours ago, CyprienDlp said: Now I don't know why I made all the steps fine but it is still not working. 2 thing I noted : MongoDB log still show : "WARNING: Access control is not enabled for the database." When I launch Rocket Chat I still have "ERR_CONNECTION_REFUSED" Access Control is only a warning, you can ignore that. Maybe try mongo-express to check if your mongodb is running Also the rocket chat startup does take a few minutes. When u see something like this, the rocketchat instance should be reachable. [32m➔[39m [32mSystem ➔ startup[39m [32m➔[39m [32m+---------------------------------------------+[39m [32m➔[39m [32m| SERVER RUNNING |[39m [32m➔[39m [32m+---------------------------------------------+[39m [32m➔[39m [32m| |[39m [32m➔[39m [32m| Rocket.Chat Version: 1.2.1 |[39m [32m➔[39m [32m| NodeJS Version: 8.11.4 - x64 |[39m [32m➔[39m [32m| MongoDB Version: 4.0.10 |[39m [32m➔[39m [32m| MongoDB Engine: wiredTiger |[39m [32m➔[39m [32m| Platform: linux |[39m [32m➔[39m [32m| Process Port: 3000 |[39m [32m➔[39m [32m| Site URL: http://10.0.0.4:3000 |[39m [32m➔[39m [32m| ReplicaSet OpLog: Enabled |[39m [32m➔[39m [32m| Commit Hash: 7475d7628a |[39m [32m➔[39m [32m| Commit Branch: HEAD |[39m [32m➔[39m [32m| |[39m [32m➔[39m [32m+---------------------------------------------+[39m Edited July 18, 2019 by mhlnstdt25 Quote Link to comment
PmoshBR Posted August 28, 2019 Share Posted August 28, 2019 Hello, I'm getting this e On 6/21/2019 at 6:41 AM, mhlnstdt25 said: I got it! Create folder mongodb in /mnt/user/appdata/ add mongod.conf in that folder: # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: /data/db journal: enabled: true # engine: # mmapv1: # wiredTiger: # network interfaces net: port: 27017 bindIp: 127.0.0.1 # how the process runs processManagement: timeZoneInfo: /usr/share/zoneinfo #security: #operationProfiling: replication: replSetName: "rs01" #sharding: ## Enterprise-Only Options: #auditLog: #snmp: Install MongoDB via communityapps. With added postargument "-f /data/db/mongod.conf" watch the log of mongodb if it start correctly. Install rocket.chat from communityapp Set Mono DB to your mongoDB, in my case it is "mongodb://10.0.0.4:27017/rocketchat" Set RocketChat URL to yor ip, in my case: "http://10.0.0.4:3000" Add another variable (plus icon) Start RocketChat watch the log and after a few minutes it should start up and you can connect. I tried this instructions, but it show this error when I try to start RocketChat: Quote Error: $MONGO_OPLOG_URL must be set to the 'local' database of a Mongo replica set Could please somebody help me?? Quote Link to comment
sansoo22 Posted August 30, 2019 Share Posted August 30, 2019 My steps were a bit different to get this all working with authorization setup in MongoDb. I used the same mongo.conf file with one adjustment to get authorization working. First make sure to shutdown your RocketChat docker if its running. It will get angry when we do the rest of this if you don't. Next we need to create some users in MongoDB. Each command below needs to be run in the terminal of your MongoDB container separately. // switch to admin db use admin // first user db.createUser({ user: "root", pwd: "somePasswordThatIsReallyHard", roles: [{ role: "root", db: "admin" }] }) // second user db.createUser({ user: "rocketchat", pwd: "someOtherReallyHardPassword", roles: [{ role: "readWrite", db: "local" }] }) // switch to rocketchat db use rocketchat // create local db user db.createUser({ user: "rocketchat", pwd: "iCheatedAndUsedSamePwdAsAbove", roles: [{ role: "dbOwner", db: "rocketchat" }] }) Now we need to modify the mongo.conf file // this #security: // should be this security: authorization: "enabled" Next bounce the MongoDB docker and it should start up with authorization enabled. You can check by running the "mongo" command in terminal. If the warnings about authorization being off are gone then you have it set. You could also run "mongo -u root -p yourRootPwd" to verify. Finally we need to modify the connection strings in the RocketChat Docker // MONGO_URL: // this is the rocketchat user we created in the rocketchat database mongodb://rocketchat:[email protected]:27017/rocketchat?replicaSet=rs01 // MONGO_OPLOG_URL // this is the rocketchat user we created in the admin database mongodb://rocketchat:your_passwor[email protected]:27017/local?authSource=admin&replicaSet=rs01 Fire up your RocketChat instance and hope for the best. If it works send a middle finger emoji to a random user and go relax. If not sorry I couldn't help out. Quote Link to comment
sansoo22 Posted August 30, 2019 Share Posted August 30, 2019 On 5/12/2019 at 11:02 AM, Frank76 said: It was working before I updated all my dockers in preparation for upgrading to 6.7, now I can't get Rocket.Chat working again. My MongoDB seems to be running just fine, but rocket.chat is giving an error on startup saying MongoError: not master and slaveOk=false I have found some documentation on how to allow reading from the slave, but it is per connection, and RC creates a new connection and I can't figure out how to set that variable for RC to use. I'm getting very close to just installing it on my centos VM and be done with it. Its been a couple months so not sure if you still need help but you can get this error if mongo was restarted while rocket chat was still running. It happened to me a few times. The other thing I did since i was running a single node replica set was run rs.slaveOk() on my primary node. Making sure rocket is shutdown while fiddling with mongo and the above command have me going for almost a week without that error Quote Link to comment
Aerodb Posted September 27, 2019 Share Posted September 27, 2019 On 12/11/2017 at 3:50 PM, joshz said: Ok, so for anyone stuck like I was, here's how to get Rocket Chat up and running with a MongoDB docker image: Install and Start MongoDB docker image Install Rocket.Chat docker image Change the MONGO_URL to reflect your host IP address ( Example: mongodb://192.168.1.10:27017/rocketchat ) Just be sure to use your host IP and the port you assigned to the MongoDB docker Change the ROOT_URL variable to also point to your host IP address ( Example: http://192.168.1.10:3000/rocketchat ) Click apply to create the docker and it should start on its own There doesn't appear to be any particular need to link the containers, but you could do that if you wanted and fiddle with the two variables above to reflect that. Hello all, So i follow above steps but the rocket chat docker starts and then shuts off after 1 second. I'm not sure what else i have missed to get this up and running. Any advice is greatly appreciated. Quote Link to comment
viktortras Posted October 29, 2019 Share Posted October 29, 2019 I have problem with this too, I am unable to open webUI correctly, log tell me that : 'Error: Unable to find Mongodb Oplog. You must run the server with oplog enabled' What I have to do please help! Quote Link to comment
viktortras Posted November 21, 2019 Share Posted November 21, 2019 On 9/28/2019 at 12:13 AM, Aerodb said: Hello all, So i follow above steps but the rocket chat docker starts and then shuts off after 1 second. I'm not sure what else i have missed to get this up and running. Any advice is greatly appreciated. any help please? Quote Link to comment
MattFaz Posted December 4, 2019 Share Posted December 4, 2019 (edited) Just managed to get this working using a combination of the suggestions here. 1) Create /appdata/mongodb/mongod.conf file and add the following: storage: dbPath: /data/db journal: enabled: true systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log net: port: 27017 bindIp: 127.0.0.1 processManagement: timeZoneInfo: /usr/share/zoneinfo replication: replSetName: rs01 security: authorization: "enabled" 2) Add MongoDB from Apps, and add "-f /data/db/mongod.conf" to the Post Arguments field (rest is default): 3) Start MongoDB and go into the terminal, then type the following commands: mongo rs.initiate() <<press enter>> - it should now say PRIMARY use admin db.createUser({user: "root",pwd: "passwordHere",roles: [{ role: "root", db: "admin"}]}) db.createUser({user: "rocketchat",pwd: "passwordHere",roles: [{role: "readWrite", db: "local" }]}) use rocketchat db.createUser({user: "rocketchat",pwd: "passwordHere",roles: [{ role: "dbOwner",db: "rocketchat" }]}) 4) Download Rocket.Chat from Apps and update the following values (note: Update with your own IP/Port): MONGO_URL = mongodb://rocketchat:passwordHere@192.168.0.25:27017/rocketchat ROOT_URL = http://192.168.0.25:3000/rocketchat MONGO_OPLOG_URL = mongodb://rocketchat:passwordHere@192.168.0.25:27017/local?authSource=admin Done! All works for me now at: http://192.168.0.25:3123/rocketchat/ Edited December 4, 2019 by Mattyfaz 3 Quote Link to comment
vitis Posted January 2, 2020 Share Posted January 2, 2020 (edited) Hi @Mattyfaz, I tried your steps but I am failing on creating the rocketchat user. I keep getting this error message. 2020-01-02T17:43:21.893+0100 E QUERY [js] uncaught exception: Error: couldn't add user: command createUser requires authentication : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DB.prototype.createUser@src/mongo/shell/db.js:1370:11 @(shell):1:1 I had to switch authorization to disabled in the config file. More reading here: https://stackoverflow.com/questions/27784956/error-couldnt-add-user-not-authorized-on-test-to-execute-command-createuser Edit: Web frontend port and the port in the rocketchat url has to correspond. Otherwise the file uploads would not work. Edited January 2, 2020 by vitis Quote Link to comment
PsYCoR Posted January 26, 2020 Share Posted January 26, 2020 anytime i update the MongoDB rocket.chat get errors and does not start correctly. MongoError: not master and slaveOk=false at Connection.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:443:61) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at processMessage (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:364:10) at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:533:15) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:601:20) /app/bundle/programs/server/node_modules/fibers/future.js:313 throw(ex); so i have to complete reinstall the full MongoDB and configuration for RC. ... is it not possible to update the Mongo Docker without a function lost? THX Quote Link to comment
jm9843 Posted January 28, 2020 Share Posted January 28, 2020 On 1/26/2020 at 5:47 AM, PsYCoR said: anytime i update the MongoDB rocket.chat get errors and does not start correctly. MongoError: not master and slaveOk=false at Connection.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:443:61) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at processMessage (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:364:10) at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:533:15) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:601:20) /app/bundle/programs/server/node_modules/fibers/future.js:313 throw(ex); so i have to complete reinstall the full MongoDB and configuration for RC. ... is it not possible to update the Mongo Docker without a function lost? THX I just dealt with this and was able to get my installation back up. The issue is that the hostname in the MongoDB container changes when you do the update; breaking the replica set. My steps to resolve: Open a console window for the MongoDB container # hostname make a note of the hostname of your container # mongo rs01:OTHER> rsconf = rs.conf() rs01:OTHER> rsconf.members = [{_id: 0, host: "<hostname>:27017"}] where <hostname> is the value that step #2 returned rs01:OTHER> rs.reconfig(rsconf, {force: true}) rs01:OTHER> rs.status() should return the details of your valid replica set (e.g. "ok" : 1) Cross your fingers and start your Rocket.Chat container These steps assume that you followed the general guidance in this thread (e.g. default port of 27017, replica set named 'rs01'). 1 Quote Link to comment
PsYCoR Posted January 28, 2020 Share Posted January 28, 2020 with much THX !!! that is the solution !!! 🍻 Quote Link to comment
Joop Posted March 18, 2020 Share Posted March 18, 2020 I would love to add rocket.chat to the reverse proxy of linuxserver.io The certificate is in there but i haven't figured out to add rocket.chat to it. Anyone had any luck setting that up? Quote Link to comment
Vesko Posted June 8, 2020 Share Posted June 8, 2020 (edited) On 12/4/2019 at 2:46 AM, Mattyfaz said: Just managed to get this working using a combination of the suggestions here. 1) Create /appdata/mongodb/mongod.conf file and add the following: storage: dbPath: /data/db journal: enabled: true systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log net: port: 27017 bindIp: 127.0.0.1 processManagement: timeZoneInfo: /usr/share/zoneinfo replication: replSetName: rs01 security: authorization: "enabled" 2) Add MongoDB from Apps, and add "-f /data/db/mongod.conf" to the Post Arguments field (rest is default): 3) Start MongoDB and go into the terminal, then type the following commands: mongo rs.initiate() <<press enter>> - it should now say PRIMARY use admin db.createUser({user: "root",pwd: "passwordHere",roles: [{ role: "root", db: "admin"}]}) db.createUser({user: "rocketchat",pwd: "passwordHere",roles: [{role: "readWrite", db: "local" }]}) use rocketchat db.createUser({user: "rocketchat",pwd: "passwordHere",roles: [{ role: "dbOwner",db: "rocketchat" }]}) 4) Download Rocket.Chat from Apps and update the following values (note: Update with your own IP/Port): MONGO_URL = mongodb://rocketchat:passwordHere@192.168.0.25:27017/rocketchat ROOT_URL = http://192.168.0.25:3000/rocketchat MONGO_OPLOG_URL = mongodb://rocketchat:passwordHere@192.168.0.25:27017/local?authSource=admin Done! All works for me now at: http://192.168.0.25:3123/rocketchat/ Hi,Mattyfaz Thank you very much for your tutorial i get it to work perfect for the moment we will see in the future if will brake. I disable the updates of Mongo and Rocket dockers. Id like to ask you if you find out how to access it from WAN with Letsencrypt or something. Thank you Just i edit also: http://192.168.0.25:3123/rocketchat/ i remove /rocketchat at the end and the port is :3000 not 3123 and now just click on the rocketchat docket and the Web Ui is open. More easy to access. Edited June 10, 2020 by Vesko Quote Link to comment
SpaceInvaderOne Posted June 13, 2020 Share Posted June 13, 2020 On 3/18/2020 at 4:46 PM, Joop said: I would love to add rocket.chat to the reverse proxy of linuxserver.io The certificate is in there but i haven't figured out to add rocket.chat to it. Anyone had any luck setting that up? On 1/26/2020 at 10:47 AM, PsYCoR said: anytime i update the MongoDB rocket.chat get errors and does not start correctly. MongoError: not master and slaveOk=false at Connection.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:443:61) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at processMessage (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:364:10) at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:533:15) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread (net.js:601:20) /app/bundle/programs/server/node_modules/fibers/future.js:313 throw(ex); so i have to complete reinstall the full MongoDB and configuration for RC. ... is it not possible to update the Mongo Docker without a function lost? THX Here is a guide showing how to setup Rocket chat running through a reverse proxy. Also you can update the container but when you setup the mongoDB you must specify the hostname in the container when you create it. That way when the container is ever recreated it keeps the same name and so doesnt cause the database to break. If you already have rocket chat installed and have disabled updates then see a fix that will allow you to update as normal at the end of my video. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.