Rclone "touch" command fails since 1.57.0

Hello rclone Community!

What is the problem you are having with rclone?

Something changed with rclone 1.57.0 so that the rclone "touch" command is not usable for me anymore.
It all worked fine, and still does when I run rclone with 1.56.2, but it fails with newer versions.
I see that the --recursive option has been added to the "touch" command with 1.57.0, so maybe it is related to this addition?

Background: I use the "touch" command to test if the remote server is set up correctly. So I "touch" a new file that does not exist on the remote server and delete the file after success.

The errors I get with type FTP:

2022/01/26 12:47:06 ERROR : Attempt 1/1 failed with 1 errors and: failed to touch (create): update stor: 550 /files/ftp: Not a regular file
2022/01/26 12:47:06 Failed to touch: failed to touch (create): update stor: 550 /files/ftp: Not a regular file

The errors I get with type SFTP:

2022/01/26 13:01:26 ERROR : Attempt 1/1 failed with 1 errors and: failed to touch (create): Update Create failed: sftp: "Failure" (SSH_FX_FAILURE)
2022/01/26 13:01:26 Failed to touch: failed to touch (create): Update Create failed: sftp: "Failure" (SSH_FX_FAILURE)

What is your rclone version (output from rclone version)

rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-94-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none

I have also tested the latest Beta, but without success:

rclone v1.58.0-beta.5960.a667e03fc
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-94-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.6
- go/linking: static
- go/tags: none

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

Ubuntu 20.04 - 64 bit

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

I have tested FTP, SFTP, Dropbox -> All report the same: "failed to touch"

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

With FTP:

rclone --config '/tmp/rclone-ftp.config' --retries 1 touch 'rclone-storage:/files/ftp'

-> Result: Nothing happens on the remote side. An rclone error message is shown (see above).

With SFTP:

rclone --config '/tmp/rclone-sftp.config' --retries 1 touch 'rclone-storage:/files/sftp'

-> Result: On the remote side, a new directory "sftp" is created in "/files/" (??? Why a directory ???). An rclone error message is shown (see above).

The rclone config contents with secrets removed.

[rclone-storage]
type = ftp
host = dev23.keymachine.de
user = test
pass = <secret-pass>
explicit_tls = true
[rclone-storage]
type = sftp
host = dev23.keymachine.de
user = test
pass = <secret-pass>
md5sum_command = none
sha1sum_command = none

A log from the command with the -vv flag

With FTP:

2022/01/26 12:47:28 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "--config" "/tmp/rclone-ftp.config" "-vv" "--retries" "1" "touch" "rclone-storage:/files/ftp"]
2022/01/26 12:47:28 DEBUG : Creating backend with remote "rclone-storage:/files/ftp"
2022/01/26 12:47:28 DEBUG : Using config file from "/tmp/rclone-ftp.config"
2022/01/26 12:47:28 DEBUG : ftp://dev23.keymachine.de:21/files/ftp: Connecting to FTP server
2022/01/26 12:47:28 DEBUG : Touch time 2022-01-26 12:47:28.42150678 +0100 CET m=+0.361783329
2022/01/26 12:47:28 DEBUG : ftp://dev23.keymachine.de:21/files/ftp: Touching (creating)
2022/01/26 12:47:29 DEBUG : ftp://dev23.keymachine.de:21/files/ftp: Connecting to FTP server
2022/01/26 12:47:29 DEBUG : : Removed after failed upload: 550 /files/ftp: Not a regular file
2022/01/26 12:47:29 ERROR : Attempt 1/1 failed with 1 errors and: failed to touch (create): update stor: 550 /files/ftp: Not a regular file
2022/01/26 12:47:29 DEBUG : 2 go routines active
2022/01/26 12:47:29 Failed to touch: failed to touch (create): update stor: 550 /files/ftp: Not a regular file

With SFTP:

2022/01/26 13:04:07 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "--config" "/tmp/rclone-sftp.config" "-vv" "--retries" "1" "touch" "rclone-storage:/files/sftp"]
2022/01/26 13:04:07 DEBUG : Creating backend with remote "rclone-storage:/files/sftp"
2022/01/26 13:04:07 DEBUG : Using config file from "/tmp/rclone-sftp.config"
2022/01/26 13:04:07 DEBUG : sftp://test@dev23.keymachine.de:22//files/sftp: New connection 62.141.56.104:51682->62.141.56.45:22 to "SSH-2.0-OpenSSH_8.4p1 Debian-5"
2022/01/26 13:04:07 DEBUG : Touch time 2022-01-26 13:04:07.852656441 +0100 CET m=+0.612075729
2022/01/26 13:04:07 DEBUG : sftp://test@dev23.keymachine.de:22//files/sftp: Touching (creating)
2022/01/26 13:04:07 ERROR : Attempt 1/1 failed with 1 errors and: failed to touch (create): Update Create failed: sftp: "Failure" (SSH_FX_FAILURE)
2022/01/26 13:04:07 DEBUG : 11 go routines active
2022/01/26 13:04:07 Failed to touch: failed to touch (create): Update Create failed: sftp: "Failure" (SSH_FX_FAILURE)

Thank you very much for your help!
Alex

Hmm... I can reproduce that.

A bit of git bisect indicates that this in the problem as you suspected.

41876dd66987a209b54346066d2db6378a5decc0 is the first bad commit

commit 41876dd66987a209b54346066d2db6378a5decc0
Author: albertony <12441419+albertony@users.noreply.github.com>
Date:   Sat May 22 21:06:24 2021 +0200

    touch: add support for touching files in directory, with options for recursive, filtering and dry-run/interactive
    
    Fixes #5301

 cmd/touch/touch.go               | 133 +++++++++++++++++++++++++++------------
 cmd/touch/touch_test.go          |   7 +--
 fs/operations/operations.go      |  17 +++++
 fs/operations/operations_test.go |  19 ++++++
 4 files changed, 130 insertions(+), 46 deletions(-)
bisect run success

Can you open a new issue on Github with a link to this forum post please and we can take a look.

Thank you

Thank you, i have opened a new issue.

The problem was solved with the latest BETA. Many thanks to all participants :kissing_heart:.

rclone v1.58.0-beta.5979.051685baa

  • os/version: ubuntu 20.04 (64 bit)
  • os/kernel: 5.4.0-94-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.6
  • go/linking: static
  • go/tags: none
2 Likes

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