PyCharm 2019.1.3 (Professional Edition) problem with sync when debugging remotely using ssh interpreter

Hello,

 

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.

 

Thank you!

11 comments
Comment actions Permalink

Hi,

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".

0
Comment actions Permalink

Hi Andrey,

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.

Thank you!

0
Comment actions Permalink

The files should be uploaded automatically when you execute your code.

0
Comment actions Permalink

When I "Run" and "Debug" my code the sync doesn't occur.

0
Comment actions Permalink

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?

0
Comment actions Permalink

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!

P.S.

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?

0
Comment actions Permalink

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.

0
Comment actions Permalink

Got it, thank you, Andrey!

0
Comment actions Permalink

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.

0
Comment actions Permalink

Does it not help to simply do [Deployment | Upload to...] after VM restart? Normally that should be enough.

0
Comment actions Permalink

That will upload only the current file that I'm working on (at least in my experience).

0

Please sign in to leave a comment.