Input/output error reading external HDD without GODEBUG=asyncpreemptoff=1

What is the problem you are having with rclone?

I have got this error messages when syncing from an external HDD to Google Drive, even with --dry-run. My priority is knowing whether this could be a go/rclone issue (including PEBCAK) or a hardware one. Thanks in advance!

The external drive is a mechanical HDD in a case with a SATA/USB 3.0 adapter. The whole drive is a single ext4 partition with not encryption. No CIFS involved that I know of. I mention this because looking for readdirent I found a mention to this go bug that affected rclone with CIFS and was already closed.

Run the command 'rclone version' and share the full output of the command.

$ rclone version
rclone v1.67.0
- os/version: debian trixie/sid (64 bit)
- os/kernel: 6.9.8-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.22.4
- go/linking: static
- go/tags: none

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

Google Drive, but the issue seems to stem from interacting with the external hard drive.

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

systemd-inhibit rclone sync --dry-run /media/leonardof/Fotos gdrive:Backup/Fotos --exclude rpd-*/** --exclude zoopress/** --exclude lost+found/** --progress --cache-rps 3

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[fastmail]
type = webdav
url = https://myfiles.fastmail.com
vendor = fastmail
user = XXX
pass = XXX

[gdrive]
type = drive
scope = drive
token = XXX
client_id = XXX
client_secret = XXX
export_formats = odt,ods,odp
acknowledge_abuse = true
team_drive = 

A log from the command that you were trying to run with the -vv flag

This was copied from the console output 0before reading the forum recommendations. Will run again with -vv if deemed relevant.

2024/07/14 12:46:48 NOTICE: 2023/2023-09-21/IMG_20230921_134213.jpg: Skipped copy as --dry-run is set (size 324.727Ki)
[skipped 171 lines similar to above and bellow]
2024/07/14 12:49:57 NOTICE: 2023/2023-09-20/IMG_20230920_221731.jpg: Skipped copy as --dry-run is set (size 392.485Ki)
2024/07/14 12:54:44 ERROR : 2013/2013-02-07/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-02-07/.comments: input/output error
2024/07/14 12:54:44 ERROR : 2013/2013-01-28/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-28/.comments: input/output error
2024/07/14 12:54:44 NOTICE: 2024/2024-02-20/IMG_20240220_145425_DRO.jpg: Skipped copy as --dry-run is set (size 727.943Ki)
2024/07/14 12:54:44 NOTICE: 2024/2024-02-20/IMG_20240220_155042_DRO.jpg: Skipped copy as --dry-run is set (size 820.764Ki)
2024/07/14 12:55:25 ERROR : 2013/2013-01-13/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
2024/07/14 12:55:25 NOTICE: 2024/2024-04-24/VID_20240424_200213.mp4: Skipped copy as --dry-run is set (size 9.089Mi)
2024/07/14 12:55:25 ERROR : Google drive root 'Backup/Fotos': not deleting files as there were IO errors
2024/07/14 12:55:25 NOTICE: 2023/2023-09-22: Skipped set directory modification time as --dry-run is set
[skipped 83 lines similar to above and bellow]
2024/07/14 12:55:25 NOTICE: 2024/2024-04-24: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 12:55:25 NOTICE: 2023: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 12:55:25 NOTICE: 2024: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 12:55:25 ERROR : Google drive root 'Backup/Fotos': not deleting directories as there were IO errors
2024/07/14 12:55:25 ERROR : Attempt 1/3 failed with 4 errors and: march failed with 3 error(s): first error: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-02-07/.comments: input/output error
2024/07/14 12:55:30 ERROR : 2013/2013-01-13/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
2024/07/14 12:55:31 NOTICE: 2023/2023-09-21/IMG_20230921_134103.jpg: Skipped copy as --dry-run is set (size 340.124Ki)
[skipped 29 lines similar to above and bellow]
2024/07/14 12:55:35 NOTICE: 2023/2023-10-03/IMG_20231003_151148.jpg: Skipped copy as --dry-run is set (size 322.938Ki)
2024/07/14 12:55:36 ERROR : 2013/2013-01-28/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-28/.comments: input/output error
2024/07/14 12:55:37 NOTICE: 2024/2024-01-22/IMG_20240122_065338.jpg: Skipped copy as --dry-run is set (size 1.764Mi)
[skipped 23 lines similar to above and bellow]
2024/07/14 12:55:46 NOTICE: 2023/2023-11-02/IMG_20231102_155401.jpg: Skipped copy as --dry-run is set (size 632.544Ki)
2024/07/14 12:55:47 ERROR : 2013/2013-02-07/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-02-07/.comments: input/output error
2024/07/14 12:55:48 NOTICE: 2024/2024-03-16/IMG_20240316_105451-editada.jpg: Skipped copy as --dry-run is set (size 306.160Ki)
2024/07/14 12:55:48 NOTICE: 2024/2024-03-16/IMG_20240316_105451.jpg: Skipped copy as --dry-run is set (size 600.503Ki)
[skipped 117 lines similar to above and bellow]
2024/07/14 12:58:37 NOTICE: 2023/2023-09-20/IMG_20230920_221731.jpg: Skipped copy as --dry-run is set (size 392.485Ki)
2024/07/14 13:00:14 ERROR : Google drive root 'Backup/Fotos': not deleting files as there were IO errors
2024/07/14 13:00:14 NOTICE: 2023/2023-10-21: Skipped set directory modification time as --dry-run is set
[skipped 82 lines similar to above and bellow]
2024/07/14 13:00:14 NOTICE: 2024/2024-04-25: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:00:14 NOTICE: 2023: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:00:14 NOTICE: 2024: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:00:14 ERROR : Google drive root 'Backup/Fotos': not deleting directories as there were IO errors
2024/07/14 13:00:14 ERROR : Attempt 2/3 failed with 4 errors and: march failed with 3 error(s): first error: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
2024/07/14 13:00:23 ERROR : 2013/2013-01-13/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
2024/07/14 13:00:25 NOTICE: 2023/2023-09-21/IMG_20230921_134102.jpg: Skipped copy as --dry-run is set (size 301.096Ki)
[skipped 29 lines similar to above and bellow]
2024/07/14 13:00:34 NOTICE: 2024/2024-01-13/IMG_20240113_094332.jpg: Skipped copy as --dry-run is set (size 1.714Mi)
2024/07/14 13:00:34 ERROR : 2013/2013-01-28/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-28/.comments: input/output error
2024/07/14 13:00:35 NOTICE: 2023/2023-10-04/IMG_20231004_091303.jpg: Skipped copy as --dry-run is set (size 302.264Ki)
[skipped 22 lines similar to above and bellow]
2024/07/14 13:00:45 NOTICE: 2023/2023-11-02/IMG_20231102_155401.jpg: Skipped copy as --dry-run is set (size 632.544Ki)
2024/07/14 13:00:45 ERROR : 2013/2013-02-07/.comments: error reading source directory: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-02-07/.comments: input/output error
2024/07/14 13:00:45 NOTICE: 2024/2024-03-12/IMG_20240312_073839.jpg: Skipped copy as --dry-run is set (size 378.059Ki)
[skipped 119 lines similar to above and bellow]
2024/07/14 13:03:36 NOTICE: 2023/2023-09-20/IMG_20230920_203906.jpg: Skipped copy as --dry-run is set (size 282.550Ki)
2024/07/14 13:05:12 ERROR : Google drive root 'Backup/Fotos': not deleting files as there were IO errors
2024/07/14 13:05:12 NOTICE: 2023/2023-10-21: Skipped set directory modification time as --dry-run is set
[skipped 81 lines similar to above and bellow]
2024/07/14 13:05:12 NOTICE: 2024/2024-04-25: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:05:12 NOTICE: 2024: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:05:12 NOTICE: 2023: Skipped set directory modification time as --dry-run is set (size 0)
2024/07/14 13:05:12 ERROR : Google drive root 'Backup/Fotos': not deleting directories as there were IO errors
2024/07/14 13:05:12 ERROR : Attempt 3/3 failed with 4 errors and: march failed with 3 error(s): first error: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
Transferred:        1.715 GiB / 1.715 GiB, 100%, 6.515 MiB/s, ETA 0s
Errors:                 4 (retrying may help)
Checks:            127335 / 127335, 100%
Transferred:          528 / 528, 100%
Elapsed time:     18m31.0s
2024/07/14 13:05:12 NOTICE: 
Transferred:   	    1.715 GiB / 1.715 GiB, 100%, 6.515 MiB/s, ETA 0s
Errors:                 4 (retrying may help)
Checks:            127335 / 127335, 100%
Transferred:          528 / 528, 100%
Elapsed time:     18m31.0s

2024/07/14 13:05:12 Failed to sync with 4 errors: last error was: march failed with 3 error(s): first error: failed to read directory entry: readdirent /media/leonardof/Fotos/2013/2013-01-13/.comments: input/output error
rclone failed with exit status 1.

Oh, and

$ export GODEBUG=asyncpreemptoff=1
$ systemd-inhibit rclone sync  /media/leonardof/Fotos gdrive:Backup/Fotos --exclude rpd-*/** --exclude zoopress/** --exclude lost+found/** --progress --cache-rps 3
Transferred:      585.393 MiB / 585.393 MiB, 100%, 1.228 MiB/s, ETA 0s
Checks:             42451 / 42451, 100%
Transferred:          176 / 176, 100%
Elapsed time:      5m53.1s

IO Error while reading a directory indicates a poorly file system or hardware. The error (EIO) is different to the one in the go issue you posted so it probably isn't related.

I'd try doing an fsck -N on the drive to see if fsck has anything to report on the filing system. Run it a few times and see if you get the same answers and that will tell you whether it is a hardware problem or not. If it is a hardware problem you don't want to run fsck for real - that is likely to cause data loss.

Check the smart stats on the hard disk also and see if there are problems there.

Also check the kernel logs to see if there is anything in there about the disk.

Proceed with care! Don't write anything to the disk.

1 Like

Thanks! Will do so

1 Like

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