abanchev / binance-proxy

62 stars 18 forks source link

Errors in binance-proxy docker #10

Open wildloveil opened 2 years ago

wildloveil commented 2 years ago

Hi, In binance-proxy docker I get the following error: (node:1) UnhandledPromiseRejectionWarning: FetchError: request to https://api.binance.com/api/v3/klines?symbol=XTZUSDT&interval=5m failed, reason: getaddrinfo ENOTFOUND api.binance.com

at ClientRequest.<anonymous> (/usr/src/app/node_modules/node-fetch/lib/index.js:1483:11)

at ClientRequest.emit (events.js:400:28)

at TLSSocket.socketErrorListener (_http_client.js:475:9)

at TLSSocket.emit (events.js:400:28)

at emitErrorNT (internal/streams/destroy.js:106:8)

at emitErrorCloseNT (internal/streams/destroy.js:74:3)

at processTicksAndRejections (internal/process/task_queues.js:82:21)

(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: 181)

I checked and my DNS servers are good, any idea how to solve it?

Thanks.

abanchev commented 2 years ago

Try to connect to the docker shell and see if ping is working, maybe it is a networking issue with docker.

wildloveil commented 2 years ago

Thank you for the quick response, however, looks like it's not a networking issue. below is the console output from inside the docker:

/usr/src/app # ping api.binance.com PING api.binance.com (52.84.226.14): 56 data bytes 64 bytes from 52.84.226.14: seq=0 ttl=237 time=268.203 ms 64 bytes from 52.84.226.14: seq=1 ttl=237 time=268.155 ms 64 bytes from 52.84.226.14: seq=2 ttl=237 time=268.121 ms 64 bytes from 52.84.226.14: seq=3 ttl=237 time=268.326 ms 64 bytes from 52.84.226.14: seq=4 ttl=237 time=268.227 ms ^C --- api.binance.com ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 268.121/268.206/268.326 ms /usr/src/app # _binance-proxy_logs.txt

The docker is connected with "host" as networking type and have around 10 bots behind it. If any other input is usefull, please let me know. Attached is the container log file.