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

Add db url to fix auth error (mongo-express on linux) #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

willscripted
Copy link

I've been seeing this error while running docker compose up:

mongo-express-1  | MongoServerError: Command listDatabases requires authentication                                                                                                           
mongo-express-1  |     at Connection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:227:30)                                                                                     
mongo-express-1  |     at MessageStream.<anonymous> (/app/node_modules/mongodb/lib/cmap/connection.js:60:60)                                                                                 
mongo-express-1  |     at MessageStream.emit (node:events:517:28)                                                                                                                            
mongo-express-1  |     at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:125:16)                                                                                  
mongo-express-1  |     at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9)                                                                                   
mongo-express-1  |     at writeOrBuffer (node:internal/streams/writable:392:12)                                                                                                              
mongo-express-1  |     at _write (node:internal/streams/writable:333:10)                                                                                                                     
mongo-express-1  |     at Writable.write (node:internal/streams/writable:337:10)                                                                                                             
mongo-express-1  |     at Socket.ondata (node:internal/streams/readable:809:22)                                                                                                              
mongo-express-1  |     at Socket.emit (node:events:517:28) {                                                                                                                                 
mongo-express-1  |   ok: 0,                                                                                                                                                                  
mongo-express-1  |   code: 13,                                                                                                                                                               
mongo-express-1  |   codeName: 'Unauthorized',                                                                                                                                               
mongo-express-1  |   [Symbol(errorLabels)]: Set(0) {}                                                                                                                                        
mongo-express-1  | }                                                                                                                                                                         
mongo-express-1  |                                                                                                                                                                           
mongo-express-1  | Node.js v18.20.3   
Docker Version Info Client: Docker Engine - Community Version: 27.1.2 API version: 1.46 Go version: go1.21.13 Git commit: d01f264 Built: Mon Aug 12 11:50:12 2024 OS/Arch: linux/amd64 Context: default

Server: Docker Engine - Community
Engine:
Version: 27.1.2
API version: 1.46 (minimum version 1.24)
Go version: go1.21.13
Git commit: f9522e5
Built: Mon Aug 12 11:50:12 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.20
GitCommit: 8fc6bcff51318944179630522a095cc9dbf9f353
runc:
Version: 1.1.13
GitCommit: v1.1.13-0-g58aa920
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Fix according to this mongo-express issue is to add a ME_CONFIG_MONGODB_URL env var 🤷

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

Successfully merging this pull request may close these issues.

1 participant