Problem copying directories using sftp

Advertisement

guest
Guest

Problem copying directories using sftp

Hello!

Copying directories recursively to our AIX-4.3.3 host with sftp consistently fails with an error relating to SSH_FXP_NAME (see below in the log).

This happens with both WinSCP 3.6.8 and 3.7.0 beta dated 2004-10-12 with both the Norton and the Explorer interface. The problem does not occur using SCP as the protocol. The problem occurs from several client machines.

The server uses the SSH protocol version 2 with aes encryption and compression. The file transer protocol is SFTP(v3). The AIX-box runs OpenSSH-3.9p1.

The problem does not occur using a RedHat Linux 9.0 box, i.e. this does not HAVE to be a WinSCP problem. However, creating directories on the AIX machine using Cygwin sftp works fine.

I hope somebody can help with this.

Best regards,

Bernt Guldbrandtsen

The log file says:

. Startup conversation with host finished.
. Copying 1 files/directories to remote directory "/h580/avl/bg/"
. PrTime: Yes; PrRO: Yes; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: Yes; Resume:
S (102400); CalcS: Yes; Mask: *.*
. TM: M; ExclM:
. AscM: *.*html; *.htm; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *
.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. File: "C:\Documents and Settings\bgu\Dokumenter\pdf"
. Trying to open directory "/h580/avl/bg/pdf/".
> Type: SSH_FXP_OPENDIR, Size: 27, Number: 2571
< Type: SSH_FXP_STATUS, Size: 29, Number: 2571
< Status/error code: 2, Message: 2571, Server: No such file, Language:
. Creating directory "/h580/avl/bg/pdf/".
. Canonifying: "/h580/avl/bg/pdf/"
. Getting real path for '/h580/avl/bg/pdf/'
> Type: SSH_FXP_REALPATH, Size: 28, Number: 3088
< Type: SSH_FXP_STATUS, Size: 24, Number: 3088
< Status/error code: 0
. Attempt to close connection due to fatal exception:
* Received SSH_FXP_NAME packet with zero or multiple records.
. Closing connection.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

Re: Problem copying directories using sftp

There is definitely bug in WinSCP handling the response to SSH_FXP_REALPATH request. The error it displays is non-sense.

However there seems to be greater bug on your server side. To SSH_FXP_REALPATH request the server must reply either SSH_FXP_NAME or, when error occures, with SSH_FXP_STATUS with reason of the failure. Your server replies SSH_FXP_STATUS with status "OK". It does not make sense and probably it violates the SFTP protocol specification.

I do not know how to solve this :-(
_________________
Martin Prikryl

Reply with quote

guest
Guest

Re: Problem copying directories using sftp

The problem has now been reported to the OpenSSH mailing list as well.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

Re: Problem copying directories using sftp

Let me know if they reply anything.
_________________
Martin Prikryl

Reply with quote

guest
Guest

Re: Problem copying directories using sftp

Now I've tried with WinSCP 3.7.1. The problem seems to have been solved with this version. At least I just sucessfully copied a directory recursively to the server that had the problem.

There has been no solution from the OpenSSH-list.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,074
Location:
Prague, Czechia

Re: Problem copying directories using sftp

guest wrote:

Now I've tried with WinSCP 3.7.1. The problem seems to have been solved with this version. At least I just sucessfully copied a directory recursively to the server that had the problem.

There has been no solution from the OpenSSH-list.
Something must have changed on the server as I have fixed WinSCP to display correct error message only.
_________________
Martin Prikryl

Reply with quote

setatakahashi
Joined:
Posts:
1
Location:
So Paulo, SP - Brazil

Re: Problem copying directories using sftp

martin wrote:

guest wrote:

Now I've tried with WinSCP 3.7.1. The problem seems to have been solved with this version. At least I just sucessfully copied a directory recursively to the server that had the problem.

There has been no solution from the OpenSSH-list.
Something must have changed on the server as I have fixed WinSCP to display correct error message only.

The problem "Received SSH_FXP_NAME packet with zero or multiple records" was manifested here and here what I did to solve it.

First I login to the machine with the ssh and use a regular user (root doesn't count).
I entered the directory where the error is ocurring and listed it using ls -la. Check the current directory and up one level (. and ..). If it appear as ./.. Permission denied, do the follwoing:
1. force the filesystem to umount(umount -f /filesystem).
2. Check the permissions of the mount point.
3. Mount it.

I think this error is due to a chown command while the directory was being used by any PID.

This problem manifested while using WinSCP. FileZilla wasn't presenting this behavior.
_________________
--
Emerson Seiti Takahashi
So Paulo, SP - Brazil

Reply with quote

Advertisement

You can post new topics in this forum