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_OPLOG_URL does not support unix domain sockets #11760

Closed
yghorbal opened this issue Nov 13, 2021 · 2 comments
Closed

$MONGO_OPLOG_URL does not support unix domain sockets #11760

yghorbal opened this issue Nov 13, 2021 · 2 comments

Comments

@yghorbal
Copy link

@yghorbal yghorbal commented Nov 13, 2021

Hello,

When providing a unix socket mongodb URI : mongodb:///path/to/socket.sock/local, the following check fails

if (mongodbUri.parse(self._oplogUrl).database !== 'local') {

It's due to the fact that the mongodb-uri package does not parse unix sockets URIs "correctly" out of the box. For instance the output of mongodbUri.parse(self._oplogUrl).database is path/to/socket.sock/local and not local as one expects.

Moreover, when socket path is percent encoded mongodb://%2Fpath%2Fto%2Fsocket.sock/local, mongodb-uri works as expected (producing the correct database name) so the previously provided check works, unfortunately it comes down short later :

self._oplogTailConnection = new MongoConnection(
self._oplogUrl, {poolSize: 1});

In fact, MongoConnection does not expect percent encoded socket path mongo URI and fails with this error message

MongoError: failed to connect to server [%2Fpath%2Fto%2Fsocket.sock:27017] on first connect [MongoError: getaddrinfo ENOTFOUND %2Fpath%2Fto%2Fsocket.sock %2Fpath%2Fto%2Fsocket.sock:27017]

I can't find out why the $MONGO_URL works out of the box though (without the percent encoding)

Thank you for your help

@renanccastro
Copy link
Contributor

@renanccastro renanccastro commented Nov 16, 2021

Hi, @yghorbal thanks for your report!
Have you tried on Meteor 2.5? Mongo driver updates can impact the issue you are describing.
Which version doesn't work?

I can't find out why the $MONGO_URL works out of the box though (without the percent encoding)

Does this mean you currently have a workaround?

@yghorbal
Copy link
Author

@yghorbal yghorbal commented Dec 2, 2021

Hi @renanccastro you are right, the version I was investigating was very old. It's no longer an issue today !

@yghorbal yghorbal closed this Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants