Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
710 stars 215 forks source link

MongoDB connects, UI accessible, then fails, exit #90

Closed dmattox10 closed 3 years ago

dmattox10 commented 3 years ago
2020-12-08 02:34:10 - info: ***DISCOUNT*** Having trouble setting up WolfBot on your local machine? Try the cloud version at https://wolfbot.org with a 30% discount with this code: gitsource7393
2020-12-08 02:34:11 - info: minified all resources
2020-12-08 02:34:29 - warn: Received WebSocket data without corresponding receiver. Opcode 11
2020-12-08 02:34:29 - warn: Received WebSocket data without corresponding receiver. Opcode 23
2020-12-08 02:34:29 - warn: Received WebSocket data without corresponding receiver. Opcode 18
2020-12-08 02:34:29 - warn: Received WebSocket data without corresponding receiver. Opcode 13
2020-12-08 02:34:29 - warn: Received WebSocket data without corresponding receiver. Opcode 22
2020-12-08 02:34:41 - error: Error connecting to MongoDB {"message":"getaddrinfo EAI_AGAIN mongo","stack":"MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo\n    at Timeout._onTimeout (/home/dmattox10/git/WolfBot/node_modules/mongodb/lib/core/sdam/topology.js:438:30)\n    at listOnTimeout (internal/timers.js:549:17)\n    at processTimers (internal/timers.js:492:7)","name":"MongoServerSelectionError","reason":{"type":"Single","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":null}}
2020-12-08 02:34:41 - info: Main process exited with code 1

Following the instructions, this is as far as I can get after hours of fiddling. Ran from the CLI as:

MONGO_URI="mongodb://REDACTED:REDACTED@mongo:27017/wolf" BITTREX_API_KEY="REDACTED" BITTREX_API_SECRET="REDACTED" node app.js --config=Noop --trader=RealTimeTrader --noUpdate --noBrowser

I'm trying to get it working within docker, which gives me a whole different error I won't bother you with as it's an unsupported config, but mongoDB is running in docker, hence the hostname, and I couldn't get the app to read from .env file even after adding the package and code, so I defined everything in the run command. The configLocal.ts is expecting these values to be passed in via process.env, it works, it just doesn't work for long, which I've never encountered.

Ekliptor commented 3 years ago

You are setting environment variables when running node app.js.... That's not the way to do it. Instead you have to edit the configLocal.ts and enter your mongoUrl here

dmattox10 commented 3 years ago

Ok, tried it your way, same problem. I knew what I was doing when I edited it to use ENV.

Ekliptor commented 3 years ago

"getaddrinfo EAI_AGAIN mongo","stack":"MongoServerSelectionError: getaddrinfo EAI_AGAIN It's a mongoDB or more likely DNS error. Please refer to their doc why it can't resolve your address.