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

Wrong check connection in connecton retry #115

Open
rtritto opened this issue Jan 7, 2024 · 1 comment
Open

Wrong check connection in connecton retry #115

rtritto opened this issue Jan 7, 2024 · 1 comment
Labels

Comments

@rtritto
Copy link
Member

rtritto commented Jan 7, 2024

How to reproduce

Run the image.

Actual behavior

Even if ME_CONFIG_MONGODB_URL env var is correct, in docker-entrypoint.sh the connection check fails, and the connection retry starts until the end of all tries (10 by default). After the retries, the server starts correcly.

Pattern of placeholder <CLUSTER>: cluster0-<CLUSTER_ID>.mongodb.net

Waiting for <CLUSTER>:<PORT>...
/docker-entrypoint.sh: line 15: <CLUSTER>: Name has no usable address
/docker-entrypoint.sh: line 15: /dev/tcp/<CLUSTER>/<PORT>: Invalid argument
Sun Jan  7 01:47:59 UTC 2024 retrying to connect to <CLUSTER>:<PORT> (2/10)
/docker-entrypoint.sh: line 15: <CLUSTER>: Name has no usable address
/docker-entrypoint.sh: line 15: /dev/tcp/<CLUSTER>/<PORT>: Invalid argument
Sun Jan  7 01:48:01 UTC 2024 retrying to connect to <CLUSTER>:<PORT> (3/10)
...
/docker-entrypoint.sh: line 15: <CLUSTER>: Name has no usable address
/docker-entrypoint.sh: line 15: /dev/tcp/<CLUSTER>/<PORT>: Invalid argument
Sun Jan  7 01:48:08 UTC 2024 retrying to connect to <CLUSTER>:<PORT> (10/10)
/docker-entrypoint.sh: line 15: <CLUSTER>: Name has no usable address
/docker-entrypoint.sh: line 15: /dev/tcp/<CLUSTER>/<PORT>: Invalid argument
No custom config.js found, loading config.default.js
Welcome to mongo-express 1.0.2
------------------------


Mongo Express server listening at http://0.0.0.0:8081
Server is open to allow connections from anyone (0.0.0.0)

Expected behavior

After the first connection check, the server starts without any connection retry.

Possible solution

In docker-entrypoint.sh change the code:

exec 6<>/dev/tcp/$host/$port

Documentations/guides:

Issues

Related (?): #49
Similr errors but with ME_CONFIG_MONGODB_SERVER instead of ME_CONFIG_MONGODB_URL: #21
Code introduced with: #12
Code commented with: #65

@rtritto rtritto added the bug label Jan 7, 2024
@rtritto
Copy link
Member Author

rtritto commented Jan 7, 2024

FYI @BlackthornYugen @tianon @shakaran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant