[Python] requests.exceptions.ConnectionError: ('Connection aborted.',...

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I made a telegram bot and deployed it on Render. All works fine for like 3 hours then the bot gets down and throws this error:

    `raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`


    Worth mentioning that the server keeps being Live despite the error, but the bot gets totally out of service.

    And when re-deploying it, it works fine for another 3 hours and then bot dies but server keeps Live.

    I tried adding this code:

    time.sleep(0.45)
    r = requests.get(get_url(name), headers=headers)
    if r.status_code == 200:
    soup = bs(r.content, features='html.parser')


    But did not help that much. Any solutions?

    Continue reading...

Compartilhe esta Página