Operating System - HP-UX
1830223 Members
1532 Online
109999 Solutions
New Discussion

Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

 
rekha123
New Member

Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

I have switched my native::sftp connection to native::sftp::foreign. For some IPs the transfer is ok. I am able to transfer files but for some IPs I am recieving the following error:-
ERROR: (Network failure / Write permission denied?) Fail to transfer test1.xml
This file is getting transferred with normal native-sftp.
Please let me know if anyone can provide some information on this.
5 REPLIES 5
Johnson Punniyalingam
Honored Contributor

Re: Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

Above error, Could be many reason

1. Could be restriction on both source and target.
(deny sftp for other networks segments)

2. Write permission denied

Anynomus ftp account also can show above error (becoz only particular ftpgroup can only write )
Problems are common to all, but attitude makes the difference
rekha123
New Member

Re: Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

After connecting to the box through native sftp foreign i am recieving the following error
Couldn't setstat remote file (fsetstat): Permission denied
Do you have an idea of the above error? Why am i not getting the error when i connect through native sftp?
Johnson Punniyalingam
Honored Contributor

Re: Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

You need check your "pam_configuration:

Couldn't setstat remote file (fsetstat): The requested operation
cannot be performed because there is a file transfer in progress.

Ans: Try passing the late_set_perm option to the put method:

$sftp->put($local, $remote, late_set_perm => 1)
or die "unable to transfer file: " . $sftp->error;

Some servers do not support the fsetstat method on open file handles. Setting this flag allows to delay that operation until the file has been completely transferred and the remote file handle closed.

Send me a bug report containing a dump of your $sftp object so I can add code for your particular server software to activate the work-around automatically.

HTH,

Johnson
Problems are common to all, but attitude makes the difference
rekha123
New Member

Re: Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

Hi Johnson

i tried using $sftp->put($local, $remote, late_set_perm => 1) but it also did not worked.
It is giving the below error.
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
debug1: Reading configuration data /home/dmd_batch/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be trusted.
ssh: edrops.musicnet.com : Name or service not known
when i connect to the server through normal sftp it creates the directory and transfer the file..
but with this new sftp::foreign it is not creating directory also.
Please find my code/script attached and help me in this regard.
Bobby_Jacob
New Member

Re: Native::SFTP::Foreign ERROR: (Network failure / Write permission denied?) Fail to transfer

Thanks a lot Johnson. It solved my issue