PyCharm remote debugging timeout error possibly by port connection - debugging

I have set up PyCharm for remote debugging with the Python remote debug server configuration as described in PyCharm website on a Mac OS and a Linux (Debian 11.1) machine but I get a
socket.timeout: timed out
error.
In this configuration PyCharm emulates a server in the local machine where the PyCharm runs, and then a script running in a remote machine connects to that server. That server in turn tries to connect with the local machine.
It seems that there is a problem in the connection of the PyCharm server with the local machine, and possibly something with the port.
How can I check if the port is open (terminal commands or something else) or if there is something else blocking the connection?
This is the full error message:
Could not connect to <public ip address>: 12345
Traceback (most recent call last):
File "<path>/miniconda3/envs/env/lib/python3.9/site-packages/_pydevd_bundle/pydevd_comm.py", line 458, in start_client
s.connect((host, port))
socket.timeout: timed out
Traceback (most recent call last):
File "<path>/main.py", line 43, in <module>
pydevd_pycharm.settrace(<public ip address>, port=12345, stdoutToServer=True, stderrToServer=True)
File "<path>/miniconda3/envs/env/lib/python3.9/site-packages/pydevd.py", line 1689, in settrace
_locked_settrace(
File "<path>/miniconda3/envs/env/lib/python3.9/site-packages/pydevd.py", line 1745, in _locked_settrace
debugger.connect(host, port) # Note: connect can raise error.
File "<path>/miniconda3/envs/env/lib/python3.9/site-packages/pydevd.py", line 655, in connect
s = start_client(host, port)
File "<path>/miniconda3/envs/env/lib/python3.9/site-packages/_pydevd_bundle/pydevd_comm.py", line 458, in start_client
s.connect((host, port))
socket.timeout: timed out

Related

Failed to connect to Mir: Failed to connect to server socket: No such file or directory Unable to init server:

I have installed ubuntu terminal in window 10. It's work fine but when I install gedit or any other application then these applications installed successfully but I can not open it. Whenever I tried it gives me the Error mentioned below.
"Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
(gedit:4821): Gtk-WARNING **: cannot open display:"
In the description of "Ubuntu terminal", it says: "run Ubuntu command line utilities". gedit is not a command line utility. It is a graphical utility, so it is not supported out of the box.
Your hope is that the final error is cannot open display. I bet that if you provide a suitable display in your computer, the utility will show up. Search for a X-server for your windows machine and try with the X-server installed.
This could help: https://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/

Cloudera Host Installation failure: Failed to detect Cloudera Manager Server

I'm trying to put a host on a hadoop cluster using the Cloudera Manager.
The two computers I am using for this are the following:
10.10.10.9 is supposed to be a DataNode and my first host
10.10.10.10 has the Cloudera Manager and will be the NameNode
The manager is having trouble with the "Cluster Installation" part of the "Add Hosts to the Cluster" scenario on the GUI.
I get the following error when the manager tries to detect the Cloudera Manager Server:
BEGIN host -t PTR 10.10.10.10
10.10.10.10.in-addr.arpa domain name pointer stardestroyer.riis.local.
END (0)
using stardestroyer.riis.local as scm server hostname
BEGIN which python
/usr/bin/python
END (0)
BEGIN python -c 'import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();' stardestroyer.riis.local 7182
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.gaierror: [Errno -2] Name or service not known
END (1)
could not contact scm server at stardestroyer.riis.local:7182, giving up
waiting for rollback request
I tried to do as Cheloute instructs in the following link, but it didn't seem to fix my issue. I also had a different error than the poster.
Cloudera Manager. Failed to detect Cloudera Manager Server
If the following is used on the commandline, there's no error.
python -c 'import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();' 10.10.10.10 7182
I'm not really sure how to fix this in the Cloudera Manager, though.
I found that I could have my system administrator delete my reverse DNS entry and the manager ended up working. I don't know if there is a better solution (there likely is), but this is the one I came up with.

socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

I would like to use python to transfer files between two computers.
I use ftplib module in client side and pyftpdlib on sever side. However, I got error "socket.error: [Errno 10061] No connection could be made because the target machine actively refused it". My code is below:
Client side code:
import ftplib
ftp = ftplib.FTP("sever_ip")
ftp.login("username", "password")
ftp.retrlines("LIST")
Server side code:
from pyftpdlib import servers, handlers
address = ('', 21)
server = servers.FTPServer(address, handlers.FTPHandler)
server.serve_forever()
I run the server side code and get:
[I 15-05-28 11:14:41] >>> starting FTP server on :::21, pid=8296 <<<
[I 15-05-28 11:14:41] poller: <class 'pyftpdlib.ioloop.Select'>
[I 15-05-28 11:14:41] masquerade (NAT) address: None
[I 15-05-28 11:14:41] passive ports: None
I run the client side code and get:
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
What settings do I need to change or examine on the target computer (server) to make it accept connections? (My server is Windows Sever 2012R2 and my client is Windows 8)
Updates:
I turned on the firewall of my server and I rerun my client request. Now I got a different error:
socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a per
iod of time, or established connection failed because connected host has failed to respond

putty - psftp connection refused

Im trying to connect with PSFTP.exe but I got error, if I do the same in FTP in cmd line or Filezilla it works good. I have tried other ftps but nobody works.
C:\putty>psftp.exe ftp.mozilla.org
Fatal: Network error: Connection refused
Any suggestions? Do I need to start putty.exe or configure psftp in some way that I have missing?
Im working in Windows 7 64-bit
That's because PSFTP is not an FTP client, it's an SFTP client. Different protocols.

iPython ssh from Windows qtconsole to a remote iPython kernel

I want to run an iPython kernel on a Linux box and then connect to it remotely on a windows machine. The ipython kernel works fine and I can connect a qtconsole to it locally on the Linux box.
On Windows I have installed ipython and paramiko as its ssh client.
I run the following command on Windows 7 x64 cmd
D:\...\.ssh>ipython qtconsole --IPythonConsoleApp.sshserver='user#hostname:22' --IPythonConsoleApp.sshkey='myKey' --IPythonConsoleApp.password='1234'
I get the following error:
[IPythonQtConsoleApp] Could not setup tunnels
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\IPython\frontend\consoleapp.py", line 289, in init_ssh
newports = tunnel_to_kernel(info, self.sshserver, self.sshkey)
File "C:\Python27\lib\site-packages\IPython\lib\kernel.py", line 245, in tunnel_to_kernel
if tunnel.try_passwordless_ssh(sshserver, sshkey):
File "C:\Python27\lib\site-packages\IPython\external\ssh\tunnel.py", line 87, in try_passwordless_ssh
return f(server, keyfile)
File "C:\Python27\lib\site-packages\IPython\external\ssh\tunnel.py", line 123, in _try_passwordless_paramiko
look_for_keys=True)
File "C:\Python27\lib\site-packages\paramiko\client.py", line 332, in connect
self._auth(username, password, pkey, key_filenames, allow_agent, look_for_keys)
File "C:\Python27\lib\site-packages\paramiko\client.py", line 493, in _auth
raise saved_exception
SSHException: not a valid DSA private key file
The key is even created with RSA.
Has anybody had a success in connecting remotely from a Windows machine to a remote ipython kernel?
You say
The key is even created with *R*SA.
but
SSHException: not a valid *D*SA private key file
RSA and DSA are different algorithms.
Either create a DSA private key file, or configure ipython to use RSA.
(I am not familiar with ipython, so cannot advise on the specifics. Sorry.)

Resources