restic: restic to minio:sia backend panic runtime error: slice bounds out of range
Noob restic user here 😃 testing with a PR version being worked on by @dvstate (https://github.com/dvstate/minio/) for sia/minio to allow a sia backend.
Appreciate I am using a PR version of minio with sia, but I wanted to give a heads up to my issue, incase it was a bug in restic only.
I am using restic 0.7.1 compiled with go1.9 on darwin/amd64
I have successfully initialised the repo (using the latest PR) and have now tried to backup 1 file with the following command;
restic -r s3:http://192.168.1.99:9001/restic backup /Users/local/Test
enter password for repository:
I get the following panic;
panic:
runtime error: slice bounds out of range
goroutine
1 [running]:
restic/repository.SearchKey(0x185a7c0, 0xc4200140c8, 0xc420114c60, 0xc42015c240, 0x40, 0x14, 0x40, 0xc42015c240, 0x40)
src/restic/repository/key.go:126 +0x461
restic/repository.(*Repository).SearchKey(0xc420114c60, 0x185a7c0, 0xc4200140c8, 0xc42015c240, 0x40, 0x14, 0xc420134900, 0x0)
src/restic/repository/repository.go:369 +0x84
main.OpenRepository(0x7ffeefbffb5a, 0x22, 0x0, 0x0, 0x0, 0x185a780, 0xc420134900, 0xc42015c240, 0x40, 0x1853fc0, ...)
src/cmds/restic/global.go:313 +0xf0
main.runBackup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
src/cmds/restic/cmd_backup.go:365 +0x447
main.glob..func2(0x188e2a0, 0xc42011b2f0, 0x1, 0x3, 0x0, 0x0)
src/cmds/restic/cmd_backup.go:39 +0x1b9
github.com/spf13/cobra.(*Command).execute(0x188e2a0, 0xc420134a40, 0x3, 0x4, 0x188e2a0, 0xc420134a40)
src/github.com/spf13/cobra/command.go:647 +0x3f1
github.com/spf13/cobra.(*Command).ExecuteC(0x188de60, 0x1028fa6, 0x15e4518, 0xc4201a3de8)
src/github.com/spf13/cobra/command.go:726 +0x2fe
github.com/spf13/cobra.(*Command).Execute(0x188de60, 0x24, 0xc4201a3eb0)
src/github.com/spf13/cobra/command.go:685 +0x2b
main.main()
src/cmds/restic/main.go:63 +0x1de
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 25 (12 by maintainers)
Commits related to this issue
- Fix panic when file name is too short Closes #1204 — committed to restic/restic by fd0 7 years ago
I’ve added code to handle invalid key files, see #1227.
Hey, thanks a lot for the report, it’s an embarrassingly simple bug. The cause is that the server’s list of files in the
keysdirectory includes a file with a filename with less than 12 characters, which is invalid for a restic key file. It’ll be resolved in the master branch later today when #1220 is merged.