Skip to content

Unable to push Charts to OCI repos that have '<project-name>/<chart-name>' naming convention

0

Hello ,

We use ECR to host our Helm Charts.

While push helm chart to a ECR repo with <project-name>/<chart-name>, we used to get the error of

Cmd :

helm push ./charts/argo-cd-7.8.2.tgz oci://<account-id>.dkr.ecr.eu-central-1.amazonaws.com/utiq/argo --debug

Error Msg :

body="{"errors":[{"code":"NAME_UNKNOWN","message":"The repository with name 'argo-cd' does not exist in the registry with id '<ACCOUNT-ID>'"}]}\n" resp="&{404 Not Found 404 HTTP/1.1 1 1 map[Content-Length:[138] Content-Type:[application/json; charset=utf-8] Date:[Mon, 17 Feb 2025 09:09:38 GMT] Docker-Distribution-Api-Version:[registry/2.0] Sizes:[]] {0xc0002c68e0} 138 [] false false map[] 0xc0004f19e0 0xc000388630}" Error: unexpected status from POST request to https://<ACCOUNT-ID>.dkr.ecr.<REGION>.amazonaws.com/v2/argo-cd/blobs/uploads/: 404 Not Found

Whereas, when pushing the chart to ECR with name <chart-name-only>, I get dont get this error

CMD:

helm push argo-cd-7.8.2.tgz oci://<account-id>.dkr.ecr.eu-central-1.amazonaws.com

Green Response :

DEBU[0000] fetch response received response.header.content-length=0 response.header.date="Mon, 17 Feb 2025 09:18:42 GMT" response.header.docker-content-digest="sha256:d1777c756ce4c703d66932ec09ad66ba3a4a14f78a99f4a1e7c31cb6a404e4a3" response.header.docker-distribution-api-version=registry/2.0 response.header.sizes=1112.000000 response.status="201 Created" url="https://<ACCOUNT-ID>.dkr.ecr.eu-central-1.amazonaws.com/v2/argo-cd/manifests/7.8.2" Pushed: <ACCOUNT-ID>.dkr.ecr.<REGION>.amazonaws.com/argo-cd:7.8.2


Require to understand few things

  • What this the reason behind this behavior.
  • As we are required to adhere to a certain naming convention that would include : <project-name>/<chart-name>, How do I push chart to these ECR Repos
1 Answer
0

The issue you're experiencing is related to how Amazon ECR handles repository names and how Helm interacts with OCI-compliant registries.

  1. Reason for the behavior: When you try to push a Helm chart to an ECR repository with a name like "utiq/argo", ECR interprets this as two separate components: "utiq" as the repository name and "argo" as the image name. However, ECR doesn't support nested repository structures like Docker Hub does. Each repository in ECR needs to be created separately.

In your first attempt, Helm is trying to push to a repository named "argo-cd" (derived from the chart name), which doesn't exist in your ECR. This is why you're getting the "NAME_UNKNOWN" error.

In your second attempt, where you're pushing directly to the root of your ECR without specifying a repository, it's creating or using a repository named after your chart ("argo-cd" in this case), which is why it succeeds.

  1. How to push charts to ECR repos with the required naming convention:

To adhere to your naming convention of <project-name>/<chart-name> while pushing to ECR, you'll need to:

a) Create the repository in ECR beforehand with the full name you want to use. For example:

aws ecr create-repository --repository-name utiq/argo-cd --region eu-central-1

b) When pushing the Helm chart, use the full repository name in your command:

helm push ./charts/argo-cd-7.8.2.tgz oci://<account-id>.dkr.ecr.eu-central-1.amazonaws.com/utiq/argo-cd

By creating the repository with the full name first and then using that exact name in your helm push command, you should be able to successfully push your charts to ECR while maintaining your desired naming convention.

Remember to ensure that your IAM permissions allow you to create repositories and push images to ECR. If you encounter any permission-related issues, you may need to update your IAM policies to grant the necessary permissions for ECR operations.
Sources
Pushing a Helm chart to an Amazon ECR private repository - Amazon ECR
Pushing an image to an Amazon ECR private repository - Amazon ECR
Troubleshooting Docker commands and issues when using Amazon ECR - Amazon ECR

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.