hashicorp/packer · error

setting a build to DONE with no published artifacts is not c

Error message

setting a build to DONE with no published artifacts is not currently supported

What it means

HCP registry guard from markBuildComplete: the build was asked to transition to DONE but has no registered artifacts (images). HCP requires at least one published artifact before a build can be completed, so the completion is refused.

Source

Thrown at internal/hcp/registry/types.bucket.go:360

func (bucket *Bucket) markBuildComplete(ctx context.Context, name string) error {
	buildToUpdate, err := bucket.Version.Build(name)
	if err != nil {
		return err
	}

	if buildToUpdate.ID == "" {
		return fmt.Errorf("the build for the component %q does not have a valid id", name)
	}

	status := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE

	if buildToUpdate.Status == status {
		// let's no mess with anything that is already done
		return nil
	}

	if len(buildToUpdate.Artifacts) == 0 {
		return fmt.Errorf("setting a build to DONE with no published artifacts is not currently supported")
	}

	var platformName, sourceID, parentVersionID, parentChannelID string
	artifacts := make([]*hcpPackerModels.HashicorpCloudPacker20230101ArtifactCreateBody, 0, len(buildToUpdate.Artifacts))
	for _, artifact := range buildToUpdate.Artifacts {
		// These values will always be the same for all artifacts in a single build,
		// so we can just set it inside the loop without consequence
		if platformName == "" {
			platformName = artifact.ProviderName
		}
		if artifact.SourceImageID != "" {
			sourceID = artifact.SourceImageID
		}

		// Check if artifact is using some other HCP Packer artifact
		if v, ok := bucket.SourceExternalIdentifierToParentVersions[artifact.SourceImageID]; ok {
			parentVersionID = v.VersionID
			parentChannelID = v.ChannelID

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Ensure the build published at least one artifact to HCP (e.g. share AMIs via hcp_packer_registry) before completing
  2. Check earlier publish/post-processor steps failed silently and left the artifact list empty
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/hcp/registry/types.bucket.go:360 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/27fedd4244888d43. Report an issue: GitHub.