hashicorp/packer · error
the iteration associated with the channel %s is revoked and
Error message
the iteration associated with the channel %s is revoked and can not be used on Packer builds
What it means
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.
Source
Thrown at datasource/hcp-packer-iteration/data.go:131
d.config.Bucket, cli.ProjectID, cli.OrganizationID, d.config.Channel)
channel, err := cli.GetChannel(ctx, d.config.Bucket, d.config.Channel)
if err != nil {
return cty.NullVal(cty.EmptyObject), fmt.Errorf("error retrieving "+
"iteration from HCP Packer registry: %s", err.Error())
}
if channel.Iteration == nil {
return cty.NullVal(cty.EmptyObject), fmt.Errorf("there is no iteration associated with the channel %s",
d.config.Channel)
}
iteration := channel.Iteration
revokeAt := time.Time(iteration.RevokeAt)
if !revokeAt.IsZero() && revokeAt.Before(time.Now().UTC()) {
// If RevokeAt is not a zero date and is before NOW, it means this iteration is revoked and should not be used
// to build new images.
return cty.NullVal(cty.EmptyObject), fmt.Errorf("the iteration associated with the channel %s is revoked and can not be used on Packer builds",
d.config.Channel)
}
output := DatasourceOutput{
AuthorID: iteration.AuthorID,
BucketName: iteration.BucketSlug,
Complete: iteration.Complete,
CreatedAt: iteration.CreatedAt.String(),
Fingerprint: iteration.Fingerprint,
ID: iteration.ID,
IncrementalVersion: iteration.IncrementalVersion,
UpdatedAt: iteration.UpdatedAt.String(),
ChannelID: channel.ID,
}
return hcl2helper.HCL2ValueFromConfig(output, d.OutputSpec()), nil
}
View on GitHub (pinned to eb36e3c3e4)
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.
Example fix
// before
data "hcp-packer-iteration" "iter" {
bucket_name = "my-app"
channel = "prod" // -> iteration revoked 2024-01-01
}
// after
// In HCP: repoint 'prod' to the latest valid iteration, then rebuild.
data "hcp-packer-iteration" "iter" {
bucket_name = "my-app"
channel = "prod"
} Defensive patterns
Strategy: validation
Validate before calling
// Check the channel's iteration revocation before building: // 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)'
Try / catch
out=$(packer build template.pkr.hcl 2>&1) || {
echo "$out" | grep -q 'is revoked and can not be used' && echo "Repoint channel '$CH' to a non-revoked iteration"
exit 1
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- the iteration %s is revoked and can not be used on Packer bu
- error retrieving version from HCP Packer Registry: %s
- error retrieving channel from HCP Packer Registry: %s
- there is no version associated with the channel %s
- the version %s is revoked and can not be used on Packer buil
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/d7ea5ca0f7b964d2.
Report an issue: GitHub.