Symbolic link stat error on excluded file result in I/O error

What is the problem you are having with rclone?

I'm getting a listing error: symlink no such file or directory in a file that is excluded from the sync. Which results in an I/O error and disables remote file deletion.
The symlink target in fact doesn't exist, but I can't delete the symlink, but I excluded it from the sync, which should not result in an I/O error, or at least, should not result in disabling remote file deletion.
I don't know if this is related to the --delete-excluded flag.

What is your rclone version (output from rclone version)

$ rclone --version
rclone v1.55.0

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.2
  • go/linking: static
  • go/tags: cmount

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

$ uname -a
Linux biggie 5.10.0-0.bpo.4-amd64 #1 SMP Debian 5.10.19-1~bpo10+1 (2021-03-13) x86_64 GNU/Linux

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

Backblaze B2

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

rclone sync                          \
    --stats 0                        \
    --copy-links                     \
    --delete-excluded                \
    --filter '- /etc/resolvconf/run' \
    --filter '+ /etc/**'             \
    --filter '- *'                   \
    --fast-list                      \
    / remote:/server/etc

The rclone config contents with secrets removed.

[remote]
type = b2
account = XXXXXXXXXXXXXXXXXXXXXXXX
key = XXXXXXXXXXXXXXXXXXXXXXXXXX
hard_delete = false

A log from the command with the -vv flag

2021/04/14 01:00:16 ERROR : etc/resolvconf/run: Listing error: symlink: stat /etc/resolvconf/run: no such file or directory
2021/04/14 01:00:42 ERROR : B2 bucket remote path servers: not deleting files as there were IO errors
2021/04/14 01:00:42 ERROR : Attempt 1/3 failed with 2 errors and: not deleting files as there were IO errors

...same errors 2 more times...

2021/04/14 01:01:10 Failed to sync with 2 errors: last error was: not deleting files as there were IO errors

Hmm, this is because the reading the link is done at a lower layer (in the backend) than the filtering is done which is a bit unfortunate.

If you sync with --skip-links it should work properly.

If you exclude the entire directory that the bad link is in then it shouldn't scan it,so

--filter '- /etc/resolvconf/**'

That might be acceptable.

Should I file a bug for this or this is the desired behavior?

It is something we should fix.

I think there may be an existing issue, but if you can find it then please make a new one.