Problem
During a Terraform Enterprise installation or upgrade, the process fails with a toomanyrequests error when pulling a Docker image.
Trying to pull repository docker.io/replicated/replicated ... toomanymanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Cause
Docker Hub enforces rate limits on image pulls based on the source IP address and user account type. Unauthenticated requests are limited to 100 pulls per six hours per IP address.
This limit can be reached if:
- The Terraform Enterprise installation is retried multiple times.
- Other unauthenticated Docker requests originate from the same outbound IP address, such as from a shared proxy.
When the limit is reached, you may need to wait up to six hours for it to reset. Authenticating with a Docker Hub account (Free tier or higher) can increase or remove this limitation.
Solutions
Attempt the solutions in the order they are presented.
Solution 1: Add docker.io to the no_proxy list
In some network environments, adding docker.io to the additional-no-proxy attribute can resolve the issue. Run the installer with the following flag.
$ ./install.sh additional-no-proxy=docker.io
If this does not resolve the issue, proceed to Solution 2.
Solution 2: Authenticate with Docker Hub credentials
You can configure the installer to use your Docker Hub credentials, which provides a higher rate limit.
- On your Terraform Enterprise server, create a configuration file named
replicated.confin the/etcdirectory. -
Add the following JSON content to
/etc/replicated.conf, replacing the placeholder values with your Docker Hub username and password or an access token.{ "DockerHubUsername": "EnterUsernameHere", "DockerHubPassword": "EnterPasswordHere" } - Save the file.
-
Log in to the Docker registry to verify your credentials.
$ docker login
-
Rerun the installation script.
$ ./install.sh