hashicorp/packer · error
No active HCP Packer registry was found for the organization
Error message
No active HCP Packer registry was found for the organization %q and project %q
What it means
ValidateRegistryForProject calls PackerServiceGetRegistry for the resolved organization/project and throws this when the API succeeds but returns no Registry object — i.e. no active HCP Packer registry exists for that org/project combination. Called by loadProjectID when HCP_PROJECT_ID is set, and also before registry operations. It confirms credentials work but the target has no registry.
Source
Thrown at internal/hcp/api/client.go:203
}
}
return oldestProj, nil
}
// ValidateRegistryForProject validates that there is an active registry associated to the configured organization and project ids.
// A successful validation will result in a nil response. All other response represent an invalid registry error request or a registry not found error.
func (c *Client) ValidateRegistryForProject() error {
params := packerSvc.NewPackerServiceGetRegistryParams()
params.LocationOrganizationID = c.OrganizationID
params.LocationProjectID = c.ProjectID
resp, err := c.Packer.PackerServiceGetRegistry(params, nil)
if err != nil {
return err
}
if resp.GetPayload().Registry == nil {
return fmt.Errorf("No active HCP Packer registry was found for the organization %q and project %q", c.OrganizationID, c.ProjectID)
}
return nil
}
View on GitHub (pinned to eb36e3c3e4)
Solutions
- Create/activate an HCP Packer registry in the target project via the HCP console.
- Point HCP_PROJECT_ID (or the project config) at the project that actually hosts the registry.
- Verify registry status in the HCP console under Packer > Registry.
Example fix
// before export HCP_PROJECT_ID="proj-without-registry" // after export HCP_PROJECT_ID="proj-with-active-registry" // or create a registry in proj-without-registry
Defensive patterns
Strategy: validation
Validate before calling
// confirm a registry exists before building with HCP metadata
if err := client.ValidateRegistryForProject(); err != nil {
return fmt.Errorf("create an HCP Packer registry in project %s first: %w", projectID, err)
} Try / catch
if err := client.ValidateRegistryForProject(); err != nil {
if strings.Contains(err.Error(), "No active HCP Packer registry") {
return fmt.Errorf("enable the HCP Packer registry for org=%s project=%s", orgID, projectID)
}
return err
} Prevention
- Create the HCP Packer registry once per project in the HCP console before first use.
- Verify HCP_PROJECT_ID points at the project hosting the registry.
- Check registry status after org/project changes or deletions.
When it happens
Trigger: PackerServiceGetRegistry returns success with resp.GetPayload().Registry == nil for c.OrganizationID/c.ProjectID; happens in loadProjectID after reading HCP_PROJECT_ID, or on direct ValidateRegistryForProject calls.
Common situations: HCP Packer registry was never created (or was deactivated) in the target project; HCP_PROJECT_ID points at a project without a registry; registry deleted after being provisioned.
Related errors
- InvalidClientConfig
- unexpected number of organizations: expected 1, actual: %v
- no project found
- something went wrong retrieving the iteration for bucket %s
- there is no channel with the name %s associated with the buc
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/f97d1829ad5281a5.
Report an issue: GitHub.