Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backups_to_keep_local: -1 error #698

Closed
DmitryTeplov182 opened this issue Jul 17, 2023 · 1 comment
Closed

backups_to_keep_local: -1 error #698

DmitryTeplov182 opened this issue Jul 17, 2023 · 1 comment
Assignees
Milestone

Comments

@DmitryTeplov182
Copy link

In the configuration file example, it states that the parameter "backups_to_keep_local" can be set to -1.

BACKUPS_TO_KEEP_LOCAL, how many latest local backup should be kept, 0 means all created backups will be stored on local disk
-1 means backup will keep after create but will delete after create_remote command

When I run the command clickhouse-backup create_remote $BACKUP_NAME -s I receive an error.
I use the "-s" flag because the error occurs after creating a backup, and creating a full backup takes a long time.

Error:

panic: runtime error: slice bounds out of range [-1:]

goroutine 1 [running]:
github.com/Altinity/clickhouse-backup/pkg/backup.GetBackupsToDelete({0xc000178120?, 0x1, 0x1}, 0xffffffffffffffff)
        /home/runner/work/clickhouse-backup/clickhouse-backup/pkg/backup/utils.go:12 +0xf5
github.com/Altinity/clickhouse-backup/pkg/backup.(*Backuper).RemoveOldBackupsLocal(0xc0000b3f80, {0x19fcfa8, 0xc00088d590}, 0x1?, {0x0?, 0xc0000b3f80?, 0x7ffe6f359295?})
        /home/runner/work/clickhouse-backup/clickhouse-backup/pkg/backup/delete.go:93 +0xa5
github.com/Altinity/clickhouse-backup/pkg/backup.(*Backuper).CreateToRemote(0x6f6cbc?, {0x7ffe6f359295, 0x18}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x25de3c0, ...}, ...)
        /home/runner/work/clickhouse-backup/clickhouse-backup/pkg/backup/create_remote.go:26 +0x25e
main.main.func5(0xc0007e11e0)
        /home/runner/work/clickhouse-backup/clickhouse-backup/cmd/clickhouse-backup/main.go:140 +0x2eb
github.com/urfave/cli.HandleAction({0x14b0760?, 0x1859138?}, 0xd?)
        /home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0x1777052, 0xd}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x178fa31, 0x1c}, {0x17cbe13, ...}, ...}, ...)
        /home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/command.go:175 +0x67b
github.com/urfave/cli.(*App).Run(0xc0003ee380, {0xc00003e080, 0x4, 0x4})
        /home/runner/go/pkg/mod/github.com/urfave/cli@v1.22.14/app.go:277 +0xb87
main.main()
        /home/runner/work/clickhouse-backup/clickhouse-backup/cmd/clickhouse-backup/main.go:559 +0x3bce

Version

#clickhouse-backup --version
Version:         2.3.0
Git Commit:      77d269957425afa230c876ecaf33a225bca855eb
Build Date:      2023-06-26
#head -5 /etc/clickhouse-backup/config.yml
general:
  remote_storage: ftp
  max_file_size: 1073741824
  disable_progress_bar: true
  backups_to_keep_local: -1
@Slach Slach self-assigned this Jul 17, 2023
@Slach Slach added this to the 2.3.2 milestone Jul 17, 2023
@Slach
Copy link
Collaborator

Slach commented Jul 17, 2023

thanks for reporting, will try fix it ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants