Hello,
I'm trying move my current forum to a docker container, but I get this error when I start and then see nodebb's log:
at readableAddChunk (internal/streams/readable.js:284:9)
[cluster] Child Process (381) has exited (code: 0, signal: null)
NodeBB v1.16.2 Copyright (C) 2013-2014 NodeBB Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
For the full license, please visit: http://www.gnu.org/copyleft/gpl.html
Clustering enabled: Spinning up 1 process(es).
2021-04-02T20:29:11.773Z [4567/466] - info: Initializing NodeBB v1.16.2 http://DOMAIN.COM/
(node:466) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T20:29:29.820Z [4567/466] - error: MongoError: Authentication failed.
at MessageStream.messageHandler (/home/nodebb/node_modules/mongodb/lib/cmap/connection.js:268:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/home/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/home/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
[cluster] Child Process (466) has exited (code: 0, signal: null)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
I checked config.json
file and the database connection info, they're correct in my opinion (I've copied them from my current NodeBB forum which is running on a standalone VPS):
{
"url": "http://DOMAIN.COM/",
"secret": "e7cfe25e-6916-4831-8c6f-5856b122bfa2",
"database": "mongo",
"port": "4567",
"mongo": {
"host": "node_db",
"port": "27017",
"username": "USER",
"password": "PASS",
"database": "DB"
}
}
My mongo
container is another one, and these two container can ping each other with no problem (there's no networking issue between them), but I don't know why NodeBB shows it cannot authenticate.
Also when I run ./nodebb setup
, I get the below logs:
2021-04-02T20:35:15.917Z [485] - info: NodeBB Setup Triggered via Command Line
Welcome to NodeBB v1.16.2!
This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
Press enter to accept the default setting (shown in brackets).
2021-04-02T20:35:16.396Z [485] - info:
Now configuring mongo database:
(node:485) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T20:35:17.208Z [485] - warn: NodeBB Setup Aborted.
MongoError: Authentication failed.
at MessageStream.messageHandler (/home/nodebb/node_modules/mongodb/lib/cmap/connection.js:268:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/home/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/home/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
I have also modified bindIp
line and added nodebb's container name to allow connections, but I get this error.
bindIp: 127.0.0.1,NAME
telnet
ing from NodeBB container to telnet mongo 27017
works fine and mongo "mongodb:[email protected]"
in command line of nodebb container works fine too.
I also logged into MongoDB's shell with the exact username and password and that was right.
It's I think clear that it cannot authenticate, but I do not know why and what's my issue that I did not notice.
Could you please help me?