Skip to content

Skip or time out network requests during board list #2769

@morkai

Description

@morkai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions