[Solved]Pycharm remote debugging local file not updating
Tried to restart PyCharm and everything's alright.
-----
Hi, I'm using Pycharm 2016.3 Professional edition's remote debugging. However, something weird happened.
After I modified local files and upload to remote servers, I tried to remote debugging using the remote interpreter. But when I stepped into other function inside other files of my project, I found that the files were located at local path such as ~/.PyCharm2016.3/system/remote_sources/-1117781397/-12687924/path/to/my/file but it was not updated to the newest.
To make sure I did sync files to my remote server, I ssh to the remote server and make sure that the files have changed correctly.
Also, I tried to use the remote interpreter to run my code, whose result was correct which differed from what using remote debug.
So I want to know is there something wrong or do I have a method to update local caches of remote files? Please forgive my poor English and I am looking forward to some help.
请先登录再写评论。
Hello Sergey Karpov
I did it on Request #2430827, don't hesitate if you need more informations.
Thank's !
Bbc-abc Did you create a ticket for this issue, I also have an issue in 2020.1 where the debugger is using an old cached version of the files that are not updated. I can see that docker-compose is refreshing the files fine but the Pycharm debugger is caching the files at the time docker-compose last built.
Please post any valid tickets.
Maxime Renaud What is #2430827? Have you filed a new issue?
This problem still exists with 2020.1.4 Professional!
This is crazy annoying. Resetting the interpreter helps only for a microsecond, after one run it is back to the same old problem of debugging old cached files.
Hello,
Regrettably, there is a bug that has not been fixed yet, please see https://youtrack.jetbrains.com/issue/PY-39396 try the workaround provided and vote for the issue to increase its priority.
This problem still exists with 2020.2Professional!
This is crazy annoying. Resetting the interpreter helps only for a microsecond, after one run it is back to the same old problem of debugging old cached files.
PyCharm 2020.3.3 (Professional Edition)
Build #PY-203.7148.72, built on January 26, 2021
Still happening; trying to debug Python under WSL, which requires the remote feature (and therefore the Professional Edition) is yielding very confusing experiences with the breakpoints of the up-to-date file, but the source of the out-of-date file.
Visual Studio Code (with WSL remote and WSL:Ubuntu extensions) worked out of the box with no additional configuration.
PyCharm 2021.1 (Professional Edition)
Build #PY-211.6693.115, built on April 6, 2021
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Linux 5.8.0-50-generic
(0.2.144.3766-211)
Current Desktop: ubuntu:GNOME
Im not one to usually complain, I love everything else about this product but this is STILL happening and every subsequent update is making it worse! I have been putting up with it each version by simply exiting the incorrect cached JavaScript file and continuing to work but as of this most recent version the IDE editing window will bring up the incorrect cached copy of the JavaScript file (as it have for several years now) where i have placed the breakpoint but NOW it crashes the entire editing window meaning I have to completely quit and restart PyCharm. I have tried every fix on this thread and I am yet to see a competent answer or setting change that stops the IDE from bringing up this cached file. Someone please explain this and make it stop happening.
I have the same issue with Python debugging in Pycharm 2021.1 :(.
I'm facing the same issue in run / debug mode! when changing branch / pull code from git the remote files are not been updated, they are updated only by manually changing to other interpreter, then replacing back to the old one and performing complete upload & sync!
This is a major error for lots of developers who work on servers! it seems like the problem exists from 2017 and have not been addressed yet!
Antonina Belianskaya Sergey Karpov
Why is this marked completed? I am facing this same issue in 2022. It's extremely annoying that remote debugging is not picking up changes from local files but uses remote_sources
Yup, I already reported this problem here years ago, and it's still not solved at all. No idea why it says "solved", it simply isn't - nothing ever changed for me at all. I'm working on Windows 10, using a remote server on Ubuntu 18.
This is definitely not solved at ALL. Does who marked this issue as solved?
I'm using this tool as DCC script support, and local remote debugging is a lot easier than before, but this issue make everything messy.
Jooyounglee93 Here's a related issue https://youtrack.jetbrains.com/issue/PY-49805 (currently open)
I would appreciate if you post the steps to reproduce the issue, starting from creating a minimal project. Unfortunately, it appeared to be not very easy to reproduce the issue in the test environment. And, the absence of clear steps is what's holding this issue from resolving, I think.
Okay, I will describe just as what I did.
Lucas St.
You can manually remove the "remotue_sources" directory from the system directory to force PyCharm to update them. You can also e.g. create a shell script to clean this directory, add it to PyCharm as an external tool, and assign a shortcut for it. Then invoke "Rescan available python modules" (also can be assigned to a shortcut). I understand this is a quirky workaround and will cause a full rebuilding of skeletons, which may take some time.
>I just even saw, you triaged it as "Reproduced". So you are contradicting yourself...
In my comment I described the steps to reproduce the issue, but later noted my test was flawed. I admit that I missed/forgot about Mikhail's comment on the new implementation. We are actively testing this feature now and according to the current roadmap, planning to enable it in 2022.1
I have deleted (or moved) it previously. It did not help.
This is actually what causes the issue.
If you delete the remote sources, they are still in listed in some index, but the files are missing.
PyCharm then does not redownload because they are still in the index.
I think the index is one of these files (I grepped them):
index/filenameindex/FilenameIndex.storage.keystream
index/filenameindex/FilenameIndex_inputs.values
caches/names.dat.keystream
But I was not brave enough to delete them yet.
That's weird. In my case, removing the remote_sources and reopening the project had always completely resolved any inconsistencies between local and remote libraries. I will look into those indexes to get more info on how to clear them.
Removing remote_sources is working for me as is selecting another interpreter and switching back to my remote one. It is however unworkable to have to do this? Has a permanent fix been identified?
I am running on Ubuntu 21.04 and running on PyCharm 2022.1 Professional.
Similar issue.
I am working with interpreter on WSL (Ubuntu), project files located on WSL as well.
Debugger works fine until Pycharm (2022.2) tries to open a module installed via pip (all libraries on WSL).
Python 3.9, libraries in /home/<username>/.local/lib/python3.9/site-packages
Vlad K
Could you please submit a bug report to https://youtrack.jetbrains.com with the steps to reproduce the issue, the expected and actual results?
Andrey Resler, done https://youtrack.jetbrains.com/issue/PY-55800/Debugger-wont-do-automapping-with-remote-files-on-WSL
Andrey Resler
still have this same problem, on macOS.
Should I submit a bug report?
If you are having the same problem in PyCharm 2022.3 or newer, please submit another ticket to https://youtrack.jetbrains.com/issues/PY and provide steps for reproducing the problem.
STILL unsolved, PyCharm 2023.1.4, remote_sources are not updated properly, bad bad bad
The remote debug feature is totally broken in version PyCharm 2024.3 (Professional Edition). It fails for the simplest case of creating a new project with a single hello_world.py module and attempting to run it remotely. The error message from is:
/home/me/venv/scratch/bin/python /tmp/E5inVFGzGA/hello_world.py
/home/me/venv/scratch/bin/python: can't open file '/tmp/E5inVFGzGA/hello_world.py': [Errno 2] No such file or directoryProcess finished with exit code 2
The directory
/tmp/E5inVFGzGA/
is created on the remote system, but the python file is not copied to it.[me@host-dev2 ~]$ ls -a /tmp/E5inVFGzGA
. ..
[me@host-dev2 ~]$
How was this ever shipped?
Hi @Eleog, this issue requires thorough investigation. Please create an issue on YouTrack using this link: https://youtrack.jetbrains.com/issues/PY and attach all relevant information for quicker resolution.