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

**URL:** <https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539>\
**Category:** Suspected Bug\
**Created:** [April 14, 2021, 5:19pm UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539 "2021-04-14T17:19:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![0x3333](https://forum.rclone.org/user_avatar/forum.rclone.org/0x3333/32/9170_2.png) [@0x3333](https://forum.rclone.org/u/0x3333)\
**Post date:** [April 14, 2021, 5:19pm UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539/1 "2021-04-14T17:19:25Z")

</div>

#### 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`)

```auto
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.

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

```

#### A log from the command with the `-vv` flag

```auto
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

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [April 14, 2021, 9:57pm UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539/2 "2021-04-14T21:57:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![0x3333](https://forum.rclone.org/user_avatar/forum.rclone.org/0x3333/32/9170_2.png) [@0x3333](https://forum.rclone.org/u/0x3333)\
**Post date:** [April 14, 2021, 11:34pm UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539/3 "2021-04-14T23:34:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [April 15, 2021, 12:07pm UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539/4 "2021-04-15T12:07:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [June 15, 2021, 8:08am UTC](https://forum.rclone.org/t/symbolic-link-stat-error-on-excluded-file-result-in-i-o-error/23539/5 "2021-06-15T08:08:54Z")

</div>

Closed on June 15, 2021, 8:08am UTC

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