Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
None
-
1
-
Yes
-
Yes
-
[obsolete] Server Features
Description
User impact:
User see `Internal Error` once he tries to remove location.
Steps to reproduce:
- Add backup location
- Perform backup
- Perform restore
- Try to remove location with `force` option
Actual result:
Internal Error
Expected result:
Location removed
Workaround:
Details:
Some logs:
ERRO[2021-06-18T15:54:15.204+00:00] RPC /backup.v1beta1.Locations/RemoveLocation done in 36.262ms with unexpected error: pq: update or delete on table "artifacts" violates foreign key constraint "restore_history_artifact_id_fkey" on table "restore_history" failed to delete artifact by id '/artifact_id/42c37ff2-40d1-4bfc-a15f-3bd6c8862829' github.com/percona/pmm-managed/models.RemoveArtifact /root/go/src/github.com/percona/pmm-managed/models/artifact_helpers.go:239 github.com/percona/pmm-managed/models.RemoveBackupLocation /root/go/src/github.com/percona/pmm-managed/models/location_helpers.go:371 github.com/percona/pmm-managed/services/management/backup.(*LocationsService).RemoveLocation.func1 /root/go/src/github.com/percona/pmm-managed/services/management/backup/locations_service.go:250 gopkg.in/reform%2ev1.(*DB).InTransactionContext /root/go/pkg/mod/gopkg.in/[email protected]/db.go:93 gopkg.in/reform%2ev1.(*DB).InTransaction /root/go/pkg/mod/gopkg.in/[email protected]/db.go:74 github.com/percona/pmm-managed/services/management/backup.(*LocationsService).RemoveLocation /root/go/src/github.com/percona/pmm-managed/services/management/backup/locations_service.go:249 github.com/percona/pmm/api/managementpb/backup._Locations_RemoveLocation_Handler.func1 /root/go/pkg/mod/github.com/percona/[email protected]/api/managementpb/backup/locations.pb.go:1494 github.com/grpc-ecosystem/go-grpc-middleware/validator.UnaryServerInterceptor.func1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/validator/validator.go:28 github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 github.com/percona/pmm-managed/utils/interceptors.UnaryServiceEnabledInterceptor.func1 /root/go/src/github.com/percona/pmm-managed/utils/interceptors/service.go:40 github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).UnaryServerInterceptor.func1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:107 github.com/percona/pmm-managed/utils/interceptors.Unary.func1 /root/go/src/github.com/percona/pmm-managed/utils/interceptors/interceptors.go:96 github.com/percona/pmm-managed/utils/interceptors.logRequest /root/go/src/github.com/percona/pmm-managed/utils/interceptors/interceptors.go:78 github.com/percona/pmm-managed/utils/interceptors.Unary /root/go/src/github.com/percona/pmm-managed/utils/interceptors/interceptors.go:94 github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1 /root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:34 github.com/percona/pmm/api/managementpb/backup._Locations_RemoveLocation_Handler /root/go/pkg/mod/github.com/percona/[email protected]/api/managementpb/backup/locations.pb.go:1496 google.golang.org/grpc.(*Server).processUnaryRPC /root/go/pkg/mod/google.golang.org/[email protected]/server.go:1286 google.golang.org/grpc.(*Server).handleStream /root/go/pkg/mod/google.golang.org/[email protected]/server.go:1609 google.golang.org/grpc.(*Server).serveStreams.func1.2 /root/go/pkg/mod/google.golang.org/[email protected]/server.go:934 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1371 request=6e9b7f2d-d04d-11eb-a6e3-0242ac140002