[Support] Rocket.Chat


Recommended Posts

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 by Ladrek
Link to comment
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

Link to comment
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"

 

Link to comment
  • 1 month later...

I got it!

  1. Create folder mongodb in /mnt/user/appdata/
  2. add mongod.conf in that folder:
    1. # 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:

       

  3. Install MongoDB via communityapps. With added postargument "-f /data/db/mongod.conf"
  4. watch the log of mongodb if it start correctly.
  5. Install rocket.chat from communityapp
    1. Set Mono DB to your mongoDB, in my case it is "mongodb://10.0.0.4:27017/rocketchat"
    2. Set RocketChat URL to yor ip, in my case: "http://10.0.0.4:3000"
    3. Add another variable (plus icon)
    4. image.png.4c6d96d9e8d066fa9a15986692707373.png
  6. Start RocketChat watch the log and after a few minutes it should start up and you can connect.
Edited by mhlnstdt25
Link to comment
  • 4 weeks later...
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 by mhlnstdt25
Link to comment
  • 1 month later...

Hello, I'm getting this e

On 6/21/2019 at 6:41 AM, mhlnstdt25 said:

I got it!

  1. Create folder mongodb in /mnt/user/appdata/
  2. add mongod.conf in that folder:
    1. 
      # 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:

       

  3. Install MongoDB via communityapps. With added postargument "-f /data/db/mongod.conf"
  4. watch the log of mongodb if it start correctly.
  5. Install rocket.chat from communityapp
    1. Set Mono DB to your mongoDB, in my case it is "mongodb://10.0.0.4:27017/rocketchat"
    2. Set RocketChat URL to yor ip, in my case: "http://10.0.0.4:3000"
    3. Add another variable (plus icon)
    4. image.png.4c6d96d9e8d066fa9a15986692707373.png
  6. 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??

Link to comment

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:[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.

Link to comment
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

Link to comment
  • 4 weeks later...
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:

 

  1. Install and Start MongoDB docker image
  2. Install Rocket.Chat docker image
  3. Change the MONGO_URL to reflect your host IP address ( Example: mongodb://192.168.1.10:27017/rocketchat )
    1. Just be sure to use your host IP and the port you assigned to the MongoDB docker
  4. Change the ROOT_URL variable to also point to your host IP address ( Example: http://192.168.1.10:3000/rocketchat )
  5. 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. 

Link to comment
  • 1 month later...
  • 4 weeks later...
  • 2 weeks later...

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):

image.thumb.png.81d38fdd3db68b612d5a45c5de64e23e.png

 

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

image.thumb.png.be648b5ba5ebc0259acd18623fa08934.png

 

Done! All works for me now at: http://192.168.0.25:3123/rocketchat/

image.png.5deb9c4d63a2240fd0490ad0eca5b16f.png

 

image.png.4e79e9fedbf625c29501e955bb9db5b0.png

Edited by Mattyfaz
  • Thanks 3
Link to comment
  • 5 weeks later...

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 by vitis
Link to comment
  • 4 weeks later...

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

Link to comment
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:

 

  1. Open a console window for the MongoDB container
  2. # hostname
    1. make a note of the hostname of your container
  3. # mongo
  4. rs01:OTHER> rsconf = rs.conf()
  5. rs01:OTHER> rsconf.members = [{_id: 0, host: "<hostname>:27017"}]
    1. where <hostname> is the value that step #2 returned
  6. rs01:OTHER> rs.reconfig(rsconf, {force: true})
  7. rs01:OTHER> rs.status()
    1. should return the details of your valid replica set (e.g. "ok" : 1)
  8. 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'). 

 

  • Thanks 1
Link to comment
  • 1 month later...
  • 2 months later...
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):

image.thumb.png.81d38fdd3db68b612d5a45c5de64e23e.png

 

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

image.thumb.png.be648b5ba5ebc0259acd18623fa08934.png

 

Done! All works for me now at: http://192.168.0.25:3123/rocketchat/

image.png.5deb9c4d63a2240fd0490ad0eca5b16f.png

 

image.png.4e79e9fedbf625c29501e955bb9db5b0.png

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 by Vesko
Link to comment
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.

 

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.