Skip to content

IDE is non-functional if package index can't be loaded #1084

@per1234

Description

@per1234

Describe the problem

Package indexes are used by the Arduino Boards Manager system to track the Arduino boards platforms that are available for installation.

These come from two types of sources:

  • The official primary package index
  • URLs specified by the user via the "Additional Boards Manager URLs" field of the IDE's "Preferences" dialog

The package indexes are downloaded from these URLs by Arduino IDE 2.x on startup.

🐛 Under the following conditions, the IDE is non-functional:

  • A package index cannot be downloaded from its URL
  • The package index is not already present in directories.data

To reproduce

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Add the following to the "Additional Boards Manager URLs" field:
    https://downloads.arduino.cc/packages/package_nonexistent_index.json
    
    The issue is not specific to this URL. Any URL that does not provide a package index URL download can be used.
  3. Click the OK button.
  4. Select File > Quit from the Arduino IDE menus.
  5. Start the Arduino IDE.
  6. Open the "Board Selector" menus.
    🐛 No boards are shown.
  7. Open the Tools menu.
    🐛 There is no "Boards" menu.
  8. Open the "Boards Manager" view.
    🐛 The view is empty, not even showing the currently installed platforms.
  9. Open the "Library Manager" view.
    🐛 The view is empty.

🐛 The only way for the user to identify the problem is searching through the logs.

Expected behavior

Clearly communicate to the user that there was a problem with downloading the package index.

It would probably also make sense to retain general functionality of the Arduino IDE (though of course the Boards Manager functionality that relies on the missing package index in particular will not be available).

Arduino IDE version

2.0.0-rc7-snapshot-a715da3

Operating system

Windows

Operating system version

10

Additional context

I bisected the issue to 4c55807 (does not occur with the build from cb50d3a)


The logs contain the following:

root ERROR Uncaught Exception:
root ERROR Error: 13 INTERNAL: Error downloading index 'https://downloads.arduino.cc/packages/package_nonexistent_index.json': Server responded with: 404 Not Found
    at Object.callErrorFromStatus (C:\ide 2\tip\48-a715da3\resources\app\node_modules\@grpc\grpc-js\build\src\call.js:31:26)
    at Object.onReceiveStatus (C:\ide 2\tip\48-a715da3\resources\app\node_modules\@grpc\grpc-js\build\src\client.js:349:49)
    at Object.onReceiveStatus (C:\ide 2\tip\48-a715da3\resources\app\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:328:181)
    at C:\ide 2\tip\48-a715da3\resources\app\node_modules\@grpc\grpc-js\build\src\call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

Even though it is most likely to occur with package indexes provided by via the "Additional Boards Manager URLs" preference (whether by user error, no connection to Internet, or transient network outage on the server), it does also occur even with the primary package index so long as the conditions described previously are present.


Originally reported at #1036 (comment)

I mistakenly claimed that issue had been fixed by #1045 because I did not realize at that time that the package index's absence from directories.data was a required condition to reproduce it.


Related:

Issue checklist

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

Metadata

Metadata

Assignees

Labels

conclusion: resolvedIssue was resolvedtopic: CLIRelated to Arduino CLItopic: 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