mongo-express: The docker image built from tag v1.0.0 seems to be broken
My clause
I want use mongo-express
docker image to connect to Atlas MongoDB. I know that there 3+ Atlas related isues in this repo
My URI looks like ME_CONFIG_MONGODB_URL=“mongodb+srv://2627-db:PASS@MY-CLUSTER.mongodb.net/2627-db?authSource=admin”
There is an advice to edit “config.js” I haven’t tried https://github.com/mongo-express/mongo-express/issues/584#issuecomment-800803419
The “latest” docker that is 1 year old, “1.0.0-alpha.4” still contains this bug.
The Mongo Shell is working with my URI:
$ mongosh mongodb+srv://2627-db:PASS@MY-CLUSTER.mongodb.net/2627-db?authSource=admin
Current Mongosh Log ID: 6320567cf31460f5da1131ae
Connecting to: mongodb+srv://<credentials>@MY-CLUSTER..mongodb.net/2627-db?authSource=admin&appName=mongosh+1.5.4
Using MongoDB: 4.2.22
Using Mongosh: 1.5.4
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
Atlas atlas-######-shard-0 [primary] 2627-db>
reproduce
git checkout v1.0.0
docker build -t mongo-express:1.0.0 .
$ docker run -it --rm --name mongo-express -p 8081:8081 -e ME_CONFIG_OPTIONS_EDITORTHEME="ambiance" -e ME_CONFIG_MONGODB_URL="mongodb+srv://2627-db:PASS@MY-CLUSTER.mongodb.net/2627-db?authSource=admin" mongo-express:1.0.0
> mongo-express@1.0.0 start
> cross-env NODE_ENV=production node app
Welcome to mongo-express
------------------------
Could not connect to database using connectionString: mongodb+srv://2627-db:PASS@MY-CLUSTER.mongodb.net/2627-db?authSource=admin"
node:fs:599
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, open
at Object.openSync (node:fs:599:3)
at Object.readFileSync (node:fs:467:35)
at transform (/app/node_modules/mongodb/lib/connection_string.js:903:23)
at setOption (/app/node_modules/mongodb/lib/connection_string.js:442:36)
at parseOptions (/app/node_modules/mongodb/lib/connection_string.js:297:9)
at new MongoClient (/app/node_modules/mongodb/lib/mongo_client.js:65:63)
at MongoClient.connect (/app/node_modules/mongodb/lib/mongo_client.js:233:33)
at /app/lib/db.js:90:48
at Array.map (<anonymous>)
at connect (/app/lib/db.js:85:58) {
errno: -2,
syscall: 'open',
code: 'ENOENT'
}
Node.js v18.7.0
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 20 (11 by maintainers)
I think ghcr has a higher rate limit than dockerhub for anonymous downloads. Should be fine to use for now, but once we publish on dockerhub it might be better to switch to the official release.
I might delete my fork someday so it’s probably not good to use in a production environment.
@BlackthornYugen @rtritto your combined efforts now really made a change for me! 👍💯
For our IDP, other ways to access our Atlas MongoDB have limitations I don’t want to solve now.
@BlackthornYugen big thanks! I confurm that my DB page is working
http://0.0.0.0:8081/db/ppserver-2627-db
. I create a least priveleged user that has readWrite role only for this one database, it cannot list databases.@BlackthornYugen one more, since I use the mongo-express docker image already (older version) in the CI, and my helm chart, is the download path
ghcr.io/blackthornyugen/mongo-express-docker:v1.0.0
reliable or I gonna hit a download limit?Just adding ME_CONFIG_MONGODB_SSL=true seems to allow me to connect to atlas and interact with a test database I created, but it looks like I don’t have permission to list databases?
Click to show full output
This sounds like a different issue, but if the BASICAUTH_USERNAME is blank it should set useBasicAuth to false and when it is false, it should not use basic auth. Can you open a separate ticket so that we can help troubleshoot?
@denist-huma are you removing the user/password from the connection string before you paste the logs or are they not showing at all?
Good to try for debugging but we would not recommend disabling TLS validation in production. Keep in mind that others with similar issues may find this thread )