Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Mongodb Timeout Zenbot 4 #178

Closed
Tjololo12 opened this issue May 22, 2017 · 7 comments
Closed

Mongodb Timeout Zenbot 4 #178

Tjololo12 opened this issue May 22, 2017 · 7 comments
Labels

Comments

@Tjololo12
Copy link

Just installed zenbot 4, I'm trying to do a backfill after configuring mongo. However, I'm getting a TON of timeouts:

retrying...
{ MongoError: connection 6 to localhost:27017 timed out
at Function.MongoError.create (/root/zenbot/zenbot_test/zenbot/node_modules/mongodb-core/lib/error.js:29:11)
at Socket. (/root/zenbot/zenbot_test/zenbot/node_modules/mongodb-core/lib/connection/connection.js:188:20)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at Socket.emit (events.js:188:7)
at Socket._onTimeout (net.js:352:8)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
name: 'MongoError',
message: 'connection 6 to localhost:27017 timed out',
saved: false,
obj:
{ trade_id: 25018904,
time: 1495411102000,
size: 56.51973033,
price: 0.07220001,
side: 'sell',
id: 'poloniex.ETH-BTC-25018904',
selector: 'poloniex.ETH-BTC' } }

My CPU isn't pegged, I have 16 cores on this system. My RAM isn't full, my disk access isn't full, and zenbot3 is working without throwing timeout errors, it's only the v4 that's doing it. I can't find the URI string to add the timeout info to it, but by default it shouldn't have a timeout, but I'm not sure. How do I troubleshoot and fix this, this system should not be bogged down by traders and mongo, I have way more intensive programs running on less powerful machines, so I believe it's just a config problem on my end, but I'm not sure where.

@DeviaVir
Copy link
Owner

Experiencing the same issue:

docker logs -f zenbot_xrp-btc_1
fetching pre-roll data:

skipping 59 hrs of previously collected data

poloniex.XRP-BTC saved 200 trades 2 days left
{ MongoError: connection 4 to mongodb:27017 timed out
    at Function.MongoError.create (/app/node_modules/mongodb-core/lib/error.js:29:11)
    at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:188:20)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:86:13)
    at Socket.emit (events.js:188:7)
    at Socket._onTimeout (net.js:352:8)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
  name: 'MongoError',
  message: 'connection 4 to mongodb:27017 timed out',
  saved: false,
  obj:
   { trade_id: 7398514,
     time: 1495258870000,
     size: 1858.090329,
     price: 0.00016141,
     side: 'buy',
     id: 'poloniex.XRP-BTC-7398514',
     selector: 'poloniex.XRP-BTC' } }
retrying...

The weird thing is, is that that same mongo is being used by two other instances, which do not have any issues at all. I restarted all (docker) instances a few times and the poloniex.XRP-BTC kept being a problem for some reason.

@oceanio
Copy link

oceanio commented May 23, 2017

same error
I am using mac and mongodb 3.4.4, and with selector poloniex.ETH-BTC too.

@busbyjon
Copy link

Same error here - locally and remote. I think it may be to do with how Zenbot is creating the connection each time (guess)..

@DeviaVir DeviaVir added the bug label Jun 3, 2017
@kennethmitra
Copy link

Same issue with mongodb 2.4.10 on a raspberry pi 3

./zenbot.sh backfill poloniex.ETH-BTC

poloniex.ETH-BTC saved 200 trades 14 days left
.........{ MongoError: connection 0 to localhost:27017 timed out
    at Function.MongoError.create (/home/pi/Programs/zenbot/node_modules/mongodb-core/lib/error.js:29:11)
    at Socket.<anonymous> (/home/pi/Programs/zenbot/node_modules/mongodb-core/lib/connection/connection.js:198:20)
    at Object.onceWrapper (events.js:291:19)
    at emitNone (events.js:86:13)
    at Socket.emit (events.js:186:7)
    at Socket._onTimeout (net.js:342:8)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)
  name: 'MongoError',
  message: 'connection 0 to localhost:27017 timed out',
  saved: false,
  obj:
   { trade_id: 29118627,
     time: 1498806845000,
     size: 0.01090199,
     price: 0.11638683,
     side: 'buy',
     id: 'poloniex.ETH-BTC-29118627',
     selector: 'poloniex.ETH-BTC' } }
retrying...
..{ MongoError: connection 5 to localhost:27017 timed out
    at Function.MongoError.create (/home/pi/Programs/zenbot/node_modules/mongodb-core/lib/error.js:29:11)
    at Socket.<anonymous> (/home/pi/Programs/zenbot/node_modules/mongodb-core/lib/connection/connection.js:198:20)
    at Object.onceWrapper (events.js:291:19)
    at emitNone (events.js:86:13)
    at Socket.emit (events.js:186:7)
    at Socket._onTimeout (net.js:342:8)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)
  name: 'MongoError',
  message: 'connection 5 to localhost:27017 timed out',
  saved: false,
  obj:
   { trade_id: 29101946,
     time: 1498792453000,
     size: 0.55549842,
     price: 0.11497,
     side: 'buy',
     id: 'poloniex.ETH-BTC-29101946',
     selector: 'poloniex.ETH-BTC' } }
retrying...

poloniex.ETH-BTC saved 91463 trades 13 days left
.........^C

@ghost
Copy link

ghost commented Aug 29, 2017

Same issue with mongodb 3.0.2 on a raspberry pi 2...

@DeviaVir
Copy link
Owner

Haven't seen this happen in a long while. Closing this for now (also since there doesn't seem to be an active idea for a fix)

@majal
Copy link

majal commented Jun 5, 2020

I tried zenbot 4.1.0 on Ubuntu 20.04. MongoDB timeouts only when the --silent flag is included. Otherwise it succeeds. It seems that the script is too fast for the DB. Is it possible to increase the timeout? Or a way to slow the bot down?

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

No branches or pull requests

6 participants