Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGO_OPTIONS stopped working #12802

Open
geekgonecrazy opened this issue Dec 3, 2018 · 6 comments
Open

MONGO_OPTIONS stopped working #12802

geekgonecrazy opened this issue Dec 3, 2018 · 6 comments
Assignees
Milestone

Comments

@geekgonecrazy
Copy link
Contributor

With 0.72.0 it seems that MONGO_OPTIONS stopped working.

The file that loads this environment variable was last touched here: #12595

The environment variable is normally loaded here:
https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-cors/server/cors.js#L18

Suspicion is change to module has effected the order this code is executed in. This needs to be executed very early in start up.

This seems very likely would effect other functionality in this file

@steerben
Copy link
Contributor

steerben commented Dec 4, 2018

I will test if this solves the issue.

Though I would challenge if the cors.js file is the correct place to set such a crucial database connection option. For me it seems that it worked kinda unintentionally all the time, given the file the function call is placed in.

This should be one of the first things when initialising meteor.

@micfung
Copy link

micfung commented Feb 5, 2019

sorry guys, the error still exists on 0.74.1
On mongo side, the error is no SSL certificate provided by peer; connection rejected
On rocketchat side, the error is MongoNetworkError: connection x to xxx:27017 closed
I tried so many times to upgrade from 0.71.1 to 0.72 and 0.74.1, but still cannot connect to mongo
The MONGO_OPTIONS works well on 0.71.1

@geekgonecrazy
Copy link
Contributor Author

@MarcosSpessatto @rodrigok ideas?

@geekgonecrazy geekgonecrazy reopened this Feb 7, 2019
@MarcosSpessatto
Copy link
Member

MarcosSpessatto commented Feb 11, 2019

@micfung can you please provide the content of your env variable MONGO_OPTIONS? Investigating your error, I found this link that is from this topic, I don't know if the problem can be something like that, @geekgonecrazy what do you think?

@micfung
Copy link

micfung commented Feb 15, 2019

@MarcosSpessatto My MONGO-OPTIONS in .bashrc

export PEM=$(cat /opt/mongodb/mongodb.pem | awk '{printf "%s\\n",$0} END {print ""}')
export CA=$(cat /opt/mongodb/ca.pem  | awk '{printf "%s\\n",$0} END {print ""}')
export MONGO_OPTIONS="{\"sslCA\":[\"${CA}\"], \"sslCert\":\"${PEM}\",\"sslKey\":\"${PEM}\"}"

i will take a look the link you give me. FYR. i can connect mongo from my rocketchat server using cli

@micfung
Copy link

micfung commented Feb 15, 2019

the command i use to connect mongo from my rocketchat server

sudo mongo --ssl -sslCAFile /opt/mongodb/ca.pem --sslPEMKeyFile /opt/mongodb/mongodb.pem --host xxx.xxx.xx -u admin -p xxx --authenticationDatabase 'rocketchat'

@engelgabriel engelgabriel modified the milestones: 0.72.1, 1.1.0 Apr 6, 2019
@engelgabriel engelgabriel modified the milestones: 1.1.0, 1.3.0 Jul 10, 2019
@sampaiodiego sampaiodiego modified the milestones: 1.3.0, 1.4.0 Jul 25, 2019
@engelgabriel engelgabriel modified the milestones: 2.0.0, 2.2.0 Oct 13, 2019
@engelgabriel engelgabriel modified the milestones: 2.2.0, 4.1.0 Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants