-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionError(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))) #360
Comments
I've just got this error also upon starting a bot with the latest version of pycryptobot. |
Just tried downgrading urllib to version 1.26.0 with pycryptobot version 2.38.0 and no longer have the above issue. |
Scrub the above message- the error is back! |
i am getting that error to after bot running some hours. PS: I not using Docker! using .venv session |
Yeah, i'm getting this error as well every few hours.
Some times it doesn't crash, it outputs this error but resumes trading after 1 minutes.
Forgot to mention this is on binance exchange don't know if it happens with coinbase pro as well. No docker, no python venv, just using pure python3.9 pycryptobot.py. |
Have the same error on my Pi in a venv environment. Will let you know if this solves the error for me, for now it's running :) |
i am using 15m |
I didn't mean the granularity, but the polling time. The bot runs in a scheduler with a 60s delay, i.e. it makes an API call every minute to get new prices. But unfortunately increasing it to 2min didn't help much, had another error this morning :( |
How can I define this pool time in config? Can't find a reference to it. |
You can't specify it in the config, it's hardcoded here as far as I know: Line 753 in ef49fee
The 60 is the delay time in seconds of the scheduler. |
I'm thinking this has nothing to do with the bot, but with the exchange itself. I figure they have a client timeout. If Binance has a system that resets the peer(us) connection when it fails to respond in a certain amount of time, then their system will terminate the connection after X amount of fails or delays in XX hours. And on our side we see Connection reset by peer, peer as in remote system meaning Binance terminated the connection, not the bot. Following what @jensb89 said (thanks), I did the opposite. I'm sure this is just a temporary fix, but I suggest for this to be implemented as an option in config.json |
That's an interesting idea :) I will try this as well 👍 I guess it shouldn't be too hard to implement this as a config option as well. |
welp!
So...back to start again with this... I really thought I had it. But hey..at least it ran for over 2 full days straight without crashing, i'm partially happy. |
Can confirm, mine also crashed again after around 2 days. Really strange ... I guess another problem is that the auto restart also doesn't seem to work. Maybe we could catch the Connection error and automatically retry a few times?! Not sure that's the best idea though... |
i am testing this method.. A solution, but not THE solution. https://github.com/yanone/raspberrypycryptobot#running-pycryptobot-on-boot |
apparently it now saves the position after crashing, so if you run it on |
Is this problem only with Binance? I am just wondering if Binance are throttling API calls. How many bots are you running concurrently? Firstly, are any of you coinbase pro users? |
@whittlem : I think it affects only Binance. I have one Binance and one Coinbase Bot (on an older repo commit though). So far never had problems with the Coinbase bot. Also Binance is running fine sometimes for days or weeks without any error and then this error shows up multiple times a day. I guess it's on Binance ... |
@whittlem this happens with one and with multiple bots running. Side question: Can RSI be added to the bot as a signal? personally I think would be a great indicator for buy/sell signal. I use it with manual trades and the loss is lower than relying on ema crossing alone. but then again manual trades aren't automated trades. |
@pitbullgti Please create a feature request for RSI if you're interested in it. Regarding this conversation, these errors can happen due to multiple reasons. Flaky connection on the user side, not so graceful configuration on the other side (I think it is fair to assume, that coinbase and binance run a plethora of replicas for their API with autoscaling enabled, it might just happen that you hit a pod that got killed just now). Possible enhancement: retry failed connections wrapping them in a try except block in python? |
Thank you so much for solving my problem |
sometimes i get this error:
the error may appear after a few minutes, or the next day
i am using docker:
docker run --name ETH -v /root/pycryptobot/config.json:/app/config.json -d ghcr.io/whittlem/pycryptobot/pycryptobot:latest --selllowerpcnt -2 --smartswitch 1 --disablebullonly; docker logs -f ETH
conf.json
this is normal? or am I doing something wrong?
I have been using the bot for 2 days, and during this time it has not made a single transaction on the exchange, thanks
The text was updated successfully, but these errors were encountered: