bitcoinvsalts / node-binance-trader

💰 Cryptocurrency Trading Strategy & Portfolio Management Development Framework for Binance. 🤖
https://bitcoinvsalts.com
MIT License
1.16k stars 381 forks source link

Error: error: password authentication failed for, when run start #113

Closed danfercf1 closed 3 years ago

danfercf1 commented 3 years ago

I received this error when I try to run the server:

(node:284424) UnhandledPromiseRejectionWarning: error: password authentication failed for user "daniel"
    at Connection.parseE (/home/daniel/projects/mine/node-binance-trader/node_modules/pg/lib/connection.js:614:13)
    at Connection.parseMessage (/home/daniel/projects/mine/node-binance-trader/node_modules/pg/lib/connection.js:413:19)
    at Socket.<anonymous> (/home/daniel/projects/mine/node-binance-trader/node_modules/pg/lib/connection.js:129:22)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
(node:284424) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:284424) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've already configured the secrets in the docker-compose file, and I didn't configure the user: daniel, I don't know why the services uses that user

dargmuesli commented 3 years ago

The only reason I'd suspect is that your environment variable "DATABASE_URL" contains that username.

danfercf1 commented 3 years ago

The error was because I didn't define the "DATABASE_URL", but in the code there is a default definition for that and I got the error even with that

dargmuesli commented 3 years ago

But why would the default definition in code be "daniel"?

danfercf1 commented 3 years ago

I'm thinking that for a reason that I don't know, the configuration is using my Linux user to sign in into the DB