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

ESOCKETTIMEDOUT on Poloniex while syncing balance (trades too). #1670

Open
h311m4n opened this issue Jul 22, 2018 · 3 comments
Open

ESOCKETTIMEDOUT on Poloniex while syncing balance (trades too). #1670

h311m4n opened this issue Jul 22, 2018 · 3 comments
Labels
bug enhancement exchange Relating to an exchange

Comments

@h311m4n
Copy link

h311m4n commented Jul 22, 2018

Hello,

I've launched a bot on Poloniex with a small amount of funds to try it out on the BTC-USDT pair. It made it's first trade and bought USDT. Zenbot running on an Ubuntu 16.04 vm.

Using node.js 8.11.3

However, I'm getting errors likes these at a few minutes interval:

2018-07-22 10:50:14 - error syncing balance
{ Error: ESOCKETTIMEDOUT
    at ClientRequest.<anonymous> (/home/user/zenbot/node_modules/poloniex.js/node_modules/request/request.js:812:19)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at TLSSocket.emitTimeout (_http_client.js:706:34)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket.Socket._onTimeout (net.js:410:8)
    at ontimeout (timers.js:498:11) code: 'ESOCKETTIMEDOUT', connect: false }

However it does get the correct USDT balance from my polo account on the GUI. I'm getting similar errors for getting trades etc. And when I relaunch the bot, I have no trade history on the GUI (don't know if this is normal or not?).

When I relaunch the bot, all is fine, but after say 10mins, I start getting these timeouts. It seems to crash after a while with a nonce error.

I'm a complete node.js noob so this doesn't really speak to me. What I've tried:

New api key+secret: no difference
Checked my firewall (running pfsense at home): nothing is getting blocked
DNS requests seem to work fine from the linux box

Can someone advise on what needs to be done? I've googled around but nothing specific to this error with Zenbot and Poloniex.

Thanks!

@h311m4n
Copy link
Author

h311m4n commented Jul 22, 2018

I've made the following change in node_modules/poloniex.js/lib/poloniex.js:

options.json = true;
      options.headers['User-Agent'] = Poloniex.USER_AGENT;
      options.strictSSL = Poloniex.STRICT_SSL;
      options.timeout = 60 * 2000;

Before it was 60*1000, I'm not sure if it fixes the problem or what exact consequences this may have. However the bot has been running for 20mins now without any timeout occuring.

@DeviaVir DeviaVir added bug enhancement exchange Relating to an exchange labels Jul 23, 2018
@h311m4n
Copy link
Author

h311m4n commented Jul 23, 2018

Ok, so the bot has now been running for over a day and I haven't seen these timeout issues again.

I do however, every now and then get the infamous nonce error where is says nonce is x and I provided y. The difference between the 2 nonce is 2000.

I've google this quite extensively but I'm not sure of what fix should be applied? I read some people where advancing their clocks a few seconds to counter this, sounds a bit edgy though, especially for bot trading.

Also read to create new API+Key pair, should I try this once more? These nonce errors are popping up every now and then but it seems not in a constant manner (like not every x minutes).

Any insight welcome!

@Enelar
Copy link

Enelar commented Jul 31, 2018

Hey @h311m4n , im trying to run bot for the first time.
It keeps showing same blue timestamp. Is it running?
2018-07-31 04:26:56 now its 4:33. I've tried run it several times, no effect.

Its not the same, but still poloniex.

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

No branches or pull requests

3 participants