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

Can't read snapshots when using BackupBatch #1039

Closed
clayrisser opened this issue Jan 27, 2020 · 14 comments
Closed

Can't read snapshots when using BackupBatch #1039

clayrisser opened this issue Jan 27, 2020 · 14 comments
Labels

Comments

@clayrisser
Copy link

I am using BackupBatch to backup my deployments. The backups work fine.

However, when I run kubectl get snapshots I get the following error.

Error from server (InternalError): Internal error occurred: Fatal: unable to open config file: Stat: The specified key does not exist. Is there a repository at the following location? s3:s3.amazonaws.com/siliconhills-backups/stash
@clayrisser
Copy link
Author

The stash operator also logs the following error.

/bin/restic_0.9.5 snapshots --json --quiet --no-lock --no-cache
Fatal: unable to open config file: Stat: The specified key does not exist.
Is there a repository at the following location?
s3:s3.amazonaws.com/siliconhills-backups/stash

@clayrisser
Copy link
Author

But, you can see the backups exist.

Screenshot from 2020-01-26 20-51-00

@hossainemruz
Copy link
Contributor

Good catch 👍 . We didn't update get snapshot for BackupBatch.

@clayrisser
Copy link
Author

Ah, I see. Thanks. Here is what my repository looks like.

apiVersion: v1
items:
- apiVersion: stash.appscode.com/v1alpha1
  kind: Repository
  metadata:
    creationTimestamp: "2020-01-27T02:22:12Z"
    finalizers:
    - stash
    generation: 1
    labels:
      app: stash
      chart: stash-0.0.1
      heritage: Tiller
      io.cattle.field/appId: stash
      release: stash
    name: stash-stash
    namespace: kube-system
    resourceVersion: "45530391"
    selfLink: /apis/stash.appscode.com/v1alpha1/namespaces/kube-system/repositories/stash-stash
    uid: 92c00e01-a228-4f6a-9477-28531a9cff05
  spec:
    backend:
      s3:
        bucket: siliconhills-backups
        endpoint: s3.amazonaws.com
        prefix: stash
      storageSecretName: stash-stash-backup
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

@clayrisser
Copy link
Author

@hossainemruz so how do I restore my backups right now? Is there any workaround?

@hossainemruz
Copy link
Contributor

Use latest in snapshot field. This will restore the latest snapshot.

@clayrisser
Copy link
Author

What's the status on this issue?

@hossainemruz
Copy link
Contributor

@codejamninja In order to fix this issue, we have to fix these issues first:

We will try to fix as soon as possible. However, it won't be part of v0.9.0-rc.6 which going to be out very soon.

@clayrisser
Copy link
Author

@hossainemruz ok, thanks

@nauni77
Copy link

nauni77 commented Apr 21, 2020

@codejamninja Thanks for reporting. I have the same problem.

@endrec
Copy link

endrec commented Jun 2, 2020

@hossainemruz wrote:

Use latest in snapshot field. This will restore the latest snapshot.

It seems restoring from latest snapshot does not work with BackupBatch. 😞

I have a RestoreSession with

  target:
    ref:
      apiVersion: appcatalog.appscode.com/v1alpha1
      kind: AppBinding
      name: mongo-restore

The restore job is created with a --path flag which only contains my repository prefix (it does not contain any appbinding reference).

I can create an other repository, where I add appbinding/... to my prefix, which works wonders, but I don't think that would be the expected way to restore from a backupbatch...

So currently my working setup is:
On backup, I have a repository, with prefix backup, and a BackupBatch with two targets, a mongodb and a postgres.
(This creates snapshots in backup/appbinding/mongo and backup/appbinding/postgres.)
On restore, I have two repositories, with prefixes backup/appbinding/mongo and backup/appbinding/postgres, and two RestoreSessions .
This works, but it should be simpler, I believe.

@hossainemruz
Copy link
Contributor

@codejamninja We are going to fix this issue in next release. Here are the proposed changes: stashed/project#5

@endrec
Copy link

endrec commented Jun 8, 2020

The proposed solution looks good to me, it will make life easier. :)

tamalsaha added a commit to stashed/apimachinery that referenced this issue Jul 26, 2020
xref: 
- stashed/stash#1041
- stashed/stash#1053
- stashed/stash#1039
- stashed/project#2
- stashed/project#5

**Tasks:**
- [x] Add RestoreBatch types
- [x] Add `alias` field in BackupConfiguration, BackupBatch and RestoreSession
- [x] Generated Code
- [x] Add client utils
- [x] Add restore invoker helpers
- [x] Add necessary constants
- [x] Add `RepositoryExist`, `BackendSecretExist` conditions
- [x] Add `--include` and `--exclude` options
- [x] Implement RestoreBatch in `stashed/stash`
- [x] Add additional print column into Snapshot

Signed-off-by: hossainemruz <[email protected]>
Co-authored-by: Tamal Saha <[email protected]>
@hossainemruz
Copy link
Contributor

Already fixed in master.

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

No branches or pull requests

4 participants