Open bfeher-kx opened 1 year ago
Hi @bfeher-kx
Thanks for reporting this! I thought we're already tracking that, but was not able to find an issue for that.
Hi @Kidswiss
We have checked the code and it seems its expecting 3 sections for the path. In this case the last section is missing as we don't have a directory.
hi @bfeher-kx
Yes that is correct, the current restore code to PVC expects that the backup also came from a PVC and not from a pre-backup command. So it's a use-case that has not yet been implemented as such.
The main issue is, that in most cases a dump file in a PVC isn't of much use to someone. They then still have to get the dump out of the PVC and into the DB instance somehow. But it would make for a better user-experience than just crashing.
There's the idea of restoreCommands: https://github.com/k8up-io/k8up/issues/637
BTW: just found in the docs that we have a note about this case: https://k8up.io/k8up/2.5/how-tos/restore.html#_restore_from_s3_to_pvc
I knew we had written down something about this exact issue.
Hi @Kidswiss
Does that mean we should not wait for a fix? Is there a reason why its done like that?
Hi @bfeher-kx
I think to implement a fix would be reasonable.
As to your second question, basically what I wrote above:
The main issue is, that in most cases a dump file in a PVC isn't of much use to someone. They then still have to get the dump out of the PVC and into the DB instance somehow.
That's why we have the descriptions how to do manual restores.
HI @Kidswiss
Can this be expected to be fixed? If not, please let me know and we will find a workaround.
Description
I've created an instance from ghcr.io/k8up-io/k8up:v2 and set the followings:
The Snapshot id points to a single .sql file which has been created via K8up application aware backup from a PostgreSQL instance. It fails with with the following error: panic: runtime error: slice bounds out of range [:3] with capacity 2.
The snapshot above can be restored manually via the Restic binary packed in the same image.
Additional Context
My goal was to restore to a RWO volume thus used podAffinity spec to get my pod scheduled beside the target pod.
Tried with the operator as well, pointing to a RWX volume, it fails too.
Logs
Expected Behavior
K8up should be able to restore a single file snapshot.
Steps To Reproduce
Version of K8up
v2.5
Version of Kubernetes
v1.24.6
Distribution of Kubernetes
AKS