I am using the pydev remote debugger feature for my application.
When I try to stop the debugger server via the stop button it shows on the console that the server is successfully terminated but it isn't because it is still accepting new connections on its default port (5678).
Do you know how can I stop the server in a reliable way?
Thanks in advance.
This was a bug -- and it was fixed in the latest version (PyDev 2.2.4), so, please upgrade to the latest version and that should be working already.
Related
I am a new user to the mesa python package and I noticed that when running examples we can do server.launch() which will start running the server (in a localhost address) stuff so that we can run the example in the browser as a client program. How do I stop this server now?
I checked everywhere in the documentation and cannot find it. It is really annoying that I have to restart my computer for stopping it.
If You dive into implementation of Mesa module, unfortunately it looks like there is no possibility to stop server.
But object ModularServer depends on Tornado object. So maybe You can find answer here "How do I stop Tornado web server?"
I use Windows host and Ubuntu guest with VirtualBox. Flask application sources are shared from host to guest using VirtualBox shared folders and my virtualenvs and nginx are on guest.
Now I should open SSH session to restart my Flask application (debugging with reload enabled, but in case of syntax error it needs a rerun) and I have no debug capabilities.
I used to use PyDev and Windows installation of Python with debug and restart right from IDE and miss this.
For debugging you can use the remote debugger: http://pydev.org/manual_adv_remote_debugger.html (just point it to your main box IP and things should work).
Now, currently PyDev does not support launching a process through ssh, so, that'd be a new feature request (which you can request at: https://sw-brainwy.rhcloud.com/tracker/PyDev).
I want to use eclipse, pydev to remote debug my python script. Python script is on a remote Ubuntu server, and Eclispe/pydev is running on my Windows 7 machine.
I followed every step according to this one.
http://pydev.org/manual_adv_remote_debugger.html
The problem is in the last step of configuring path in pydevd_file_utils.py on server, it does not recognize the change. This is what I changed:
PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'c:\EZ_Green\plugins', r'/home/jiechao/EZ_Green/plugins')]
When I run the script, it gives me such error.
pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/jiechao/EZ_Green/plugins/D:/EZ Green/backend/getData.py (will have no effect)
Seems the change does not apply, has anyone done this before or have any ideas?
Thanks a lot
-----------------update 1--------------
So I solve the previous problem and now here is the new problem.
This is the output of program, and it seems the path configuration is correct.
Debug Server at port: 5678
pydev debugger: replacing to server: D:\EZ Green\Product\EZ_Green\plugins\test.py
pydev debugger: sent to server: /home/jiechao/EZ_Green/plugins\test.py
pydev debugger: replacing to client: /home/jiechao/EZ_Green/plugins/test.py
pydev debugger: sent to client: D:\EZ Green\Product\EZ_Green\plugins/test.py
But eclipse does not stop at the breakpoint, not even at pydevd.settrace()
I have no idea why it does not stop.
When I use remote debug on local machine, it works pretty well. When I want to debug on a remote server machine, it does not work. I don't know what's the problem.
------------------update 2---------------------
Problem solved. The script on my client and server turns out to be a little different. So I did not see the breakpoint it stopped.
I am so stupid!
Thanks anyway.
Even though it is possibly not the exact approach you may expect,
one option is to start the Unittest from the command line and attach the debugger by RemoteDebugServer via 'pydevd.py'.
This is now a fully automated option of ePyUnit which includes the automation of remote debugging with PyDev and Eclipse by 'pydevd.py'. This works seamlessly for 'subprocesses' as well as independently started command line processes.
The hostame and the port number could be varied as required, default is
localhost:5678.
See:
https://pypi.python.org/pypi/epyunit
https://pythonhosted.org/epyunit/
For basics of remote debugging:
http://www.pydev.org/manual_adv_remote_debugger.html
Also enhanced unittest integration into PyUnit.
Comments and fixes are welcome.
Have fun.
I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create a Windows service.
I installed it on a computer running Windows XP Pro SP3. However, I can't connect to it when it's running as a service. I can confirm that it's binding to the address/port, because I get a conflict when I try to bind to that address/port with another application. Further, I have checked the Windows Firewall settings and have added appropriate exceptions. If I run the server as a simple console application, everything works as expected. However, when I run it as a service, it doesn't work.
I vaguely remember running into this problem before, but for the life of me can't remember any of the details.
Suggestions, anyone?
Possibly the program may be terminated just after initialization. Please check whether it is continuously listening to the requests.
netstat -an |find /i "listening"
And analyze the command line parsed to the programs. You may use procexp to do that.
First of all, whenever you implement a Windows service, be sure to add proper logging.
My worker threads were terminating because of the exception, "The socket operation could not complete without blocking."
The solution was to simply call sock.setblocking(1) after accepting the connection.
Check to see that the service is running under the Nertwork Service account and not the Local System account. The later doesn't have network access and is the default user to run services under. You can check this by going to the services app under administrative tool in the start menu and looking for your service. If you right-click the service you can go to properties and change the user that it is run under.
I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell
[LOG]where you can enter python console commands while debugging
>>>c:\documents and settings\aster\.netbeans\6.7\config\nbpython\debug\nbpythondebug\jpydaemon.py
args = ['C:\\Documents and Settings\\aster\\.netbeans\\6.7\\config\\nbPython\\debug\\nbpythondebug\\jpydaemon.py', 'localhost', '11111']
localDebuggee= None
JPyDbg connecting localhost on in= 11111 /out= 11112
ERROR:JPyDbg connection failed errno(10061) : Connection refused
Debug session normal end
ERROR :: Server Socket listen for debuggee has timed out (more than 20 seconds wait) java.net.SocketTimeoutException: Accept timed out
thanks for answer
I just installed Python for NetBeans yesterday and hadn't tried the debugger, so just tried it, and I got the same error. So I thought maybe it's a Firewall issue, disabled my Firewall and retried it, and then it worked.
However I restarted the Firewall and now it's still working, so I don't know. I saw the Netbeans options for Python have an input to specify the beginning listening port (which mine was 29000 not 11111 like yours).
For Python I like WingIDE from Wingware.