Click here to Skip to main content
14,602,124 members
Rate this:
Please Sign up or sign in to vote.
See more:
What does this error mean in python? Like what is actually happening?

What am I messing with because it seems greater than my current knowledge scope.

ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Posted
Updated 5-Feb-20 5:45am
Rate this:
Please Sign up or sign in to vote.

Solution 1

Read to error message, it is first help.
Quote:
An existing connection ...
Tells you that there was already an active connection at the place of error where you probably try to open a second one.
   
Comments
PythonHeadBanger 27-Nov-15 18:13pm
   
Thank you. Any ideas on common solutions to this error?

I'm learning the the Python Requests module to figure out how to solve the situation.
Patrice T 27-Nov-15 18:21pm
   
Common solution is obvious: Never try to open more than 1 connection.
Problem and solution are in your code.
PythonHeadBanger 27-Nov-15 18:28pm
   
If one is using a loop to open multiple websites... how might one slow it down such that only one connection is open at a time?
Patrice T 27-Nov-15 18:40pm
   
1 connection per server.
PythonHeadBanger 28-Nov-15 13:35pm
   
Any keywords I should google? Thank you!
Patrice T 28-Nov-15 15:52pm
   
start with the error message
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
PythonHeadBanger 28-Nov-15 17:07pm
   
lol this page is the fourth result!
Rate this:
Please Sign up or sign in to vote.

Solution 2

What's actually happening is the server on the otherside of the request is closing the connection.

It's possible that the problem lies on the server side.

I've tried inserting
time.sleep(3)
which kind of seems to help. I'd really rather not be inserting seconds into the run time though.

Final update and solution achieved. Given the possibility of a serverside malfunction or misbehavior I changed my IP address. My code compiles and runs as it did last week.


http://www.networkautomation.com/urc/knowledgebase/common-ftp-socket-errors/02899795-9874-19FA-89D9FA88304286FA/[^]

FTP Socket Error Code 10054

Additionally, if you are encountering any FTP related issues, we strongly suggest that you test the transmission with other FTP clients. This is a good method in determining the root of the problem. Keep in mind that when you are having similar problematic behavior in multiple clients against the same server, it's more than likely a server problem


https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx
WSAECONNRESET
10054
Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.</pre>
   
v3
Rate this:
Please Sign up or sign in to vote.

Solution 6

Hi,

I had a similar problem when I tried to connect to MongoDb Atlas via pymongo. There are 3 things you can do to solve this issue:

1. Install dnspython
2. Install checkdmarc 4.2.3
3. Go to you data base host, in my case it is MongoDB Atlas, and allow access to your database from anywhere. In the end, the IP on your host should look like this 0.0.0.0/0

I did all these steps and it is working for me. I hope this helps.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

proxy configuration issue if you are trying this from inside a firewalled Corporate network.
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

It's a bug.

https://support.microsoft.com/en-us/help/2730109/odbc-call-failed-error-when-you-open-a-table-that-is-linked-to-a-sql-d[^]

The article says it's with SQL on Azure but if you look around the internet it's more than obvious that it's not just on Azure.

Workaround
To work around this issue, use one of the following methods:
* Click Last record as soon as the table is opened in order to display all records in the linked table in the Datasheet View of Access.
* Do not select all records in the linked table to be displayed. Instead, select only a limited number of records.
   
Comments
Richard Deeming 18-Sep-18 13:03pm
   
Why would you think that a KB article about MS Access would be applicable to an already-solved question about Python?!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100