PyCharm 2019.1.3 (Professional Edition) problem with sync when debugging remotely using ssh interpreter Follow
I'm trying to debug my project on a remote machine using ssh interpreter.
I was able to setup ssh interpreter and requested to map local repository to the deployment path on a remote server.
During setup a mirror directory was successfully created on a remote machine, I was also able to successfully connect to the remote ssh interpreter.
However, later when modifying local repository, "File/Save All", and "File/Synchronize", I found out that local changes were not pushed to the deployment path.
Please let me know if this is expected behavior. I expected PyCharm to sync local modifications in the deployment folder and then execute them using remote ssh interpreter.
Please sign in to leave a comment.
File > Synchronize loads changes from local disk. You need to use "Tools > Deployment", or right-click the project root/individual files and from the drop down menu select "Deployment > Download/Upload/Sync".
Thank you for your reply.
Indeed, "Tools > Deployment > Upload to" worked.
However, I am confused whether it's an expected workflow to do it manually. I see that the option "Tools > Deployment > Automatic upload (always)" is checked.
Please let me know.
The files should be uploaded automatically when you execute your code.
When I "Run" and "Debug" my code the sync doesn't occur.
Also make sure that local synchronization is enabled in "File | Settings/Preferences | Appearance & Behavior | System Settings".
Is your SSH interpreter configured properly?
If still not working, can you please provide your synchronization, deployment, and interpreter settings screenshots?
Andrey, the problem was that when I was setting "Upload changed files automatically to the default server" I didn't set the default deployment server.
Everything works now -- please close the ticket.
Thanks for your help!
I still don't understand what is the difference between "File > Synchronize" and "Tools > Deployment > Sync with Deployed to". Does it perform the same action now that I set the default deployment server?
File > Synchronize - synchronize in-memory content (what you see in the editor) with the file. It's different from "Save" because it reloads the file if there was any external changes.
Tools > Deployment > Sync - synchronize with the remote host.
Easy as that.
Got it, thank you, Andrey!
I have to say the whole PyCharm ssh remote development experience is a total pain in the ass... after setting up the interpreter and deployment config, everything is fine, but after shutting the VM down and continuing the next day, nothing will sync.
I find I constantly need to delete the deployment configuration and configure the remote interpreter again, and even then it's not guraranteed to work. After doing invalidate cache/ restart, it MAY work but also may not.
Remote dev experience with VS code is very smooth. They don't actually sync any local/remote files, but just use the remote filesystem, which does seem like a much more sensible approach (avoids the current issue, no conflicts etc.).
My PyCharm pro subscription is ending in May and I'm seriously considering switching to VS code, although the VS code debugging experience is not yet quite on par with PyCharm.
Does it not help to simply do [Deployment | Upload to...] after VM restart? Normally that should be enough.
That will upload only the current file that I'm working on (at least in my experience).
I have a similar problem with Heikki, in my case [Deployment| Upload to...] is grayed out. I need to remove and add the remote interpreter multiple times to make it work! It's frustrating.
Hello Paolo Rota,
Please feel free to report https://youtrack.jetbrains.com/issues/PY if the behaviour comes up again.
If it is useful, I am working under a vpn and I am editing a python package that I install on the remote interpreter using.
pip install -e .
I will try to reproduce it and report it in youtrack.
I have similar issues. Files in remote are synched, but debugger sees some old version of remote code. This is pain.