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

--after option for delete retain is throwing a panic error #1694

Open
InteNs opened this issue Apr 22, 2024 · 0 comments
Open

--after option for delete retain is throwing a panic error #1694

InteNs opened this issue Apr 22, 2024 · 0 comments

Comments

@InteNs
Copy link

InteNs commented Apr 22, 2024

Database name

PostgreSQL

Issue description

Trying to delete backups according to our retention policy of 30 days.
We've been doing this with retain FULL 3 as we make full backups every 2 weeks, this is however never really 30 days ago.
Now i've been trying to get the --after option to work with retain FULL 1 so we always have a full backup, and everything from the last 30 days.

Describe your problem

the --after argument is not working at all, it gives the error as you can see in the logs below

Please provide steps to reproduce

wal-g delete retain FULL 1 --after 2024-03-20T00:00:00

Please add config and wal-g stdout/stderr logs for debug purpose

command log

```bash

wal-g delete retain 5 --after 2024-03-20T00:00:00

INFO: 2024/04/22 13:27:14.232305 Backup to delete will be searched in storages: [default]
INFO: 2024/04/22 13:27:14.232423 retrieving permanent objects
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x18fe24c]

goroutine 1 [running]:
github.com/wal-g/wal-g/internal/databases/postgres.timelineAndSegmentNoLess({0x7fd8846e05c0?, 0xc0001b4700?}, {0x0, 0x0})
/root/go/src/github.com/wal-g/wal-g/internal/databases/postgres/delete.go:204 +0x4c
github.com/wal-g/wal-g/internal.NewDeleteHandler.func1({0x0?, 0x0?}, {0x7fd8846e05c0?, 0xc0001b4700?})
/root/go/src/github.com/wal-g/wal-g/internal/delete_handler.go:91 +0x43
github.com/wal-g/wal-g/internal.(*DeleteHandler).FindTargetRetainAfterName(0xc000d8f840, 0x19?, {0x7fff8c61fb71, 0x13}, 0x0)
/root/go/src/github.com/wal-g/wal-g/internal/delete_handler.go:303 +0x23c
github.com/wal-g/wal-g/internal.(*DeleteHandler).FindTargetRetainAfter(0x7fff8c61fb67?, 0x1?, {0x7fff8c61fb71, 0x13}, 0x6c?)
/root/go/src/github.com/wal-g/wal-g/internal/delete_handler.go:275 +0x76
github.com/wal-g/wal-g/internal.(*DeleteHandler).HandleDeleteRetainAfter(0x25abc40?, {0xc000b37920?, 0xac?, 0xab?}, 0x0?)
/root/go/src/github.com/wal-g/wal-g/internal/delete_handler.go:148 +0x229
github.com/wal-g/wal-g/cmd/pg.runDeleteRetain(0x3b83ee0?, {0xc000b37920?, 0x1, 0x3})
/root/go/src/github.com/wal-g/wal-g/cmd/pg/delete.go:91 +0x1f2
github.com/spf13/cobra.(*Command).execute(0x3b83ee0, {0xc000b378f0, 0x3, 0x3})
/root/go/src/github.com/wal-g/wal-g/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x3b80f60)
/root/go/src/github.com/wal-g/wal-g/vendor/github.com/spf13/cobra/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/root/go/src/github.com/wal-g/wal-g/vendor/github.com/spf13/cobra/command.go:902
github.com/wal-g/wal-g/cmd/pg.Execute()
/root/go/src/github.com/wal-g/wal-g/cmd/pg/pg.go:53 +0x25
main.main()
/root/go/src/github.com/wal-g/wal-g/main/pg/main.go:8 +0x17
root@a67b4670221f:/# root@a67b4670221f:/# wal-g delete retain 5 --after 2024-03-20T00:00:00
INFO: 2024/04/22 13:27:14.232305 Backup to delete will be searched in storages: [default]
INFO: 2024/04/22 13:27:14.232423 retrieving permanent objects
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x18fe24c]

</p>
</details>
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

1 participant