fioan89 / sourcesync

A powerful plugin for performing one-way file synchronization for Intellij Idea and Pycharm projects
Other
89 stars 36 forks source link

[Pro] SCP upload failed #194

Closed Danyhel closed 5 months ago

Danyhel commented 5 months ago

One of my Sourcesync configurations for SCP is unable to upload / sync files with below error.

Failed to upload C:/LOCAL/PATH/TO/THE/SCRIPT to /REMOTE/PATH/TO/SCRIPT on REMOTE_HOSTNAME failed. Reason: DefaultOpenFuture[ChannelExec[id=0, recipient=-1]-ClientSessionImpl[USERNAME@REMOTE_HOSTNAME/IP:PORT]]: Failed to get operation result within specified timeout: 30000 msec

I'm using Source Synchronizer Pro version plugin within IntelliJ Idea Ultimate.

The exactly same configuration within IntelliJ in-build tool for SSH connection is working. With that configuration I'm able to connect and work within IntelliJ terminal on the remote server with no issue.

I'm using Key pair authentication type and port 22 for connecting to the remote server.

Kind Regards Daniel

fioan89 commented 5 months ago

Hello @Danyhel and thank you for your feedback.

A couple of questions:

Danyhel commented 5 months ago

Hi @fioan89,

log from today attached. You should be able to find there three different scenarios -

  1. I tried to update the file and sync it to other server (configuration AAA | DCG menu) - working OK
  2. I tried to sync the file via SourceSync SCP (DCGNAS2 | Backup scp) - NOT working
  3. I tried to sync the file via SourceSync SSH (DCGNAS2 | Backup ssh) - NOT working

The same configuration with the same credentials and using the same private key is working in other IntelliJ tool and also in WinSCP.

Unfortunately I do not have the password to be able to log there directly with it, only using the private key.

Let me know if any other files / diagnostic is needed.

Kind Regards Daniel

idea.log IntelliJVersion.txt

fioan89 commented 5 months ago

@Danyhel from the logs it seems the key exchange fails because of EdDSAkeys which are not properly supported by the plugin. Can you use RSA keys for authentication until I find a fix for this issue?

Danyhel commented 5 months ago

Hi @fioan89 , I saw that in the log but it's weird as I'm using ssh-rsa key. Nevertheless I tried several different types of keys and I was changing it on both sides, on the remote server and in the plugin configuration, but the log is still showing the same line and the same EC key. No matter what I'm changing there is still the same message -

WARN - org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at HOSTNAME/IP:22 presented unverified EC key: SHA256:TjQeSQ8d1S9z3G+MMdyPoUrhCFbowN1jQwDEZKXCchE

Still the same key starting with TjQeSQ ...

Couldn't the issue be caused by proxy and / or VPN. On our company laptops we are using ZScaler ...

fioan89 commented 5 months ago

Well it can be an option I can look into later. Right now I'm more concerned about this line:

2024-03-15 07:48:11,895 [ 136974]   WARN - org.apache.sshd.client.session.ClientConnectionService - globalRequest(ClientConnectionService[ClientSessionImpl[REPLACED_USERNAME@REPLACED_HOSTNAME/REPLACED_IP:22]])[hostkeys-00@openssh.com, want-reply=false] failed (SshException) to process: key spec not recognised: class net.i2p.crypto.eddsa.spec.EdDSAPublicKeySpec

From my local tests with eddsa keys, I can reproduce similar failure messages. I'm saying "similar" because I expected here a full stack trace, which I get locally, but not in your log file. I find that weird.

Now after some research it seems IntelliJ already bundles an eddsa implementation which is conflicting with the one I've packaged in Sourcesync Pro. I've fixed that and hopefully Monday or Tuesday version 1.0.4 is approved by Jetbrains.

If it's not possible to wait until next week to try the new version, then I would need again the logs but with debug enabled. In order to do that you will have to open Help | Diagnostic Tools | Debug Log Settings... and add the following lines:

   org.apache.sshd:all
   #org.wavescale.sourcesync:all

Then click OK and try to reproduce the problem, and don't forget to sanitize/replace sensitive info :).

Your .ssh/config can also be helpful, and it's worth double checking that the path to the private key selected for your active sync configuration points to an rsa/eddsa key.

Danyhel commented 5 months ago

Hi @fioan89! No worries, I'm in no hurry and I have a way how to put the updates on the remote server in other way in the meantime :)

So I'll wait for now for the new version and let's see. If more investigation will be needed I will provide the diagnostic files.

Thanks a lot for your time and effort spent on this and besides this issue I find this plugin very useful!

fioan89 commented 5 months ago

@Danyhel Sourcesync Pro 1.0.4 was approved by Jetbrains during the weekend. It should improve the support for EdDSA keys.

Danyjel commented 5 months ago

Hi @fioan89 !

Goods news, it's working now :)

When I tried the plugin update you provided two days ago with the old configuration it was still not working.

The message in the log was still the same but I'm not sure if that was the main issue.

The configuration for connecting to our triple A server which was working even before there was the same warning in the log and I was able to connect. But for that connection I'm using username and password authentication so no issue with the key.

But then I was facing some other connectivity issue somewhere else and for that I had to create new key pair files and had to use the private key with .pem extension.

And with that newly generated public and private key also the SourceSync plugin started to work.

So If you would like to get some diagnostic data for the issue with other private key I was using before I can provide the files.

But from my side the issue I had is now resolved and this can be closed.

Up to you :)

Thanks a lot once again for your time and effort spent on this.

Daniel

fioan89 commented 5 months ago

That's good news @Danyhel . Extra diagnostic data could definitely help to improve the plugin, but I think right now it would be more valuable for me if you could leave a positive feedback here, and/or if you have any ideas or feature suggestions that might improve your workflows.

fioan89 commented 5 months ago

P.S: also thank you for your time and effort.

Danyjel commented 5 months ago

That's good news @Danyhel . Extra diagnostic data could definitely help to improve the plugin, but I think right now it would be more valuable for me if you could leave a positive feedback here, and/or if you have any ideas or feature suggestions that might improve your workflows.

Sure thing, feedback submitted.

fioan89 commented 5 months ago

Much appreciated.