Cryptic error when using hcp_packer_registry

I am building an image for Linode using the official Linode provider plugin: GitHub - linode/packer-plugin-linode: Packer plugin for Linode Builder

When I add the HCP Packer Registry block with hcp_packer_registry, I get this cryptic error.

I could not find any additional documentation on how to resolve this.

I followed the Push Image Metadata to the HCP Packer Registry | Packer | HashiCorp Developer guide.

Tracking build on HCP Packer with fingerprint "xxxxxxxxxxxxxxxxxxxxxxxx"
Error: HCP: populating iteration failed

Failed to create client connection to artifact registry: status 1: err unable to
fetch project id: [GET /resource-manager/2019-12-10/projects][403]
ProjectService_List default  &{Code:7 Details:[] Error: Message:}

I also meet this problem, i dont kown why

Facing the same error since evening.

I have managed to resolve this by creating the service principal at the account level instead of the project level.

1 Like

This worked for me as well.
Thanks for the tip.

Just want to chime in to mention that support for project level service principles was added in Packer v1.9.3.

Previously Packer would fail because PLSP do not have the appropriate permissions for querying projects. This is the cryptic error mentioned above.

When using a PLSP with Packer v1.9.3+ you must specify the HCP_PROJECT_ID environment variable assigned to the project id associated with the PSLP.

More details on usage can be found at HCP Packer | Packer | HashiCorp Developer