Remote Debugging

Answered

Hello,

 

I have the latest PyCharm Professional edition (2021.2.3) for Mac, and I followed the instructions of Remote Debugging with the Python remote debug server configuration.

I followed the steps without any problems but when I press the debug button I get the messege

 

Error running '<debug configuration name>':

Permission denied (Bind failed).

 

In Create a run/debug configuration, in step 4, I tried both

  1. Install using pip
  2. Add from the installation directory

and get the same error.

0
6 comments

Permission denied (Bind failed) error probably means that the connection to the port you specified is not allowed. Make sure the firewall or other security software is not blocking the connection.

0

Hello Sergey Karpov,

 

thank you for your reply. In order to connect to that server I use a VPN or I should be located in the building where the server is (have the appropriate IP). I tried it both from home with the VPN activated, and from a computer with the appropriate IP and get the same error message. Is this category included in what you described above as "other security software"?

What should I check?

0

I think it has nothing to do with VPN as it simply starts the server and waits for the connection.
The connection from the server where the script that you want to debug is running happens only when you run the script and it connects to that debug server.

Since the server itself cannot be started, something on your local machine is not letting it connect to the host and port you specified. 
You can simply disable your firewall, if possible, or use another port and see if it helps.

0

The port number that I used in configuration, was the port number that the administrator of the server have given me, and I have succesfully used the server numerous times. In fact after the connection fail, I accessed the server using ssh from terminal and logged in to the server without a problem.

Does that mean that it is a firewall thing, should I look into the firewall? The machine that I use now runs Debian 9.

Just to be sure, I also want to mention that what I am trying to do, in case I follow a wrong procedure. I want to debug a Python script with PyCharm to a server, just like I would do locally where I develop the project. I develop the Python project locally, deploy it to the server, and make a configuration for remote debugging.

Thank you Sergey Karpov.

0

Did you specify the IP of your local machine?

The idea is that you start the server on your local machine using the Remote Debug Server configuration in PyCharm and then connect to that server by running the script on the remote server that contains the needed lines of code to connect to the aforementioned server.

So you shouldn't specify the host and port of the remote server in that run configuration.

0

Sergey Karpov thank you, now everything makes sense. I used the debug server without a problem. You had been very helpful.

0

Please sign in to leave a comment.