Debugging on Vagrant

Like so many other posts, I run PyCharm on Windows 7 with a vagrant managing a virtualbox server running Ubuntu.  The project is located on my Windows R: drive and shared with Ubuntu via virtualbox's shared folders feature.

The issue I'm having is with debugging.  I have the remote debugger configured properly to run and debug an instance via manage.py runserver 0.0.0.0:8000.

Pycharm's remote debugger connects correctly but as it traces files, it does not show the files in my project directory (either locally or remotely). Instead is shows a copy of the file it copied from remote to a python_stubs directory.  Normally this would be fine except that these are the files I'm editing so as soon as I edit a file, the line numbers get off.  Pycharm is pointing to the correct line of an old version of the file so I have to keep switching back to the new file to see where it really is.

It's very annoying.  I don't remember Pycharm 2.5 acting like this.

Thanks for any help out there.
-- tim
11 comments
Comment actions Permalink
Hi Timothy! Could you please provide a structure of your project. Do you use remote debugging run configuration or debugging with remote interpreter? PyCharm shows a file from the python_stubs directory when stops at a breakpoint?

P.S. As a quick-fix I can suggest removing your project files from python_stubs directory.
0
Comment actions Permalink
I use debugging with a remote interpreter.

The project is setup in a virtualenv environment on a remote server (in my case emulated on my developer machine).  I am editing files on my local drive (which the remote machine has mapped to the virtualenv instance).  Pycharm knows about this as a Remote interpreter.

Yes, the file from python_stubs shows when I hit a breakpoint.  Occasionally when I rebuild my server instance I will get a message that says that it couldn't find the file requested and it suggests that I "Auto-detect", "Edit" my settings or "Download" the file.  I'm forced to use "Download" because neither of the other two options seem to change the situation.

Thanks.
0
Comment actions Permalink
Timothy, I think you should set path mapping in your run configuration /local/path/to/project => /vagrant/path/to/project
0
Comment actions Permalink
Yes, it is already set properly.  Could it be getting confused because my local path is Windows (and therefore uses backslashes) while the remote path is Linux?

Whenever I get the options to auto-detect (as mentioned above), it auto-detects the settings correctly, but even selecting the correctly linked file will not show it.  Instead it just re-prompts to "Auto-detect", "Edit" my settings or "Download".
0
Comment actions Permalink
Here's some images of my current settings.  Hopefully this will clear things up a bit.

run_dialog.png

interpreter.png
0
Comment actions Permalink
It should work on Windows.
0
Comment actions Permalink
Thanks, I'll try to reproduce the problem.
0
Comment actions Permalink
As a note, I noticed 2.6.3 came out.  I've tried it and still see the same issue with it as well.
0
Comment actions Permalink
Correction, it is working better but I still get instances where it pulls up bad code.  I'll see if I can give you more details.
0
Comment actions Permalink
Hi Timothy! I've created an issue http://youtrack.jetbrains.com/issue/PY-7944 regarding the problem, so you can provide more details there as well as voting to be notified about a progress.
0
Comment actions Permalink
Was any solution found for this issue please?

I'm having the same / similar issue as described here: http://forum.jetbrains.com/thread/PyCharm-1353
0

Please sign in to leave a comment.