Versioning SFTP Error

Get help for specific problems
Posts: 7
Joined: 10 Nov 2017

devonuto

This used to work, so not sure what the issue is. But whenever i get a new version of a file, and I have versioning turned on, I'm getting this error now:
14:35:27    Error    Cannot move file
"sftp://192.168.1.17/backups/Steve/DEVO/Data/D/Documents/Visual Studio 2015/Settings/CurrentSettings.vssettings" to
"sftp://192.168.1.17/backups/Steve/DEVO/Data/Versions/Documents/Visual Studio 2015/Settings/CurrentSettings.vssettings".
LIBSSH2_ERROR_SFTP_PROTOCOL: SFTP Protocol Error - LIBSSH2_FX_NO_SUCH_FILE [libssh2_sftp_rename_ex]
The file definitely exists, seems to be some sort of issue with the SFTP Move command not working. Any ideas?

Syncing between a Windows 10 machine, to an Ubuntu 16.04 LTS machine.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

There is probably some intermediate folder missing somewhere. But FFS should create those automatically. Are you able to reproduce the issue or have steps to reproduce this in general, or have a remote machine for testing that shows this error?
Posts: 7
Joined: 10 Nov 2017

devonuto

There is probably some intermediate folder missing somewhere. But FFS should create those automatically. Are you able to reproduce the issue or have steps to reproduce this in general, or have a remote machine for testing that shows this error? Zenju, 11 Nov 2017, 21:28
It does it for any or all files when trying to move it to versioning when creating a new version of any file.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Do you have steps that reproduce this issue? (I'm not able to trigger it in my tests)
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Also here's a beta version which *might* give a better/different error message:
http://www.mediafire.com/file/kkavyz2x3zdn70a/FreeFileSync_9.6_%5BBeta%5D_Windows_Setup.exe
Posts: 7
Joined: 10 Nov 2017

devonuto

Do you have steps that reproduce this issue? (I'm not able to trigger it in my tests) Zenju, 12 Nov 2017, 10:26
Change a file, run sync. That file will be unable to move the original file to the version folder, so the new version is not copied across.

It's probably due to whatever process is being called in sftp does not have the correct permissions, or the version of sftp setup on the server isn't compatible. But I need to know what requirements there are.

I will try the beta version.
Posts: 7
Joined: 10 Nov 2017

devonuto

Also here's a beta version which *might* give a better/different error message:
http://www.mediafire.com/file/kkavyz2x3zdn70a/FreeFileSync_9.6_%5BBeta%5D_Windows_Setup.exe Zenju, 12 Nov 2017, 10:57
It's giving a different error:

07:25:24 Error Unable to connect to "192.168.1.17".
LIBSSH2_ERROR_AUTHENTICATION_FAILED: Authentication failed (username/password) [libssh2_userauth_password]

But why only get this error when it's moving files, and not copying new files across?

Authentication also works when doing a compare of the directories.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

When an SFTP error occurs, FFS may consider the session faulty and try to establish a new connection for the next request. This is when LIBSSH2_ERROR_AUTHENTICATION_FAILED occurs. This doesn't make much sense, unless maybe you have a limit on the number of parallel SFTP sessions allowed?
Posts: 7
Joined: 10 Nov 2017

devonuto

When an SFTP error occurs, FFS may consider the session faulty and try to establish a new connection for the next request. This is when LIBSSH2_ERROR_AUTHENTICATION_FAILED occurs. This doesn't make much sense, unless maybe you have a limit on the number of parallel SFTP sessions allowed? Zenju, 14 Nov 2017, 17:23
I don't believe so, this is everything in my sshd_config:

# What ports, IPs and protocols we listen for
Port 22
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

You have not set:
PasswordAuthentication yes
Maybe this is the problem. In my tests with a a local Ubuntu-hosted OpenSSH server, versioning works fine.
Posts: 15
Joined: 6 Feb 2016

Squashed

I'm experiencing the same problem with versioning. Used to work ok. I moved these files from one folder to another. Those in the target folder were backed up. But FFS can't move the original to the version folder on the nas. Windows 10 machine mirrored to Synolgy nas. FFS 9.5. Error message in the log:
[12:57:08 PM]  Info:  Moving file "W:\Users\???\My Documents Archive & Non-Changing\Henry's Family Tree\Images\CaiusCleoDariusJanet250801.jpg" to "sftp://192.168.1.33/Version History/OfficeDesktop/Users/???/My Documents Archive & Non-Changing"
[12:57:09 PM]  Error:  Cannot write file "sftp://192.168.1.33/Version History/OfficeDesktop/Users/???/My Documents Archive & Non-Changing/Henry's Family Tree/Images/CaiusCleoDariusJanet250801.jpg 2017-11-18 125707.jpg".
                       LIBSSH2_ERROR_SFTP_PROTOCOL: Failed opening remote file - LIBSSH2_FX_NO_SUCH_FILE [libssh2_sftp_open]
Posts: 7
Joined: 10 Nov 2017

devonuto

You have not set:
PasswordAuthentication yes
Maybe this is the problem. In my tests with a a local Ubuntu-hosted OpenSSH server, versioning works fine. Zenju, 16 Nov 2017, 14:09
I have set PasswordAuthentication yes, and have turned Versioning back on. Will test.
Posts: 15
Joined: 6 Feb 2016

Squashed

Update: in my case, the folder existed in the Version History tree as "IMAGES", that is all uppercase, and the file that FFS was trying to move was in folder "Images", only first letter is a uppercase. When I changed the Version History folder to "Images", FFS completed normally.

Assume this is a bug?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Update: in my case, the folder existed in the Version History tree as "IMAGES", that is all uppercase, and the file that FFS was trying to move was in folder "Images", only first letter is a uppercase. When I changed the Version History folder to "Images", FFS completed normally.

Assume this is a bug? Squashed, 24 Nov 2017, 21:06
Interesting! This looks like a todo for FFS.
Posts: 7
Joined: 10 Nov 2017

devonuto

You have not set:
PasswordAuthentication yes
Maybe this is the problem. In my tests with a a local Ubuntu-hosted OpenSSH server, versioning works fine. Zenju, 16 Nov 2017, 14:09
Same problem still exists:
LIBSSH2_ERROR_AUTHENTICATION_FAILED: Authentication failed (username/password) [libssh2_userauth_password]
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

I've implemented a fix for LIBSSH2_ERROR_AUTHENTICATION_FAILED.
viewtopic.php?t=5154#p17748

I'll address the second issue with versioning and case-sensitivity separately.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Update: in my case, the folder existed in the Version History tree as "IMAGES", that is all uppercase, and the file that FFS was trying to move was in folder "Images", only first letter is a uppercase. When I changed the Version History folder to "Images", FFS completed normally.

Assume this is a bug? Squashed, 24 Nov 2017, 21:06
This issue should also be fixed with the improved path handling as of FreeFileSync 10.6.