{"record":{"id":"50b36b962b9fb4ac","repo":"goharbor/harbor","slug":"failed-to-wait-the-execution-record-to-be-inserted","errorCode":null,"errorMessage":"failed to wait the execution record to be inserted: %v","messagePattern":"failed to wait the execution record to be inserted: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/controller/replication/execution.go","lineNumber":166,"sourceCode":"\t\tc.wp.GetWorker()\n\t\tdefer c.wp.ReleaseWorker()\n\n\t\tctx := orm.NewContext(context.Background(), c.ormCreator.Create())\n\t\t// recover in case panic during the adapter process\n\t\tdefer func() {\n\t\t\tif err := recover(); err != nil {\n\t\t\t\tlogger.Errorf(\"recovered from the panic: %v\", err)\n\t\t\t\tc.markError(ctx, id, fmt.Errorf(\"panic during the process\"))\n\t\t\t}\n\t\t}()\n\n\t\t// as we start a new transaction in the goroutine, the execution record may not\n\t\t// be inserted yet, wait until it is ready before continue\n\t\tif err := retry.Retry(func() error {\n\t\t\t_, err := c.execMgr.Get(ctx, id)\n\t\t\treturn err\n\t\t}); err != nil {\n\t\t\tc.markError(ctx, id, fmt.Errorf(\n\t\t\t\t\"failed to wait the execution record to be inserted: %v\", err))\n\t\t\treturn\n\t\t}\n\n\t\terr := c.flowCtl.Start(ctx, id, policy, resource)\n\t\tif err == nil {\n\t\t\t// no err, return directly\n\t\t\treturn\n\t\t}\n\t\tc.markError(ctx, id, err)\n\t}()\n\treturn id, nil\n}\n\nfunc (c *controller) markError(ctx context.Context, executionID int64, err error) {\n\tlogger := log.GetLogger(ctx)\n\t// try to stop the execution first in case that some tasks are already created\n\tif e := c.execMgr.StopAndWaitWithError(ctx, executionID, 10*time.Second, err); e != nil {","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/controller/replication/execution.go#L148-L184","documentation":"Error \"failed to wait the execution record to be inserted: %v\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/controller/replication/execution.go:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}