Skip to content

Startup fails silently if package index can't be downloaded #860

Open
@per1234

Description

@per1234

Describe the problem

On startup, Arduino Create Agent downloads a package index file from Arduino's download server.

This download might fail for a variety of reasons. If this happens, Arduino Create Agent simply fails to start without giving any indication to the user of the failure or why:

if err := ir.DownloadAndVerify(); err != nil {
log.Fatalf("cannot download index: %s", err)

🐛 It is difficult for the user to determine why Arduino Create Agent won't start.

To reproduce

  1. Quit Arduino Create Agent if it is already running.
  2. Disconnect your computer from the Internet.
  3. Start Arduino Create Agent.

🐛 Arduino Create Agent fails to start.
🐛 Unless you started Arduino Create Agent from the terminal (which a normal user will never do), there is no indication of why it failed to start.

Expected behavior

Arduino Create Agent clearly communicates the failure to start and the reason to the user.

Arduino Create Agent version

d4c4537

Operating system

  • Windows
  • macOS

Operating system version

  • Windows 11
  • macOS Sonoma

Browser

N/A

Additional context

A basic lack of Internet access was used in the demo above for the sake of simplicity. Admittedly, since Arduino Create Agent is inherently linked to the Arduino Cloud online service, this specific scenario is probably unlikely to occur in the real world. However, there are a variety of other reasons why the download might fail such as:

  • Arduino Create Agent's access to the Internet is blocked by a firewall or proxy server
  • Transient network outage on Arduino's download server

A log file is not generated even when the crashreport key is set to true in the configuration file.


The only logs printed to the terminal are something like this, which isn't identified as an error message (as opposed to a non-critical warning):

2023/11/24 03:28:48 cannot download index: Get "https://downloads.arduino.cc/packages/package_staging_index.json": dial tcp: lookup downloads.arduino.cc: no such host

Because the Windows build of Arduino Create Agent is built as a "GUI binary", complex PowerShell acrobatics are required for Windows users to even see these logs.


Originally reported at https://forum.arduino.cc/t/create-agent-crashes-trying-to-use/1192619

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions