{"record":{"id":"d7ea5ca0f7b964d2","repo":"hashicorp/packer","slug":"the-iteration-associated-with-the-channel-s-is-re","errorCode":null,"errorMessage":"the iteration associated with the channel %s is revoked and can not be used on Packer builds","messagePattern":"the iteration 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-iteration/data.go","lineNumber":131,"sourceCode":"\t\td.config.Bucket, cli.ProjectID, cli.OrganizationID, d.config.Channel)\n\n\tchannel, err := cli.GetChannel(ctx, d.config.Bucket, d.config.Channel)\n\tif err != nil {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\"error retrieving \"+\n\t\t\t\"iteration from HCP Packer registry: %s\", err.Error())\n\t}\n\tif channel.Iteration == nil {\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\"there is no iteration associated with the channel %s\",\n\t\t\td.config.Channel)\n\t}\n\n\titeration := channel.Iteration\n\n\trevokeAt := time.Time(iteration.RevokeAt)\n\tif !revokeAt.IsZero() && revokeAt.Before(time.Now().UTC()) {\n\t\t// If RevokeAt is not a zero date and is before NOW, it means this iteration is revoked and should not be used\n\t\t// to build new images.\n\t\treturn cty.NullVal(cty.EmptyObject), fmt.Errorf(\"the iteration associated with the channel %s is revoked and can not be used on Packer builds\",\n\t\t\td.config.Channel)\n\t}\n\n\toutput := DatasourceOutput{\n\t\tAuthorID:           iteration.AuthorID,\n\t\tBucketName:         iteration.BucketSlug,\n\t\tComplete:           iteration.Complete,\n\t\tCreatedAt:          iteration.CreatedAt.String(),\n\t\tFingerprint:        iteration.Fingerprint,\n\t\tID:                 iteration.ID,\n\t\tIncrementalVersion: iteration.IncrementalVersion,\n\t\tUpdatedAt:          iteration.UpdatedAt.String(),\n\t\tChannelID:          channel.ID,\n\t}\n\n\treturn hcl2helper.HCL2ValueFromConfig(output, d.OutputSpec()), nil\n}\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-iteration/data.go#L113-L149","documentation":"The iteration attached to the configured channel has a non-zero RevokeAt timestamp in the past, so it is revoked. The hcp-packer-iteration datasource refuses to emit iteration data for revoked iterations, preventing downstream hcp-packer-image blocks or builds from using revoked image metadata. Unlike error 41, the message names the channel rather than the iteration ID.","triggerScenarios":"Execute resolves channel.Iteration successfully, then time.Time(iteration.RevokeAt) is non-zero and before time.Now().UTC(), triggering this return before building the DatasourceOutput.","commonSituations":"Channel still pointing at an iteration revoked via HCP Packer's revocation UI/CLI; scheduled revocations auto-triggered; CI pinned to a channel after a security rollback; forgetting that revocation affects every template referencing the channel.","solutions":["Repoint the channel to a newer, non-revoked iteration in the HCP Packer registry.","Update templates to use a channel that tracks current releases.","If revoked by mistake, restore/unrevoke the iteration in HCP Packer and rebuild.","Audit scheduled revocation/rollback policies that may have flipped the channel."],"exampleFix":"// before\ndata \"hcp-packer-iteration\" \"iter\" {\n  bucket_name = \"my-app\"\n  channel     = \"prod\" // -> iteration revoked 2024-01-01\n}\n// after\n// In HCP: repoint 'prod' to the latest valid iteration, then rebuild.\ndata \"hcp-packer-iteration\" \"iter\" {\n  bucket_name = \"my-app\"\n  channel     = \"prod\"\n}","handlingStrategy":"validation","validationCode":"// Check the channel's iteration revocation before building:\n// hcp packer channels show <channel> --bucket=my-app --format=json | jq -e --argjson now \"$(date +%s)\" '.iteration.revoke_at == null or (fromdateiso8601(.iteration.revoke_at) > $now)'","typeGuard":null,"tryCatchPattern":"out=$(packer build template.pkr.hcl 2>&1) || {\n  echo \"$out\" | grep -q 'is revoked and can not be used' && echo \"Repoint channel '$CH' to a non-revoked iteration\"\n  exit 1\n}","preventionTips":["Repoint channels immediately after revoking iterations.","Monitor HCP Packer revocation events and trigger channel updates automatically.","Document revocation ownership so template consumers know who maintains channels.","Prefer channels over pinned iteration IDs so updates happen in one place."],"tags":["hcp-packer","revocation","datasource","lifecycle"],"backgroundTag":"hcp-iteration-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"}