{"record":{"id":"f90a51e234c3b9f4","repo":"hashicorp/packer","slug":"there-is-no-version-associated-with-the-channel-s","errorCode":null,"errorMessage":"there is no version associated with the channel %s","messagePattern":"there is no version associated with the channel (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"datasource/hcp-packer-artifact/data.go","lineNumber":195,"sourceCode":"\t\t\t)\n\t\t}\n\t} else {\n\t\tlog.Printf(\n\t\t\t\"[INFO] Reading info from HCP Packer Registry (%s) \"+\n\t\t\t\t\"[project_id=%s, organization_id=%s, channel=%s]\",\n\t\t\td.config.BucketName, cli.ProjectID, cli.OrganizationID, d.config.ChannelName,\n\t\t)\n\n\t\tvar channel *hcpPackerModels.HashicorpCloudPacker20230101Channel\n\t\tchannel, err = cli.GetChannel(ctx, d.config.BucketName, d.config.ChannelName)\n\t\tif err != nil {\n\t\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\t\"error retrieving channel from HCP Packer Registry: %s\", err.Error(),\n\t\t\t)\n\t\t}\n\n\t\tif channel.Version == nil {\n\t\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\t\"there is no version associated with the channel %s\", d.config.ChannelName,\n\t\t\t)\n\t\t}\n\t\tchannelID = channel.ID\n\t\tversion = channel.Version\n\t}\n\n\tif *version.Status == hcpPackerModels.HashicorpCloudPacker20230101VersionStatusVERSIONREVOKED {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\n\t\t\t\"the version %s is revoked and can not be used on Packer builds\", version.ID,\n\t\t)\n\t}\n\n\tvar output DatasourceOutput\n\n\tcloudAndRegions := map[string][]string{}\n\tfor _, build := range version.Builds {\n\t\tif build.Platform != d.config.Platform {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-artifact/data.go#L177-L213","documentation":"Returned when the requested HCP Packer channel exists but channel.Version is nil after a successful GetChannel() call. A channel in HCP Packer is a pointer to a version; a newly created channel (or one whose assigned version was removed) can be empty. Packer cannot resolve an image from an empty channel, so Execute() fails.","triggerScenarios":"channel_name is set, GetChannel() succeeds, but the returned channel has a nil Version field — the channel was created but never assigned a version, or its version assignment was cleared/deleted.","commonSituations":"A 'staging' channel created before the first publish; a version was removed from the channel during revocation cleanup; the publishing pipeline targets a different bucket than the consuming datasource.","solutions":["Assign a version to the channel (run the publishing packer build, or assign one in the HCP Packer UI).","Verify the publishing pipeline targets the same bucket_name and project as this datasource.","Use version_fingerprint directly if you need a specific version instead of the channel pointer.","Check whether automation (revocation policies, cleanup jobs) recently unassigned the channel's version."],"exampleFix":"// before\ndata \"hcp-packer-artifact\" \"foo\" {\n  bucket_name = \"my-bucket\"\n  channel_name = \"staging\" # no version assigned yet\n}\n// after: publish a build that bootstraps the channel, or assign a version in the HCP UI\ndata \"hcp-packer-artifact\" \"foo\" {\n  bucket_name = \"my-bucket\"\n  channel_name = \"staging\" # now pointing at a published version\n}","handlingStrategy":"validation","validationCode":"// Before running builds that consume the channel, assert it points at a version via the HCP API:\n// GET /packer/2023-01-01/.../channels/<name> -> 200 with non-null version means safe to proceed.\nif channelVersion == null {\n    return fmt.Errorf(\"channel %s has no assigned version; refusing to build\", channel)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bootstrap channels with `packer bootstrap` immediately after creating them.","Add a pipeline gate that fails if a channel has no assigned version.","Avoid creating channels before the first successful publish."],"tags":["hcp-packer","channel","registry-state","datasource"],"backgroundTag":"empty-registry-channel","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"}