{"record":{"id":"a3ea38f3dfa3bd47","repo":"SigNoz/signoz","slug":"failed-to-update-deploy-status","errorCode":null,"errorMessage":"failed to update deploy status","messagePattern":"failed to update deploy status","errorType":"http","errorClass":"model.ApiError","httpStatus":400,"severity":"error","filePath":"pkg/query-service/agentConf/db.go","lineNumber":226,"sourceCode":"\t// check if it has org orgID prefix\n\t// ensuring it here and also ensuring in coordinator.go\n\tif !strings.HasPrefix(lastHash, orgId.String()) {\n\t\tlastHash = orgId.String() + lastHash\n\t}\n\n\t_, err := r.store.BunDB().NewUpdate().\n\t\tModel(new(opamptypes.AgentConfigVersion)).\n\t\tSet(\"deploy_status = ?\", status).\n\t\tSet(\"deploy_result = ?\", result).\n\t\tSet(\"hash = COALESCE(?, hash)\", lastHash).\n\t\tSet(\"config = ?\", lastconf).\n\t\tWhere(\"version = ?\", version).\n\t\tWhere(\"element_type = ?\", elementType).\n\t\tWhere(\"org_id = ?\", orgId).\n\t\tExec(ctx)\n\tif err != nil {\n\t\tslog.ErrorContext(ctx, \"failed to update deploy status\", errors.Attr(err))\n\t\treturn model.BadRequest(fmt.Errorf(\"failed to update deploy status\"))\n\t}\n\n\treturn nil\n}\n\n// GetDeployStatusByHash returns the DeployStatus for the given config hash\n// (stored with orgId prefix). Returns DeployStatusUnknown when no matching row exists.\nfunc (r *Repo) GetDeployStatusByHash(ctx context.Context, orgId valuer.UUID, configHash string) (opamptypes.DeployStatus, error) {\n\tvar version opamptypes.AgentConfigVersion\n\terr := r.store.BunDB().NewSelect().\n\t\tModel(&version).\n\t\tColumnExpr(\"deploy_status\").\n\t\tWhere(\"hash = ?\", configHash).\n\t\tWhere(\"org_id = ?\", orgId).\n\t\tScan(ctx)\n\tif err != nil {\n\t\tif errors.Is(err, sql.ErrNoRows) {\n\t\t\treturn opamptypes.DeployStatusUnknown, nil","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/agentConf/db.go#L208-L244","documentation":"The agentConf updateDeployStatus gorm Exec (update filtered by version, element_type, org_id) returned an error; the DB failure is logged and surfaced as a BadRequest 'failed to update deploy status'. Triggered on the deployment path of agent config operations.","triggerScenarios":"RecommendAgentConfig, Redeploy, UpsertFilterProcessor, or UpsertSamplingProcessor reaching the status update when the DB is unavailable, the row is locked, or the schema is missing.","commonSituations":"DB outages, pending migrations for the agent config tables, lock contention with concurrent deploys, or an org/version combination that violates constraints.","solutions":["Check query-service logs for the logged underlying error (errors.Attr)","Verify DB connectivity and agent-conf migrations","Retry the deploy operation once the DB is healthy","Avoid concurrent config deploys for the same org/version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Retry the deploy operation with backoff for transient DB errors; surface the logged underlying error when persisting.","preventionTips":["Keep agent-conf migrations current","Avoid concurrent deploys to the same org/version","Monitor DB error logs during deploys"],"tags":["database","agent-conf","opamp","deployment"],"backgroundTag":"database-write-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}