Skip to content
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.', OSError(0, 'Error')),) #163

Open
ghost opened this issue Sep 25, 2017 · 5 comments
Open
Labels
bug Something is not behaving as it should in the code

Comments

@ghost
Copy link

ghost commented Sep 25, 2017

Hello,

My script runing now from a long time has been stop

and i have had this error:

ConnectionError(ProtocolError('Connection aborted.', OSError(0, 'Error')),)

What is mean ?

Thanks.

@s4w3d0ff
Copy link
Owner

Do you have a timeout set? if not maybe set it to something big, like 300.

@ghost
Copy link
Author

ghost commented Oct 1, 2017

yes s4w3d0ff i have a timeout set to 3.05 to connection and None for answer

@s4w3d0ff
Copy link
Owner

s4w3d0ff commented Oct 1, 2017

I'm not sure where that error is coming from, can you post the traceback?

@ghost
Copy link
Author

ghost commented Oct 1, 2017

i don't have it anymore but if it s happen again yes
the only problem is that i start my script in a screen so i won't be all the traceback :(

@s4w3d0ff
Copy link
Owner

Looking back, if this issue keeps happening (and you think it is this module that is causing it) you can log the logging output to a .txt file that you can review later when an error occurs. There are ways to truncate the file so you don't have a huge file to look through.

https://stackoverflow.com/a/40088591/3389859

import logging
import poloniex
from logging.handlers import RotatingFileHandler

logging.basicConfig(filename="my_log.log", level=logging.DEBUG)
poloniex.logger.setLevel(logging.DEBUG)
fileLoggerHandler = RotatingFileHandler('my_log.log', maxBytes=1000, backupCount=2)
poloniex.logger.addHandler(fileLoggerHandler)

While looking for a more simple solution I found this SO question:
https://stackoverflow.com/questions/1508467/log-exception-with-traceback

One answer might work for you if you are executing your script remote using bash and want to log just the exceptions:
https://stackoverflow.com/a/36633733/3389859

Append errors to file, other output to the terminal:

./test.py 2>> my_log.log

@s4w3d0ff s4w3d0ff reopened this Jul 27, 2019
@s4w3d0ff s4w3d0ff added the bug Something is not behaving as it should in the code label Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not behaving as it should in the code
Projects
None yet
Development

No branches or pull requests

1 participant