Skip to content

Consistent Client.Timeout or context cancellation while reading body error when installing a core with 1.2.2 #2899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
kittaakos opened this issue Apr 26, 2025 · 4 comments
Labels
topic: code Related to content of the project itself topic: package-management Related to the packaging and managing of the platform/libraries type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Apr 26, 2025

Describe the problem

I suspect a regression with 1.2.2, whenever I install a core, I randomly get a Client.Timeout. I do not have the best Internet connection but it was always like that, and I could not reproduce the issue with 1.2.0, for example, or earlier versions.

I did some local testing and switched between 1.2.0 and 1.2.2 CLI versions and tried to install the ESP32 core after wiping ~/Users/kittaakos/Library/Arduino15/staging and ~/Users/kittaakos/Library/Arduino15/packages/esp32. It always failed for me with 1.2.2. There were no issues with 1.2.0. I tried it several times, switching back and forth between the CLI versions. This could be a temporary connection issue on my side. If so, please close this issue, but it could also be a 3rd party dependency update side effect.

To reproduce

./arduino-cli core update-index --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json

With 1.2.2:

./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool esp32:[email protected]_20240403 already installed
Tool esp32:[email protected]_20240403 already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 already downloaded
esp32:esp-x32@2411 esp32:esp-x32@2411 already downloaded
esp32:esp-rv32@2411 net/http: request canceled (Client.Timeout or context cancellation while reading body)
Error during install: net/http: request canceled (Client.Timeout or context cancellation while reading body)
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool esp32:[email protected]_20240403 already installed
Tool esp32:[email protected]_20240403 already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool esp32:[email protected] already installed
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 already downloaded
esp32:esp-x32@2411 esp32:esp-x32@2411 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

OR

./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 net/http: request canceled (Client.Timeout or context cancellation while reading body)
Error during install: net/http: request canceled (Client.Timeout or context cancellation while reading body)

I could not reproduce it with 1.2.0:

./arduino-cli version
arduino-cli  Version: 1.2.0 Commit: 9c495211 Date: 2025-02-24T15:57:28Z
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 downloaded                                         
esp32:esp-x32@2411 downloaded                                                                            
esp32:[email protected]_20240403 downloaded                                                        
esp32:esp-rv32@2411 downloaded                                                                           
esp32:[email protected]_20240403 downloaded                                                       
esp32:[email protected] downloaded                                                    
esp32:[email protected] downloaded                                                                     
esp32:[email protected] downloaded                                                                          
esp32:[email protected] downloaded                                                          
esp32:[email protected] downloaded                                                                             
Installing esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1...
Configuring tool....
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 installed
Installing esp32:esp-x32@2411...
Configuring tool....
esp32:esp-x32@2411 installed
Installing esp32:[email protected]_20240403...
Configuring tool....
esp32:[email protected]_20240403 installed
Installing esp32:esp-rv32@2411...
Configuring tool....
esp32:esp-rv32@2411 installed
Installing esp32:[email protected]_20240403...
Configuring tool....
esp32:[email protected]_20240403 installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing platform esp32:[email protected]...
Configuring platform....
Platform esp32:[email protected] installed

Expected behavior

The 1.2.0 behavior

Arduino CLI version

1.2.2

Operating system

macOS

Operating system version

15.4.1

Additional context

I have not tried the nightly because the release tag is the HEAD of the master (c11b9dd), therefore, it must be the same as the nightly:

./arduino-cli version
arduino-cli  Version: 1.2.2 Commit: c11b9dd5 Date: 2025-04-22T13:51:07Z

I have tested the CLI only with the ESP32 core installation. I did not try to install any other cores. (Related #2899 (comment))

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@kittaakos kittaakos added the type: imperfection Perceived defect in any part of project label Apr 26, 2025
@per1234 per1234 added topic: code Related to content of the project itself topic: package-management Related to the packaging and managing of the platform/libraries labels Apr 26, 2025
@per1234 per1234 changed the title Consitent Client.Timeout or context cancellation while reading body error when installing a core with 1.2.2 Consistent Client.Timeout or context cancellation while reading body error when installing a core with 1.2.2 Apr 26, 2025
@AlainF-ing
Copy link

I have the same issue with ESP32 core only.
I use 2 other cores ESP8266 and Rp2040 installed using script at the same time without any error.
I have this issue on Bookworm (latest) on Raspberry Pi 4B
I have tried my script on Fedora Workstation 42 Beta same error only 2 cores installed without timeout. ESP32 core can not install.

@alessio-perugini
Copy link
Contributor

I suspect it is related to the fix #2889 that correctly honors the patch done in v1.1.0 (#2770)

Can you try it by increasing the default timeout from 60s to 180s?
arduino-cli config set network.connection_timeout 180s

If this is confirmed, we should probably increase the default timeout

@kittaakos
Copy link
Contributor Author

Thank you!

If this is confirmed

Confirmed. Increasing the timeout works.

kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % rm -rf ~/Library/Arduino15/packages/esp32 
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % rm -rf ~/Library/Arduino15/staging       
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 downloaded                                                                            
esp32:esp-x32@2411 downloaded                                                                                                               
esp32:[email protected]_20240403 downloaded                                                                                           
esp32:esp-rv32@2411 net/http: request canceled (Client.Timeout or context cancellation while reading body)                                  
Error during install: net/http: request canceled (Client.Timeout or context cancellation while reading body)
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % rm -rf ~/Library/Arduino15/staging
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % rm -rf ~/Library/Arduino15/packages/esp32
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli config set network.connection_timeout 180s
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli config dump                               
network:
    connection_timeout: 180s

kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
Tool arduino:[email protected] already installed
Downloading packages...
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 downloaded                                                                            
esp32:esp-x32@2411 downloaded                                                                                                               
esp32:[email protected]_20240403 downloaded                                                                                           
esp32:esp-rv32@2411 downloaded                                                                                                              
esp32:[email protected]_20240403 downloaded                                                                                          
esp32:[email protected] downloaded                                                                                       
esp32:[email protected] downloaded                                                                                                        
esp32:[email protected] downloaded                                                                                                             
esp32:[email protected] downloaded                                                                                             
esp32:[email protected] downloaded                                                                                                                
Installing esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1...
Configuring tool....
esp32:esp32-arduino-libs@idf-release_v5.4-2f7dcd86-v1 installed
Installing esp32:esp-x32@2411...
Configuring tool....
esp32:esp-x32@2411 installed
Installing esp32:[email protected]_20240403...
Configuring tool....
esp32:[email protected]_20240403 installed
Installing esp32:esp-rv32@2411...
Configuring tool....
esp32:esp-rv32@2411 installed
Installing esp32:[email protected]_20240403...
Configuring tool....
esp32:[email protected]_20240403 installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing esp32:[email protected]...
Configuring tool....
esp32:[email protected] installed
Installing platform esp32:[email protected]...
Configuring platform....
Platform esp32:[email protected] installed
kittaakos@Akoss-MacBook-Pro-2 esp32-coredump-guide % 

It's not a bug, and I will close this issue.

@kittaakos kittaakos closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2025
@AlainF-ing
Copy link

Sorry guys for the delay.
This fix is working
ESP32 core v 3.2.0 has been installed, esp32:esp-x32@2411 downloaded is 560 Mb and downloaded ok.

Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: package-management Related to the packaging and managing of the platform/libraries type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

4 participants