PyCharm remote debugging (pydevd) does not connect - python

PyCharm remote debugging (pydevd) does not connect with the following message:
error: [Errno 10061] No connection could be made because the target machine actively refused it
How can I troubleshoot it?
The output console in PyCharm shows:
Starting debug server at port 21000
Use the following code to connect to the debugger:
import pydevd
pydevd.settrace('*.*.*.*', port=21000, suspend=False)
Waiting for process connection...
Server stopped.
I checked the firewall and PyCharm is allowed for both incoming and outgoing connections.

10061 is WSAECONNREFUSED, 'connection refused', which means there was nothing listening at the IP:port you tried to connect to.
Though I see that you have validated its not a firewall issue, but still I would suggest to check the port numbers again with respect to the ones opened in windows firewall. Or to narrow down just run a simplehttpserver or icmp server at the same port and confirm.

In a direct link communication, it often means that you have already something connected to this port.
To check what process is hearing what port, check this SO question.
You can then either kill the program or change the port, depending of what you can do.
Without more information of the "remote tested", it is hard to know what is happening.

I was having the trouble as well (Server stopped as soon as the client connected).
Turned out that I had apparently too many breakpoints defined.
after having removed most of them and re-initiated my remote debug connection from the client (and having restarted the debug server in pycharm) it doesn't trigger anymore the "Server stopped." problem.

Related

(Pycharm docker setting)Connection refused:no further information

I'm new to Docker. I get a connecting error when trying to setup Docker in PyCharm Professional edition.
I have followed this official manual and turn on the checkbox(Expose daemon on tcp://localhost:2375 without TLS)
But it still not work.
Cannot connect: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.O.O.1:2375
caused by: java.net.ConnectException: Connection refused: no further information
I have accidentally connected docker one time.But when i restart my computer i cannot connect docker anymore.
Any further help would be gratefully appreciated.
If you are facing connection refused then there may be a chance that there is no server to respond to your request.
So first check whether docker server is listening on 2375 port.
netstat -anp tcp | findstr 2375
Or, use tcpview for GUI.
If docker is not listening on this port, then check your C:\ProgramData\Docker\config\daemon.json file and verify whether you have the below Key value pair in your JSON.
"hosts": ["tcp://0.0.0.0:2375"]
If it is not there, then add this and restart your docker daemon.
If you are behind a proxy, then make sure to add this in no-proxy, so that your requests will not be routed via a proxy server.
NOTE: I don't have any experience with docker on windows

Aborted connection error in flask

If the client closes an established connection that it has made with the flask server, I get the following error in the terminal:
[Errno 10053] An established connection was aborted by the software in your host machine
It seems when flask tries to write in the closed stream, it faces errors and hence will complain.
It seemed like a warning or so as the application does not quit after printing the error, but the problem is that my server will stop serving other requests despite being alive in the system.
I have read similar questions but they did not help. How can I prevent this issue? I use both Windows and Linux operating systems.
The cause of this problem is, as we previously discussed, insufficient permissions to perform the network operation. The remedy to the problem was to run the process as an administrator and/or to modify the system policy to allow connections on the restricted port.

Python, tcpServer tcpClient, [WinError 10061]

When I try to run tcpServer and tcpClient on the same local network, it works, but I can't run them on the external network. The OS refuses the connection.
Main builtins.ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
I checked whether tcpServer is running or not using netstat, and it is in the listening state.
What am I supposed to do?
There are most likely two reasons for that:
1.) Your server application is not listening on that particular ip/port
2.) A firewall is blocking that ip/port
I would recommend checking your firewall settings. You could start with turning your firewall off to determine if it really is a firewall issue.
If so, just add an accept rule for your webservice (ip:port).
edit: And check your routing configuration if you are in a more or less complex network. Make sure that both networks can reach each other (e.g. ping the hosts or try to connect via telnet).

Making a connection to APNs with bluehost server

I wrote some code to connect to APNs and it works great on my local machine. But when I upload and try to run it on my bluehost server it just takes a long time and then times out. After further testing I can't even get connected to the aps at all. I try
telnet gateway.sandbox.push.apple.com 2195
Connection timed out
I am thinking it has something to do with my bluehost configuration. I have a dedicated IP address and have bluehost claims that port 2195 is open. Any ideas on why I might not be able to make a connection?
After talking with tech support a second time the problem was that port 2195 wasn't open for outgoing connections. They got it opened and I am now in business.

Connecting to Python XML RPC from the Mac

I wrote an XML RPC server in python and a simple Test Client for it in python. The Server runs on a linux box. I tested it by running the python client on the same linux machine and it works.
I then tried to run the python client on a Mac and i get the following error
socket.error: (61, 'Connection Refused')
I can ping and ssh into the linux machine from the Mac. So i dont think its a configuration or firewall error.
Does anyone have any idea what could be going wrong?
The code for the client is as below:
import xmlrpclib
s = xmlrpclib.ServerProxy('http://143.252.249.141:8000')
print s.GetUsers()
print s.system.listMethods()
"Connection Refused" means the connection was REFUSED - the machine 143.252.249.141 is up, and in the network, but is not accepting connections on port 8000 - it is actively refusing them.
So maybe the server software isn't running on the server? Or is running in another port? Or is bound to a different IP address?

Categories

Resources