{"record":{"id":"cb43e26ff215c273","repo":"hashicorp/packer","slug":"something-went-wrong-retrieving-the-version-for-bu","errorCode":null,"errorMessage":"something went wrong retrieving the version for bucket %s","messagePattern":"something went wrong retrieving the version for bucket (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/api/service_version.go","lineNumber":60,"sourceCode":"\nfunc (c *Client) GetVersion(\n\tctx context.Context, bucketName string, fingerprint string,\n) (*hcpPackerModels.HashicorpCloudPacker20230101Version, error) {\n\tparams := hcpPackerAPI.NewPackerServiceGetVersionParams()\n\tparams.LocationOrganizationID = c.OrganizationID\n\tparams.LocationProjectID = c.ProjectID\n\tparams.BucketName = bucketName\n\tparams.Fingerprint = fingerprint\n\n\tresp, err := c.Packer.PackerServiceGetVersion(params, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.Payload.Version != nil {\n\t\treturn resp.Payload.Version, nil\n\t}\n\n\treturn nil, fmt.Errorf(\n\t\t\"something went wrong retrieving the version for bucket %s\", bucketName,\n\t)\n}\n","sourceCodeStart":42,"sourceCodeEnd":65,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/api/service_version.go#L42-L65","documentation":"GetVersion fetches a specific version (by fingerprint) of a bucket from HCP Packer; when the API call succeeds but resp.Payload.Version is nil, it throws this error. It is called from initializeVersion when builders/datasources resolve a bucket version, meaning the requested version was not returned by the service.","triggerScenarios":"PackerServiceGetVersion succeeds but resp.Payload.Version == nil — the fingerprint/version does not exist or is not visible for bucketName.","commonSituations":"Referencing a version fingerprint that was soft-deleted by HCP Packer's 90-day incomplete-version GC; wrong bucket name; version not yet published (build still running); revoked version restored incorrectly.","solutions":["Verify the bucket name and version fingerprint in the HCP Packer registry.","Check whether the version was soft-deleted/garbage collected and restore or revoke it properly.","Ensure the version's builds completed and were published before referencing it.","Re-run the source build to publish a fresh version/fingerprint."],"exampleFix":"// before\nversion, err := client.GetVersion(ctx, \"my-bucket\", staleFingerprint) // purged version\n// after\n// re-run the builder to publish a new version, then use its fingerprint\nversion, err := client.GetVersion(ctx, \"my-bucket\", newFingerprint)","handlingStrategy":"try-catch","validationCode":"// verify the version is published and not revoked before use\nif !versionIsPublished(registry, bucketName, fingerprint) {\n    return fmt.Errorf(\"version %s not published for bucket %s\", fingerprint, bucketName)\n}","typeGuard":null,"tryCatchPattern":"version, err := client.GetVersion(ctx, bucketName, fingerprint)\nif err != nil {\n    if strings.Contains(err.Error(), \"something went wrong retrieving the version\") {\n        return fmt.Errorf(\"version %q missing in bucket %q (purged or unpublished)\", fingerprint, bucketName)\n    }\n    return err\n}","preventionTips":["Only reference fingerprints from completed, published builds.","Revoke rather than delete versions that downstream builds still reference.","Watch for the 90-day soft-delete window for incomplete versions."],"tags":["hcp","packer-registry","version"],"backgroundTag":"hcp-version-not-found","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"}