Skip to main content

While working with lando, I had the following error

ERROR: for safs_appserver_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for safs_database_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for appserver  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for database  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.

If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 300).

How to override the default value of COMPOSE_HTTP_TIMEOUT with docker-compose command?

For some, they were able to correct this issue by executing the following command:

COMPOSE_HTTP_TIMEOUT=500 docker-compose up

However, that wasn't the situation for me.

Instead, I found by altering the .env file in your site's root directory was successful.  Edit the file, which I did via shell

vim .env

Run a find command in the file to cross check if it already exists.  For me it didn't.  So I added the line

COMPOSE_HTTP_TIMEOUT=500

As a change has been made to Docker composer file, I needed to restart Docker for the change to be recognised.  Execute the following:

killall Docker && open /Applications/Docker.app

If the above fails, then try

pkill Docker
open -a /Applications/Docker.app

Once Docker has restarted, now rebuild lando.

lando rebuild