{"record":{"id":"c265866cea9a206a","repo":"SigNoz/signoz","slug":"codeinternal-c26586","errorCode":"CodeInternal","errorMessage":"unable to update license with ID: %s","messagePattern":"unable to update license with ID: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":500,"severity":"error","filePath":"ee/licensing/licensingstore/sqllicensingstore/store.go","lineNumber":77,"sourceCode":"\t\tScan(ctx)\n\tif err != nil {\n\t\treturn nil, store.sqlstore.WrapNotFoundErrf(err, errors.CodeNotFound, \"licenses for organizationID: %s does not exists\", organizationID)\n\t}\n\n\treturn storableLicenses, nil\n}\n\nfunc (store *store) Update(ctx context.Context, organizationID valuer.UUID, storableLicense *licensetypes.StorableLicense) error {\n\t_, err := store.\n\t\tsqlstore.\n\t\tBunDB().\n\t\tNewUpdate().\n\t\tModel(storableLicense).\n\t\tWherePK().\n\t\tWhere(\"org_id = ?\", organizationID).\n\t\tExec(ctx)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, errors.TypeInternal, errors.CodeInternal, \"unable to update license with ID: %s\", storableLicense.ID)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":59,"sourceCodeEnd":82,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/licensing/licensingstore/sqllicensingstore/store.go#L59-L82","documentation":"sqllicensingstore.Update failed to persist the storable license via bun's NewUpdate (WherePK + org filter); the DB error is wrapped as CodeInternal with the license ID.","triggerScenarios":"Refresh/Activate flows writing the license when the row's PK no longer exists, org_id doesn't match the WHERE clause, DB is down/schemaclass mismatch, or a constraint violation occurs on update.","commonSituations":"Stored license row deleted out-of-band so UPDATE matches 0 rows or errors; Postgres unavailable mid-request; migration not applied for new licensing columns; org context mismatch after re-provisioning the org.","solutions":["Check the wrapped DB error (connection, constraint, undefined column) and fix accordingly","Run pending migrations so the licensing table schema matches the binary","Re-activate the license to re-create the row if it was deleted","Verify the organizationID in context matches the stored license's org_id"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := store.Update(ctx, orgID, lic); err != nil {\n\tif errors.Ast(err, errors.CodeInternal) { log with storableLicense.ID; if no rows affected → fall back to Create }\n}","preventionTips":["Run DB migrations with each SigNoz upgrade","Use upsert semantics for license persistence","Never delete license rows manually; use deactivate APIs"],"tags":["signoz","licensing","database","update-failed","postgres"],"backgroundTag":"database-update-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}