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

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

Open
3 tasks done
per1234 opened this issue Nov 24, 2023 · 0 comments
Open
3 tasks done

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

per1234 opened this issue Nov 24, 2023 · 0 comments
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Nov 24, 2023

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Nov 24, 2023
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 type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant