Same-Sever Copy/Move on Debian 12 Broken

Advertisement

Pollyx
Joined:
Posts:
6

Same-Sever Copy/Move on Debian 12 Broken

In Debian 12 overwriting files and directories with drag and drop doesn't work any more with WinSCP. This works on all other Linux distros that I have tried, only Debian 12 seems to be affected.

Steps to reproduce:
Create an SFTP (SSH) Session with WinSCP, mark any file or directory and copy it (by pressing the Shift key) to any other folder on the same server. This first copy procedure succeeds. Then repeat this step and try to overwrite the previously copied files. WinSCP now throws a generic "Error 4" message that can only be aborted.
The server console shows an error similar to:
sftp-server[1271334]: error: process_extended_copy_data: read failed: Is a directory
Copying and overwriting from another location is possible, the error occurs only when source and destination are on the same server and within the same connection.

What I have tried
This malfunction occurs repeatedly and without exception on every server that is either upgraded to Debian 12 or has been installed with Debian 12.
My sshd-configuration is pretty much standard, except that I use password authentication. It is independent of the user account used.
In sshd.conf I tried both the internal and the external sftp subsystem, both behaved identically. However, If I don't use any sftp subsystem, the overwriting is working again. So I am puzzled: I expected that WinSCP would not be able to work at all without SFTP and without an FTP fallback available.So I acm curious, how does WinSCP manag file operations without SFTP? Is it using the older SCP protocol instead?

Another observation: When copying or moving a file does work, the original file creation date gets lost, it will be set to the current data. This worked on all Debian versions up to Debian 11, this malfunction was introduced with Debian 12.

It appears that the behavior of SFTP must have changed in Debian 12 but I can't find any hint in the change notes.

Any ideas how to fix this?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,643
Location:
Prague, Czechia

Re: Same-Sever Copy/Move on Debian 12 Broken

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Pollyx
Joined:
Posts:
6

Re: Same-Sever Copy/Move on Debian 12 Broken

Attached is a logfile. I have copied a testfile to another location, which succeeds. When copied again, it fails to overwrite the previous copy.

Reply with quote

Pollyx
Joined:
Posts:
6

I tried for hours to generate a SFTP log on Debian 12, but without luck. None of the numerous internet tips regarding this stubborn sftp-server logging seems to work.
sshd_config:
Subsystem   sftp   /usr/lib/openssh/sftp-server -f LOCAL4 -l DEBUG3
rsyslog.conf:
LOCAL4.*      -/var/log/sftp.log
doesn't create any log content.
Sorry, but unless you have some helpful tip I am giving up generating an sftp log.
Enclosed is the sshd log.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Sorry for being unclear. I've meant WinSCP log, showing successful operation against Debian 11 (equivalent to your previous WinSCP log against Debian 12).

Reply with quote

Pollyx
Joined:
Posts:
6

OK, here you go. During the log session I copy a testfile to /tmp, then I copy it again causing to overwrite the previous file. This works fine on Debian 11 including the file modification date which is preserved.
  • winscp_Debian11.log (184.95 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar

With Debian 11, WinSCP uses cp -p -r -f -T shell command. The Debian 12 log is not complete. So I only guess that you have new version of OpenSSH there which supports SFTP remote copy extension. WinSCP makes use of that. But the implementation is indeed inconsistent, so it does not support overwrites. I'll look into it.

Reply with quote

Pollyx

Hi Martin,
can we hope that this issue can be resolved in the near future? If not, would it be possible to temporarily work around the issue by disabling the broken remote copy feature in WinSCP? On a quick check, none of the configuration options that I tried solved the issue.

Reply with quote

Advertisement

ro78
Guest

Hello,

I have the same issue on a recently installed Debian 12 with WinSCP.
Trying to duplicate a folder produces this error:
2023-09-20T17:50:10.018961+02:00 rbx sftp-server[158122]: error: process_extended_copy_data: read failed: Is a directory
I tried to duplicate yara folder in yara2 folder that doesn't exist yet.
If I refresh the parent folder, I see a yara2 empty file.

Error displayed in WinSCP:
Erreur générale
Code d'erreur : 4
Message d'erreur du serveur : Failure

Les raisons courante pour l'erreur code 4 sont:
- Changement de nom de fichier avec un déjà existant.
- Création d'un dossier déjà existant.
- Déplacement de fichier distant vers un disque fichiers système (disque dur) différent.
- Envoyer un fichier vers un disque fichier système (disque dur) plein.
- Dépassement du quota disque utilisateur.
Romain

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum