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

Run with Docker not working #70

Closed
gander opened this issue Mar 5, 2024 · 3 comments
Closed

Run with Docker not working #70

gander opened this issue Mar 5, 2024 · 3 comments

Comments

@gander
Copy link

gander commented Mar 5, 2024

The service starts, but you cannot connect to it, it rejects connections.

@muety
Copy link
Owner

muety commented Mar 11, 2024

How to you start the container? Using the provided Docker Compose file or via docker run with the plain image? In the latter case, you'll either have to set LISTEN_ADDR=0.0.0.0 in your config file or pass it via -e to the docker run command. Hope that helps.

@HESOYAM-abuser
Copy link

hi @muety.
I have the same problem here
I want to run it using docker-compose.yml
It ends with a error due to databse
It can't connect to the database

anchr_1 | MongoServerError: Authentication failed. anchr_1 | at Connection.sendCommand (/app/node_modules/mongodb/lib/cmap/connection.js:289:27) anchr_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) anchr_1 | at async Connection.command (/app/node_modules/mongodb/lib/cmap/connection.js:312:26) anchr_1 | at async executeScram (/app/node_modules/mongodb/lib/cmap/auth/scram.js:79:22) anchr_1 | at async ScramSHA1.auth (/app/node_modules/mongodb/lib/cmap/auth/scram.js:39:16) anchr_1 | at async performInitialHandshake (/app/node_modules/mongodb/lib/cmap/connect.js:104:13) anchr_1 | at async connect (/app/node_modules/mongodb/lib/cmap/connect.js:24:9) { anchr_1 | errorResponse: { anchr_1 | ok: 0, anchr_1 | errmsg: 'Authentication failed.', anchr_1 | code: 18, anchr_1 | codeName: 'AuthenticationFailed' anchr_1 | }, anchr_1 | ok: 0, anchr_1 | code: 18, anchr_1 | codeName: 'AuthenticationFailed', anchr_1 | connectionGeneration: 0, anchr_1 | [Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' } anchr_1 | } anchr_1 | MongoServerError: Authentication failed. anchr_1 | at Connection.sendCommand (/app/node_modules/mongodb/lib/cmap/connection.js:289:27) anchr_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) anchr_1 | at async Connection.command (/app/node_modules/mongodb/lib/cmap/connection.js:312:26) anchr_1 | at async executeScram (/app/node_modules/mongodb/lib/cmap/auth/scram.js:79:22) anchr_1 | at async ScramSHA1.auth (/app/node_modules/mongodb/lib/cmap/auth/scram.js:39:16) anchr_1 | at async performInitialHandshake (/app/node_modules/mongodb/lib/cmap/connect.js:104:13) anchr_1 | at async connect (/app/node_modules/mongodb/lib/cmap/connect.js:24:9) { anchr_1 | errorResponse: { anchr_1 | ok: 0, anchr_1 | errmsg: 'Authentication failed.', anchr_1 | code: 18, anchr_1 | codeName: 'AuthenticationFailed' anchr_1 | }, anchr_1 | ok: 0, anchr_1 | code: 18, anchr_1 | codeName: 'AuthenticationFailed', anchr_1 | connectionGeneration: 0, anchr_1 | [Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' } anchr_1 | } anchr_1 | unable to connect to database at mongodb://anchr:1234@mongo:27017/anchr anchr_1 | Error: unable to connect to database at mongodb://anchr:1234@mongo:27017/anchr at NativeConnection.onConnectFailed (/app/app.js:11:15) at NativeConnection.emit (node:events:517:28) at /app/node_modules/mongoose/lib/connection.js:840:30 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) anchr_1 | unable to connect to database at mongodb://anchr:1234@mongo:27017/anchr anchr_1 | Error: unable to connect to database at mongodb://anchr:1234@mongo:27017/anchr at onConnectFailed (/app/app.js:11:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) anchr_anchr_1 exited with code 1

@HESOYAM-abuser
Copy link

HESOYAM-abuser commented Oct 16, 2024

I found the fix @muety
The user of the database was not created before

I created the user by using mongo shell:
sudo docker exec -it anchr_mongo_1 mongosh -u anchr -p 1234

However i want to do this in docker-compose.yml or DockerFile

@muety muety closed this as completed in ddbc990 Oct 16, 2024
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

No branches or pull requests

3 participants