Skip to content
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

core install command ignores network.proxy configuration #2888

Open
3 tasks done
Dmitro25 opened this issue Apr 12, 2025 · 0 comments · May be fixed by #2889
Open
3 tasks done

core install command ignores network.proxy configuration #2888

Dmitro25 opened this issue Apr 12, 2025 · 0 comments · May be fixed by #2889
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
Milestone

Comments

@Dmitro25
Copy link

Dmitro25 commented Apr 12, 2025

Describe the problem

Arduino CLI must access the Internet for various operations. It can be configured to use a proxy server via the network.proxy configuration key.

🐛 The network.proxy configuration key is ignored by the core install command.

To reproduce

Setup

$ git clone https://github.com/arduino/arduino-cli && cd arduino-cli

[...]

$ git checkout 6320f6eb  # Checkout the last good commit.

[...]

$ task build

[...]

$ export ARDUINO_DIRECTORIES_DATA="/tmp/arduino-cli-directories/data"  # Use a throwaway data folder for the demo.

$ export ARDUINO_DIRECTORIES_DOWNLOADS="/tmp/arduino-cli-directories/downloads"

$ rm -r "$ARDUINO_DIRECTORIES_DATA" "$ARDUINO_DIRECTORIES_DOWNLOADS"  # Make sure there aren't existing files that would throw off the results.

[...]

$ ./arduino-cli lib update-index  # This is required as a preparatory operation because `core install` unnecessarily triggers a libraries index update if it is not already updated.

$ export ARDUINO_NETWORK_PROXY="http://foouser:[email protected]/404:42/"  # Configure Arduino CLI to use a proxy, intentionally using a non-functional configuration.

Demonstration of correct operation pre-regression

$ ./arduino-cli core install arduino:avr  # Attempt to install a platform while using a proxy.

Downloading packages...
arduino:[email protected] Get "https://downloads.arduino.cc/tools/arduinoOTA-1.3.0-windows_386.zip": Internal Server Error
Error during install: Get "https://downloads.arduino.cc/tools/arduinoOTA-1.3.0-windows_386.zip": Internal Server Error

🙂 The operation failed due to the non-functional proxy configuration, proving that the core install command does use the configured proxy for its downloads.

Demonstration of incorrect operation post-regression

$ git checkout master

[...]

$ task build

[...]

$ ./arduino-cli core install arduino:avr

$ ./arduino-cli core install arduino:avr
Downloading packages...
arduino:[email protected] downloaded
arduino:[email protected] downloaded                                                                                                                                                                                                                  
arduino:[email protected] downloaded
arduino:[email protected] downloaded
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing platform arduino:[email protected]...
Configuring platform....
Platform arduino:[email protected] installed

🐛 The installation was successful even though Arduino CLI was configured to use a non-functional proxy. This proves that the core install command does not use the configured proxy for its downloads.

Demonstration of correct operation of lib install command

$ export ARDUINO_DIRECTORIES_USER="/tmp/arduino-cli-directories/user"  # Use a throwaway user folder for the demo.

$ rm -r "$ARDUINO_DIRECTORIES_USER"  # Make sure there aren't existing files that would throw off the results.

[...]

$ ./arduino-cli lib install Servo

Downloading [email protected]...
[email protected] Get "https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Servo-1.2.2.zip?query=install": Internal Server Error
Error installing Servo: Can't download library: Get "https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Servo-1.2.2.zip?query=install": Internal Server Error

🙂 The operation failed due to the non-functional proxy configuration, proving that the lib install command does use the configured proxy for its downloads.

Expected behavior

All operations that access the Internet respect the network.proxy configuration.

Arduino CLI version

23ed1b1

Operating system

Windows

Operating system version

  • 10, build 1809
  • 11

Additional context

I bisected the regression to 1fddba7 / #2565 (does not occur when using the build at the previous commit 6320f6e).

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
@Dmitro25 Dmitro25 added the type: imperfection Perceived defect in any part of project label Apr 12, 2025
@per1234 per1234 changed the title The "Board Manager" ignores the proxy settings when trying to download the board package core install command ignores network.proxy configuration Apr 13, 2025
@per1234 per1234 transferred this issue from arduino/arduino-ide Apr 13, 2025
@per1234 per1234 added the topic: code Related to content of the project itself label Apr 13, 2025
@alessio-perugini alessio-perugini added this to the v1.2.1 milestone Apr 14, 2025
@per1234 per1234 added the topic: package-management Related to the packaging and managing of the platform/libraries label Apr 14, 2025
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

Successfully merging a pull request may close this issue.

3 participants