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

backup #1072

Open
Simon-CR opened this issue Jun 17, 2024 · 5 comments
Open

backup #1072

Simon-CR opened this issue Jun 17, 2024 · 5 comments

Comments

@Simon-CR
Copy link

I'm trying to create a backup (local single file). When I start the backup process, I get those files created in the backup folder: temp-gravity-snapshot.2769572314.etcd temp-gravity-snapshot.2930763333.etcd but they are empty. Not sure how to troubleshoot this next.

@BeryJu
Copy link
Owner

BeryJu commented Jun 18, 2024

you should be able to see some more info related to this in the logs when grepping for "role":"backup"

@Simon-CR
Copy link
Author

Simon-CR commented Jun 18, 2024

I'm kind of a fringe case. I'm running this in a mikrotik container, which works perfect except for this...

thanks

{"level":"info","ts":1718711843.5828357,"logger":"role.api","msg":"/api/v1/backup/status","instance":"scr-gravity1","version":"0.9.0-3f90c704","host":"10.0.0.101:8008","remote":"192.168.172.208:62262","runtime":0,"method":"GET","size":16,"status":200,"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0","user":"admin"}
{"level":"info","ts":1718711847.1169844,"logger":"role.api","msg":"/api/v1/backup/start?wait=false","instance":"scr-gravity1","version":"0.9.0-3f90c704","host":"10.0.0.101:8008","remote":"192.168.172.208:62265","runtime":0,"method":"POST","size":51,"status":200,"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0","user":"admin"}
{"level":"error","ts":1718711847.1171348,"logger":"etcd.client","msg":"streamer failed to create ClientStream","instance":"scr-gravity1","version":"0.9.0-3f90c704","error":"rpc error: code = Canceled desc = context canceled","stacktrace":"go.etcd.io/etcd/client/v3.(*Client).streamClientInterceptor.func1\n\t/go/pkg/mod/go.etcd.io/etcd/client/[email protected]/retry_interceptor.go:130\ngoogle.golang.org/grpc.(*ClientConn).NewStream\n\t/go/pkg/mod/google.golang.org/[email protected]/stream.go:167\ngo.etcd.io/etcd/api/v3/etcdserverpb.(*maintenanceClient).Snapshot\n\t/go/pkg/mod/go.etcd.io/etcd/api/[email protected]/etcdserverpb/rpc.pb.go:7358\ngo.etcd.io/etcd/client/v3.(*retryMaintenanceClient).Snapshot\n\t/go/pkg/mod/go.etcd.io/etcd/client/[email protected]/retry.go:214\ngo.etcd.io/etcd/client/v3.(*maintenance).Snapshot\n\t/go/pkg/mod/go.etcd.io/etcd/client/[email protected]/maintenance.go:207\nberyju.io/gravity/pkg/roles/backup.(*Role).snapshotToFile\n\t/workspace/pkg/roles/backup/backup.go:81\nberyju.io/gravity/pkg/roles/backup.(*Role).SaveSnapshot\n\t/workspace/pkg/roles/backup/backup.go:119"}
{"level":"warn","ts":1718711847.1172833,"logger":"role.backup","msg":"failed to snapshot","instance":"scr-gravity1","version":"0.9.0-3f90c704","error":"context canceled"}
{"level":"warn","ts":1718711847.117487,"logger":"role.backup","msg":"failed to save status","instance":"scr-gravity1","version":"0.9.0-3f90c704","error":"context canceled"}
{"level":"info","ts":1718711847.2174735,"logger":"role.api","msg":"/api/v1/backup/status","instance":"scr-gravity1","version":"0.9.0-3f90c704","host":"10.0.0.101:8008","remote":"192.168.172.208:62261","runtime":0,"method":"GET","size":16,"status":200,"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0","user":"admin"}

@BeryJu
Copy link
Owner

BeryJu commented Jun 18, 2024

the above commit should fix that, you can switch to the latest build (which is pretty closet o 0.9 anyways) after the CI is done

@Simon-CR
Copy link
Author

Hi, Just to confirm, backup trigger now works.

out of curiosity, "Starting with 0.4.5, Gravity will also keep 1 snapshot locally", will that backup be updated daily or can I force update it daily somehow, and have some other script pull it to maintain some history. I don't use S3

@BeryJu
Copy link
Owner

BeryJu commented Jun 19, 2024

that local snapshot is created everytime you trigger a backup start or with whatever cron expression is configured in the backup role config

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