abanchev / binance-proxy

62 stars 20 forks source link

error #4

Closed fmhc closed 3 years ago

fmhc commented 3 years ago

I'm getting this error from the docker log with a 10 freqtrade instances test after 3h

(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '6' of undefined
    at Client.getCandles (file:///usr/src/app/src/client.js:50:46)
    at file:///usr/src/app/src/server/index.js:16:31
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at /usr/src/app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3)
(node:1) 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: 47318)

and i have been seeing a teapot message on another FT instance, so i guess i was IP-banned. can we have a better error handling / check if ban or maybe even an output signalling the current API weight / or think about throttling it down somehow?

abanchev commented 3 years ago

The IP ban issue is not related to the proxy, the proxy itself does not do any API requests after the initial ticker data is loaded (so once you start it, it will make one request per pair, after that we rely on websockets). The latest commit fixes the specific issue you had.