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

Skip or time out network requests during board list #2769

Open
3 tasks done
morkai opened this issue Nov 28, 2024 · 0 comments · May be fixed by #2770
Open
3 tasks done

Skip or time out network requests during board list #2769

morkai opened this issue Nov 28, 2024 · 0 comments · May be fixed by #2770
Labels
type: enhancement Proposed improvement

Comments

@morkai
Copy link

morkai commented Nov 28, 2024

Describe the request

Add an option to skip network requests when using arduino board list or at least an option to set a timeout when estabilishing an HTTP connection (--http-connect-timeout option similar to --discovery-timeout?)

Describe the current behavior

Running arduino board list on a system that has network access but no internet (without a proxy) results in the process being stuck during the Querying builder API for board identification... step for 260 seconds:

$ rm .arduino15/inventory.yaml ; time arduino-cli board list --json --log --log-level trace
...
DEBU[0002] Querying builder API for board identification...
DEBU[0002] Error querying builder API   error="error querying Arduino Cloud Api: Get \\"https://builder.arduino.cc/v3/boards/byVidPid/0x1a86/0x7523\": dial tcp 52.205.13.106:443: connect: connection timed out"
{"detected_ports": [...]}

real	4m22.649s
user	0m1.614s
sys	0m0.397s

To work around this I'm currently forcing builder.arduino.cc to 127.0.0.1 in /etc/hosts:

...
DEBU[0002] Querying builder API for board identification... 
DEBU[0002] Error querying builder API   error="error querying Arduino Cloud Api: Get \"https://builder.arduino.cc/v3/boards/byVidPid/0x1a86/0x7523\": tls: failed to verify certificate: x509: certificate is valid for ..., not builder.arduino.cc"
{"detected_ports": [...]}

real	0m2.341s
user	0m1.218s
sys	0m0.385s

Arduino CLI version

arduino-cli Version: nightly-20241128 Commit: 6cd084b Date: 2024-11-28T01:35:05Z

Operating system

Linux

Operating system version

Ubuntu 20.04.6 LTS

Additional context

I'm preparing a Linux installation image with preconfigured arduino-cli that will be used on PCs without access to the internet, so every time a new, unrecognized board is connected, the board list command takes a long time.

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@morkai morkai added the type: enhancement Proposed improvement label Nov 28, 2024
@alessio-perugini alessio-perugini linked a pull request Nov 28, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant