Failed to copy: Update Create failed:

What is the problem you are having with rclone?

With setting either or both --sftp-set-modtime=false & --no-update-modtime set we still get
Failed to copy: Update SetModTime failed: SetModTime stat failed: stat failed:

What is your rclone version (output from rclone version)

rclone version

rclone v1.54.0

  • os/arch: linux/amd64
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Centos - 64bit

Which cloud storage system are you using? (eg Google Drive)

AWS

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone -vvv --config=tmp.conf --transfers=1 --ignore-size --sftp-set-modtime=false --no-update-modtime move s3:folder/client upload:/

The rclone config contents with secrets removed.

[s3]
type = s3
env_auth = true
region = region
location_constraint = region
server_side_encryption = AES256

[upload]
type = sftp
host = host_ip
user = user
pass = password
disable_hashcheck = true

A log from the command with the -vv flag

2021/02/23 08:52:44 DEBUG : rclone: Version "v1.54.0" starting with parameters ["rclone" "-vvv" "--config=tmp.conf" "--transfers=1" "--ignore-size" "--sftp-set-modtime=false" "--no-update-modtime" "move" "s3:folder/client" "upload:/"]
2021/02/23 08:52:44 DEBUG : Using config file from "/jenkins/workspace/xx/xxx/tmp.conf"
2021/02/23 08:52:44 DEBUG : Creating backend with remote "s3:folder/client"
2021/02/23 08:52:44 DEBUG : Creating backend with remote "upload:/"
2021/02/23 08:52:44 DEBUG : sftp://client@hisftp.com:22//: New connection IP:port->IP:Port to "SSH-2.0-AWS_SFTP_1.0"
2021/02/23 08:52:46 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/23 08:52:46 ERROR : ftp_test.txt: Failed to copy: Update SetModTime failed: SetModTime stat failed: stat failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : ftp_test.txt: Not deleting source as copy failed: Update SetModTime failed: SetModTime stat failed: stat failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : Attempt 1/3 failed with 1 errors and: Update SetModTime failed: SetModTime stat failed: stat failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/23 08:52:46 DEBUG : ftp_test.txt: Modification times differ by 44s: 2021-02-25 08:52:03 +0000 UTC, 2021-02-25 08:52:47 +0000 UTC
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/23 08:52:46 ERROR : ftp_test.txt: Failed to copy: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : ftp_test.txt: Not deleting source as copy failed: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : Attempt 2/3 failed with 1 errors and: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/23 08:52:46 DEBUG : ftp_test.txt: Modification times differ by 44s: 2021-02-25 08:52:03 +0000 UTC, 2021-02-25 08:52:47 +0000 UTC
2021/02/23 08:52:46 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/23 08:52:46 ERROR : ftp_test.txt: Failed to copy: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : ftp_test.txt: Not deleting source as copy failed: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/23 08:52:46 ERROR : Attempt 3/3 failed with 1 errors and: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)

This looks like rclone skipped setting the modification time, but then tried to do a stat to read the modification time and got permission denied from the other end.

Looking at the code, rclone isn't trying to set the modtime but it is trying to read it.

Which SFTP server is it?

You have some unusual flags here - why are you using these?

1 Like

Hello Nick,

Each of the 3 settings is trial to not get the error.
Please suggest a cmd with minimal switches to set and get the job done without error.
I have been trying different setting and getting similar errors e.g.

2021/02/25 07:33:20 DEBUG : rclone: Version "v1.54.0" starting with parameters ["rclone" "-vv" "--config=tmp.conf" "--transfers=1" "--sftp-set-modtime=false" "move" "s3:folder/client" "upload:/" "--no-traverse"]
2021/02/25 07:33:20 DEBUG : "/jenkins/workspace/xx/xxx/tmp.conf"
2021/02/25 07:33:20 DEBUG : Creating backend with remote "s3:folder/client"
2021/02/25 07:33:21 DEBUG : Creating backend with remote "upload:/"
2021/02/25 07:33:21 DEBUG : sftp://client@hisftp.com:22//: New connection 100.69.55.132:41108->54.72.23.204:22 to "SSH-2.0-AWS_SFTP_1.0"
2021/02/25 07:33:22 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/25 07:33:22 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/25 07:33:22 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/25 07:33:22 ERROR : ftp_test.txt: Failed to copy: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:22 ERROR : ftp_test.txt: Not deleting source as copy failed: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:22 ERROR : Attempt 1/3 failed with 1 errors and: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:22 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/25 07:33:22 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/25 07:33:22 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/25 07:33:23 ERROR : ftp_test.txt: Failed to copy: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 ERROR : ftp_test.txt: Not deleting source as copy failed: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 ERROR : Attempt 2/3 failed with 1 errors and: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 ERROR : : Entry doesn't belong in directory "" (same as directory) - ignoring
2021/02/25 07:33:23 DEBUG : sftp://client@hisftp.com:22//: Waiting for checks to finish
2021/02/25 07:33:23 DEBUG : sftp://client@hisftp.com:22//: Waiting for transfers to finish
2021/02/25 07:33:23 ERROR : ftp_test.txt: Failed to copy: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 ERROR : ftp_test.txt: Not deleting source as copy failed: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 ERROR : Attempt 3/3 failed with 1 errors and: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)
2021/02/25 07:33:23 INFO  :
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Checks:                 3 / 3, 100%
Elapsed time:         2.1s

2021/02/25 07:33:23 DEBUG : 14 go routines active
2021/02/25 07:33:23 Failed to move: Update Create failed: sftp: "Access denied" (SSH_FX_PERMISSION_DENIED)

That will be trying to use the root directory of the SFTP server - try just upload:

Hello Nick,

This was resolved after the client decided to give us read access to the files.
Thanks for the pointers.

Shirish

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.