{"record":{"id":"839f0304b83d6cdc","repo":"hashicorp/packer","slug":"something-went-wrong-retrieving-the-build-s-from","errorCode":null,"errorMessage":"something went wrong retrieving the build %s from bucket %s","messagePattern":"something went wrong retrieving the build (.+?) from bucket (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/api/service_build.go","lineNumber":93,"sourceCode":"\tparams.Body = &hcpPackerModels.HashicorpCloudPacker20230101UpdateBuildBody{\n\t\tArtifacts:                artifacts,\n\t\tLabels:                   buildLabels,\n\t\tPackerRunUUID:            runUUID,\n\t\tParentChannelID:          parentChannelID,\n\t\tParentVersionID:          parentVersionID,\n\t\tPlatform:                 platform,\n\t\tSourceExternalIdentifier: sourceExternalIdentifier,\n\t\tStatus:                   &buildStatus,\n\t\tMetadata:                 metadata,\n\t}\n\n\tresp, err := c.Packer.PackerServiceUpdateBuild(params, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif resp == nil {\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"something went wrong retrieving the build %s from bucket %s\", buildID, bucketName,\n\t\t)\n\t}\n\n\treturn resp.Payload.Build.ID, nil\n}\n\nfunc (c *Client) UploadSbom(\n\tctx context.Context,\n\tbucketName, fingerprint string,\n\tbuildID string,\n\tsbom packer.SBOM,\n) error {\n\n\tparams := hcpPackerAPI.NewPackerServiceUploadSbomParamsWithContext(ctx)\n\tparams.BuildID = buildID\n\tparams.LocationOrganizationID = c.OrganizationID\n\tparams.LocationProjectID = c.ProjectID","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/api/service_build.go#L75-L111","documentation":"UpdateBuild calls PackerServiceUpdateBuild to update a build record in an HCP Packer bucket; when the call succeeds but the response object is nil, it cannot extract the build ID and returns this error. Called by UpdateBuildStatus and markBuildComplete during build status reporting to the registry. A nil response after a nil error is an unexpected API contract violation.","triggerScenarios":"PackerServiceUpdateBuild returns (nil, nil) — no error but no response payload — while updating the build for buildID in bucketName.","commonSituations":"Transient/edge HCP API behavior returning empty responses; build or bucket already removed from the registry mid-update; SDK version drift producing untyped nil responses; concurrent builds deleting the parent version.","solutions":["Retry the build status update; the failure is often transient.","Verify the bucket and version still exist in the HCP Packer registry.","Upgrade the packer-plugin-sdk / HCP API client to the latest version.","Check HCP status page for ongoing incidents if it reproduces."],"exampleFix":"// before\n// no retry around UpdateBuildStatus\n// after\nif err := updateBuildStatusWithRetry(ctx, client, buildID, bucketName, status, 3); err != nil {\n    return fmt.Errorf(\"updating build status: %w\", err)\n}","handlingStrategy":"retry","validationCode":"// ensure the bucket/version still exists before updating builds\nif err := client.GetVersion(ctx, bucketName, fingerprint); err != nil {\n    return fmt.Errorf(\"bucket %s version gone; aborting build update\", bucketName)\n}","typeGuard":null,"tryCatchPattern":"buildID, err := client.UpdateBuild(ctx, bucketName, iterationID, &build)\nif err != nil {\n    if strings.Contains(err.Error(), \"something went wrong retrieving the build\") {\n        return retryWithBackoff(ctx, 3, func() error { _, err := client.UpdateBuild(...); return err })\n    }\n    return err\n}","preventionTips":["Avoid concurrent workflows that delete versions/builds mid-update.","Retry transient registry update failures with backoff.","Keep the HCP API client/SDK up to date to avoid nil-response contract drift."],"tags":["hcp","packer-registry","api-response","build"],"backgroundTag":"hcp-empty-api-response","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"}