-
Notifications
You must be signed in to change notification settings - Fork 1.7k
panic: runtime error: slice bounds out of range #5259
Copy link
Copy link
Closed
Description
Output of restic version
restic 0.17.3 compiled with go1.23.3 on linux/amd64
What backend/service did you use to store the repository?
sftp
Problem description / Steps to reproduce
Unfortunately, I don't have complete logs because my buffer isn't big enough.
But I can roughly describe what happened:
- I can
restic forget --prune. While it was repacking, the Internet connection dropped and it aborted - I ran
restic forget --pruneagain but nothing happened (I was hoping it would finish the repacking) - I ran
restic checkin the hope it would fix / repack. That was doing something, but when I checked it gave apanic: runtime error: slice bounds out of range(I think the internet connection dropped again).
What I see in the log is:
... lots and lots of "pack ...: does not exist" (unfortunately I don't see what happened above)
pack d022ed4b1cb37dc49974e50a1b88710087bf71e35db2375fe8eb991e79d83429: does not exist
pack 0c773518344d112602d370f7a49fb3c3e7c2d70ca6d27a0f421e3c65d3fb03d0: does not exist
pack 2a7f50f586bfbc5a135c4943720469e4e01262daa075f2203a263e627f203506: does not exist
pack 22042e4ba736ee174624d636de7aa913d6ac0fea7973a507af89b191f5db9a39: does not exist
check snapshots, trees and blobs
Load(<snapshot/c4579220fa>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/aa1de0f976>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/aa1de0f976>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/af9c2ed63a>, 0, 0) returned error, retrying after 888.248561ms: connection lost
Load(<snapshot/af9c2ed63a>, 0, 0) returned error, retrying after 888.248561ms: connection lost
Load(<snapshot/b32c04b422>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/ea6151c3e0>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/ab2bce9afc>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/eef7d449e4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/98874bbae1>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/a047567706>, 0, 0) returned error, retrying after 1.13913515s: connection lost
Load(<snapshot/a047567706>, 0, 0) returned error, retrying after 1.13913515s: connection lost
Load(<snapshot/b9c28dfb2b>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/a047567706>, 0, 0) returned error, retrying after 1.13913515s: connection lost
Load(<snapshot/b9c28dfb2b>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/1bd4de1f15>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/a047567706>, 0, 0) returned error, retrying after 1.13913515s: connection lost
Load(<snapshot/b9c28dfb2b>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/1bd4de1f15>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4b35ee5b3a>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/9d43a12fd0>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/8e35a331d4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/390e0f6ac9>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/7ee39f0658>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/ffcdbca969>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4856698584>, 0, 0) returned error, retrying after 890.617254ms: connection lost
Load(<snapshot/d365f07174>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/c590edb266>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/c590edb266>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/f264f407a4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/d38b5d72d1>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4f6e618c00>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/be63d10924>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/878a5a0d4f>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/3f91639cb3>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/0789d81f62>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/0789d81f62>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/8a66727ead>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4657ad5f39>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/7c3991dae9>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/7c3991dae9>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/2ae892a65c>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/6f47672619>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/b0b5a0dedd>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/a279cb0023>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4e080dbd42>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4e080dbd42>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/8c511061dc>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/f738d543cc>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/45a2a314f4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/e65a7286c2>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/9a76701e47>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/a279e65322>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/60a4fb7e23>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4f337f69a4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/4f337f69a4>, 0, 0) failed: ssh command exited: exit status 255
Load(<snapshot/7be1684db5>, 0, 0) failed: ssh command exited: exit status 255
panic: runtime error: slice bounds out of range [468:156]
goroutine 5308 [running]:
bytes.(*Buffer).Next(...)
/usr/local/go/src/bytes/buffer.go:346
github.com/restic/restic/internal/ui/termstatus.(*lineWriter).Write(0xc0005921e0, {0xc0010a05a0?, 0xe?, 0xc000c2b560?})
/restic/internal/ui/termstatus/stdio_wrapper.go:36 +0x136
fmt.Fprintf({0x7f291f673fe8, 0xc0005921e0}, {0x12d2bcd, 0xe}, {0xc000c2b560, 0x2, 0x2})
/usr/local/go/src/fmt/print.go:225 +0x97
main.Warnf({0x12d2bcd, 0xe}, {0xc000c2b560, 0x2, 0x2})
/restic/cmd/restic/global.go:250 +0x53
main.OpenRepository.func1({0xc0005c4390?, 0x0?}, {0x14ab460, 0xc001eec390}, 0xc000c2b648?)
/restic/cmd/restic/global.go:447 +0x12a
github.com/restic/restic/internal/backend/retry.(*Backend).retry.func2({0x14ab460?, 0xc001eec390?}, 0xc0002ba440?)
/restic/internal/backend/retry/backend_retry.go:143 +0x45
github.com/restic/restic/internal/backend/retry.retryNotifyErrorWithSuccess(0x0?, {0x14b86d0, 0xc0002ba440}, 0xc000c2b6e0, 0xc000c2b6c0?)
/restic/internal/backend/retry/backend_retry.go:66 +0xfd
github.com/restic/restic/internal/backend/retry.(*Backend).retry(0xc0005b4050, {0x14ba330, 0xc0005b40f0}, {0xc0005c4390, 0x21}, 0xc000c2b7d8)
/restic/internal/backend/retry/backend_retry.go:130 +0x30b
github.com/restic/restic/internal/backend/retry.(*Backend).Load(0xc0005b4050, {0x14ba330, 0xc0005b40f0}, {0x4, 0x0, {0xc0019a3400, 0x40}}, 0x0, 0x0, 0xc001109230)
/restic/internal/backend/retry/backend_retry.go:207 +0x36e
github.com/restic/restic/internal/backend/cache.(*Backend).cacheFile(0xc00011a810, {0x14ba330, 0xc0005b40f0}, {0x4, 0x0, {0xc0019a3400, 0x40}})
/restic/internal/backend/cache/backend.go:125 +0x2ed
github.com/restic/restic/internal/backend/cache.(*Backend).Load(0xc00011a810, {0x14ba330, 0xc0005b40f0}, {0x4, 0x0, {0xc0019a3400, 0x40}}, 0x0, 0x0, 0xc0003d6fd0)
/restic/internal/backend/cache/backend.go:182 +0x37b
github.com/restic/restic/internal/repository.loadRaw({0x14ba330, 0xc0005b40f0}, {0x14c3158, 0xc00011a810}, {0x65?, 0x4f?, {0xc0019a3400?, 0x0?}})
/restic/internal/repository/raw.go:46 +0xd6
github.com/restic/restic/internal/repository.(*Repository).LoadRaw(0xc00051c1a0, {0x14ba330, 0xc0005b40f0}, 0x4, {0x7b, 0xe1, 0x68, 0x4d, 0xb5, 0x71, ...})
/restic/internal/repository/raw.go:19 +0x11f
github.com/restic/restic/internal/repository.(*Repository).LoadUnpacked(0xc00051c1a0, {0x14ba330, 0xc0005b40f0}, 0x4, {0x7b, 0xe1, 0x68, 0x4d, 0xb5, 0x71, ...})
/restic/internal/repository/repository.go:169 +0x105
github.com/restic/restic/internal/restic.LoadJSONUnpacked({0x14ba330?, 0xc0005b40f0?}, {0x14b28c8?, 0xc00051c1a0?}, 0x10?, {0x7b, 0xe1, 0x68, 0x4d, 0xb5, ...}, ...)
/restic/internal/restic/json.go:14 +0x62
github.com/restic/restic/internal/restic.LoadSnapshot({0x14ba330, 0xc0005b40f0}, {0x14b28c8, 0xc00051c1a0}, {0x7b, 0xe1, 0x68, 0x4d, 0xb5, 0x71, ...})
/restic/internal/restic/snapshot.go:84 +0xe5
github.com/restic/restic/internal/restic.ForAllSnapshots.func1({0x14ba330, 0xc0005b40f0}, {0x7b, 0xe1, 0x68, 0x4d, 0xb5, 0x71, 0x7, 0x2b, ...}, ...)
/restic/internal/restic/snapshot.go:111 +0xe5
github.com/restic/restic/internal/restic.ParallelList.func2()
/restic/internal/restic/parallel.go:39 +0x178
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/build/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 5302
/home/build/go/pkg/mod/golang.org/x/sync@v0.7.0/errgroup/errgroup.go:75 +0x96
Do you have any idea what may have caused this?
Bad Internet connection, but not sure what happened exactly.
Anyway, I haven't touched the repo since the error above happened, so maybe I can supply more details if you tell me what commands to run.
Did restic help you today? Did it make you happy in any way?
restic makes me so happy because I know I can rely on it (not sure what happened today).
Reactions are currently unavailable