{"record":{"id":"98e54104c9010f77","repo":"hashicorp/packer","slug":"cannot-modify-status-of-done-build-s","errorCode":null,"errorMessage":"cannot modify status of DONE build %s","messagePattern":"cannot modify status of DONE build (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/registry/types.bucket.go","lineNumber":280,"sourceCode":"// For updating a build status to DONE use CompleteBuild.\nfunc (bucket *Bucket) UpdateBuildStatus(\n\tctx context.Context, name string, status hcpPackerModels.HashicorpCloudPacker20230101BuildStatus,\n) error {\n\tif status == hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE {\n\t\treturn fmt.Errorf(\"do not use UpdateBuildStatus for updating to DONE\")\n\t}\n\n\tbuildToUpdate, err := bucket.Version.Build(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif buildToUpdate.ID == \"\" {\n\t\treturn fmt.Errorf(\"the build for the component %q does not have a valid id\", name)\n\t}\n\n\tif buildToUpdate.Status == hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE {\n\t\treturn fmt.Errorf(\"cannot modify status of DONE build %s\", name)\n\t}\n\n\t_, err = bucket.client.UpdateBuild(ctx,\n\t\tbucket.Name,\n\t\tbucket.Version.Fingerprint,\n\t\tbuildToUpdate.ID,\n\t\tbuildToUpdate.RunUUID,\n\t\t\"\",\n\t\t\"\",\n\t\t\"\",\n\t\t\"\",\n\t\tnil,\n\t\tstatus,\n\t\tnil,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/registry/types.bucket.go#L262-L298","documentation":"HCP registry guard from Bucket.UpdateBuildStatus: the target build is already DONE and HCP does not allow modifying a completed build's status, so the update is rejected to avoid corrupting the finished build.","triggerScenarios":"Thrown at internal/hcp/registry/types.bucket.go:280 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip status updates for builds already marked DONE","Create a new version/fingerprint for further changes instead of mutating the completed build"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}