restic ls fails with "cached file too short"
Output of restic version
restic 0.18.1 compiled with go1.25.6 X:nodwarf5 on linux/amd64
What backend/service did you use to store the repository?
PCloud via rclone
Problem description / Steps to reproduce
During restic ls, I get the error cached file <data/a54052f002> is too short, and the restore aborts.
I have tried deleting the mentioned cached file using find ~/.cache/rclone -name "*a54052f002" -delete, which
causes the file listing to pause momentarily, then the error re-appears. I guess it re-downloads the data file
from PCloud but it is broken in the cloud as well. This happens every now and then with PCloud and is a cause for
concern on its own.
Expected behavior
The optimal way I think to deal with the corrupted data file is not to abort with an error, but to skip all files that are affected by the corrupted data file and continue listing as good as possible. Then finish with a warning and a non-zero exit code.
Actual behavior
restic -r rclone:pcloud:path/to/repo -p ../password.txt ls 6dfa7428:/C/mnt/PhotoDrive
[... prints file paths ...]
cached file <data/a54052f002> is too short
github.com/restic/restic/internal/backend/cache.(*Cache).load
github.com/restic/restic/internal/backend/cache/file.go:65
github.com/restic/restic/internal/backend/cache.(*Backend).loadFromCache
github.com/restic/restic/internal/backend/cache/backend.go:140
github.com/restic/restic/internal/backend/cache.(*Backend).Load
github.com/restic/restic/internal/backend/cache/backend.go:187
github.com/restic/restic/internal/backend.ReadAt
github.com/restic/restic/internal/backend/readerat.go:32
github.com/restic/restic/internal/repository.(*Repository).loadBlob
github.com/restic/restic/internal/repository/repository.go:270
github.com/restic/restic/internal/repository.(*Repository).LoadBlob
github.com/restic/restic/internal/repository/repository.go:251
github.com/restic/restic/internal/restic.LoadTree
github.com/restic/restic/internal/restic/tree.go:115
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:88
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.Walk
github.com/restic/restic/internal/walker/walker.go:48
main.runLs
github.com/restic/restic/cmd/restic/cmd_ls.go:464
main.newLsCommand.func1
github.com/restic/restic/cmd/restic/cmd_ls.go:62
github.com/spf13/cobra.(*Command).execute
github.com/spf13/[email protected]/command.go:1015
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/[email protected]/command.go:1148
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/[email protected]/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext
github.com/spf13/[email protected]/command.go:1064
main.main
github.com/restic/restic/cmd/restic/main.go:172
runtime.main
runtime/proc.go:285
runtime.goexit
runtime/asm_amd64.s:1693
ReadFull(<data/a54052f002>)
github.com/restic/restic/internal/backend.ReadAt
github.com/restic/restic/internal/backend/readerat.go:38
github.com/restic/restic/internal/repository.(*Repository).loadBlob
github.com/restic/restic/internal/repository/repository.go:270
github.com/restic/restic/internal/repository.(*Repository).LoadBlob
github.com/restic/restic/internal/repository/repository.go:251
github.com/restic/restic/internal/restic.LoadTree
github.com/restic/restic/internal/restic/tree.go:115
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:88
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.walk
github.com/restic/restic/internal/walker/walker.go:98
github.com/restic/restic/internal/walker.Walk
github.com/restic/restic/internal/walker/walker.go:48
main.runLs
github.com/restic/restic/cmd/restic/cmd_ls.go:464
main.newLsCommand.func1
github.com/restic/restic/cmd/restic/cmd_ls.go:62
github.com/spf13/cobra.(*Command).execute
github.com/spf13/[email protected]/command.go:1015
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/[email protected]/command.go:1148
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/[email protected]/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext
github.com/spf13/[email protected]/command.go:1064
main.main
github.com/restic/restic/cmd/restic/main.go:172
runtime.main
runtime/proc.go:285
runtime.goexit
runtime/asm_amd64.s:1693Do you have any idea what may have caused this?
Probably PCloud being unreliable, or an earlier aborted backup, e.g. by a system restart, may have caused the truncated data file
Did restic help you today? Did it make you happy in any way?
It performs much faster for me than Borg on the PCloud remote, which is great. It did not so far brick the whole repository like Kopia did (also probably caused by a PCloud glitch ... I shouldn't have committed to the lifetime plan... ) So I am very happy!
Source: restic/restic