{"record":{"id":"0a43772bce60f219","repo":"hashicorp/packer","slug":"the-build-for-the-component-q-does-not-have-a-val","errorCode":null,"errorMessage":"the build for the component %q does not have a valid id","messagePattern":"the build for the component %q does not have a valid id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/registry/types.bucket.go","lineNumber":276,"sourceCode":"\treturn nil\n}\n\n// UpdateBuildStatus updates the status of a build entry on the HCP Packer registry with its current local status.\n// 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,","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/registry/types.bucket.go#L258-L294","documentation":"HCP registry error from Bucket.UpdateBuildStatus: the local build entry for the named component has an empty ID, meaning it was never registered with HCP (Initialize/startBuild not completed), so its remote status cannot be updated.","triggerScenarios":"Thrown at internal/hcp/registry/types.bucket.go:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure bucket.Initialize ran successfully before updating build statuses","Check earlier errors that may have skipped the initial build creation"],"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"}