{"record":{"id":"27fedd4244888d43","repo":"hashicorp/packer","slug":"setting-a-build-to-done-with-no-published-artifact","errorCode":null,"errorMessage":"setting a build to DONE with no published artifacts is not currently supported","messagePattern":"setting a build to DONE with no published artifacts is not currently supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/registry/types.bucket.go","lineNumber":360,"sourceCode":"func (bucket *Bucket) markBuildComplete(ctx context.Context, name string) error {\n\tbuildToUpdate, err := bucket.Version.Build(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif buildToUpdate.ID == \"\" {\n\t\treturn fmt.Errorf(\"the build for the component %q does not have a valid id\", name)\n\t}\n\n\tstatus := hcpPackerModels.HashicorpCloudPacker20230101BuildStatusBUILDDONE\n\n\tif buildToUpdate.Status == status {\n\t\t// let's no mess with anything that is already done\n\t\treturn nil\n\t}\n\n\tif len(buildToUpdate.Artifacts) == 0 {\n\t\treturn fmt.Errorf(\"setting a build to DONE with no published artifacts is not currently supported\")\n\t}\n\n\tvar platformName, sourceID, parentVersionID, parentChannelID string\n\tartifacts := make([]*hcpPackerModels.HashicorpCloudPacker20230101ArtifactCreateBody, 0, len(buildToUpdate.Artifacts))\n\tfor _, artifact := range buildToUpdate.Artifacts {\n\t\t// These values will always be the same for all artifacts in a single build,\n\t\t// so we can just set it inside the loop without consequence\n\t\tif platformName == \"\" {\n\t\t\tplatformName = artifact.ProviderName\n\t\t}\n\t\tif artifact.SourceImageID != \"\" {\n\t\t\tsourceID = artifact.SourceImageID\n\t\t}\n\n\t\t// Check if artifact is using some other HCP Packer artifact\n\t\tif v, ok := bucket.SourceExternalIdentifierToParentVersions[artifact.SourceImageID]; ok {\n\t\t\tparentVersionID = v.VersionID\n\t\t\tparentChannelID = v.ChannelID","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/registry/types.bucket.go#L342-L378","documentation":"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.","triggerScenarios":"Thrown at internal/hcp/registry/types.bucket.go:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the build published at least one artifact to HCP (e.g. share AMIs via hcp_packer_registry) before completing","Check earlier publish/post-processor steps failed silently and left the artifact list empty"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}