Error during install: context deadline exceeded

I'm trying to set up a development environment for an ESP32S3 board but I'm regularly hitting errors like this one:

$ arduino-cli core install esp32:esp32
Downloading packages...
arduino:dfu-util@0.11.0-arduino5 arduino:dfu-util@0.11.0-arduino5 already downloaded
esp32:esp-rv32@2411 context deadline exceeded (Client.Timeout or context cancellation while reading body)                                                                       
Error during install: context deadline exceeded (Client.Timeout or context cancellation while reading body)

This happens whenever a particularly large downloaded is needed. I understand that the problem is most likely due to a slow internet connection, but I can't change that. Is there any way to increase the timeout used by arduino-cli to allow the larger downloads to complete?

2 Likes

Hi @chrisdavenport. Yes, the timeout is configurable, so in cases like this where the default timeout of 60 s is insufficient, you should be able to work around the problem by configuring a higher timeout value.

You can do that by running the following command to increase the timeout to 600 s:

arduino-cli config set network.connection_timeout 600s

(feel free to adjust the last argument in the command line to whatever timeout value you think is appropriate for your situation)

References:

It might make sense for the Arduino CLI developers to increase the default value, as was suggested here:

https://github.com/arduino/arduino-cli/issues/2899#issuecomment-2834199190

3 Likes

Thank you. That has resolved the problem.

You are welcome. I'm glad it is working now.

Regards, Per