FROM line of your Dockerfile during the build, or for a service deployed from a container registry.
401 Unauthorized from a private ECR registry
Cause
Qovery tried to read an image from a private registry without valid credentials for it. It happens most often when theFROM line of a Dockerfile points to a private ECR repository: the build only logs in to the registries declared in your organization, so a registry that is not declared is pulled anonymously and refused.
Fix
1
Declare the registry in your organization
Go to Organization Settings, then Container Registries, and click Add Registry. Choose ECR and set the registry URL to the host used in your image reference, with the protocol:The account ID and the region must be the ones of the repository, not of your cluster. During the build, Qovery logs in to the registries of your organization that your Dockerfile uses, so the
FROM line can pull from it.2
Give the credentials read access
Use Assume role via STS (recommended) or static access keys. Either way, the identity needs
ecr:GetAuthorizationToken on * and the read actions (ecr:BatchGetImage, ecr:GetDownloadUrlForLayer, ecr:BatchCheckLayerAvailability) on the repositories. The full policy is in AWS ECR with STS assume role.3
Cross-account repositories
If the repository is in another AWS account than the role or the access keys, the IAM policy is not enough: the policy of each repository must also allow that role or user for the same actions.
4
Check the external ID condition
With STS, if the trust policy of the role has an
sts:ExternalId condition, it must list the Qovery ID of the registry and the all-zeros value 00000000-0000-0000-0000-000000000000. Without the registry ID, every deployment that pulls from this registry fails, even though the Console can validate the registry. Without the all-zeros value, the Console cannot validate the registry or list your images. See Trust policy.5
Deploy again
The deployment logs show a login to the registry before the build pulls the image.
429 Too Many Requests from Docker Hub
Cause
Docker Hub limits anonymous pulls per source IP address. Your builds and nodes reach the internet through a small number of IP addresses (the NAT gateways of the cluster, for example), so all your services share one anonymous quota. Busy days, many services using public base images such asnode or python, or preview environments, use it up quickly. The limit can also be reached by other traffic from the same IP addresses.
Fix
Authenticate to Docker Hub so that pulls count against your own account:- Create a Docker Hub access token (Docker Hub Account Settings, then Security, then New Access Token).
- In Qovery, go to Organization Settings, then Container Registries, click Add Registry, choose Docker Hub, and enter your Docker Hub username and the token. See Docker Hub.
- Deploy again. Builds log in to Docker Hub before pulling the
FROMimages. Services deployed from a Docker Hub image must use this registry.
- Pull official images from the Amazon ECR Public Gallery mirror, for example
FROM public.ecr.aws/docker/library/node:20instead ofFROM node:20. - Copy the base images you use to your own registry and reference them from there.
On Qovery-managed EKS clusters that use Karpenter, the cluster advanced setting
aws.ecr.enable_pull_through_cache caches the public ECR images used by Qovery components. It does not cache your own images or Docker Hub images.Related
- Image mirroring: how Qovery copies the image of each service to the registry of the cluster before deploying it.
- Container registries