{"record":{"id":"4c6bf98bb6aecf10","repo":"hashicorp/packer","slug":"the-hcp-packer-version-associated-with-the-channel","errorCode":null,"errorMessage":"the HCP Packer Version associated with the channel %s is revoked and can not be used on Packer builds","messagePattern":"the HCP Packer Version associated with the channel (.+?) is revoked and can not be used on Packer builds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"datasource/hcp-packer-version/data.go","lineNumber":130,"sourceCode":"\n\tchannel, err := cli.GetChannel(ctx, d.config.BucketName, d.config.ChannelName)\n\tif err != nil {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\"error retrieving HCP Packer Version from HCP Packer Registry: %s\",\n\t\t\terr.Error(),\n\t\t)\n\t}\n\tif channel.Version == nil {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\"there is no HCP Packer Version associated with the channel %s\",\n\t\t\td.config.ChannelName,\n\t\t)\n\t}\n\n\tversion := channel.Version\n\n\tif *version.Status == hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\"the HCP Packer Version associated with the channel %s is revoked and can not be used on Packer builds\",\n\t\t\td.config.ChannelName,\n\t\t)\n\t}\n\n\toutput := DatasourceOutput{\n\t\tAuthorID:    version.AuthorID,\n\t\tBucketName:  version.BucketName,\n\t\tStatus:      string(*version.Status),\n\t\tCreatedAt:   version.CreatedAt.String(),\n\t\tFingerprint: version.Fingerprint,\n\t\tID:          version.ID,\n\t\tName:        version.Name,\n\t\tUpdatedAt:   version.UpdatedAt.String(),\n\t\tChannelID:   channel.ID,\n\t}\n\n\treturn hcl2helper.HCL2ValueFromConfig(output, d.OutputSpec()), nil","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-version/data.go#L112-L148","documentation":"The version the channel points to has status VERSION_REVOKED, meaning it was deliberately marked unusable in HCP Packer (e.g., after a security incident or bad build). Revoked versions are excluded from builds, so the datasource refuses to return it.","triggerScenarios":"Channel lookup succeeds and a version is attached, but version.Status is HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED.","commonSituations":"Ops revoked a compromised image version; channels were not re-pointed; CI pipelines still referencing the revoked channel break during `packer init`/build.","solutions":["Re-point the channel to a healthy version in the HCP Packer UI","If the revocation was accidental, restore/un-revoke the version in HCP","Pin the datasource to a specific version via a channel that tracks an approved version","Update the template to use a different bucket/channel"],"exampleFix":"// before\nchannel_name = \"prod\" // points to revoked version\n// after\nchannel_name = \"prod-approved\" // points to healthy version","handlingStrategy":"validation","validationCode":"// check version status before use\nif channel.Version != nil && channel.Version.Status == \"VERSION_REVOKED\" { panic(\"channel points to revoked version\") }","typeGuard":"func usable(v *hcpPackerModels.Version) bool { return v != nil && v.Status != hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED }","tryCatchPattern":null,"preventionTips":["Re-point channels immediately after revoking a version","Monitor HCP registry for revocation events affecting active channels","Prefer channels that automation keeps pointed at healthy versions"],"tags":["hcp","datasource","revoked-version"],"backgroundTag":"hcp-version-revoked","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"}