Description
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
- Select File > Preferences... from the Arduino IDE menus.
- Add the following to the "Additional Boards Manager URLs" field:
ⓘ The issue is not specific to this URL. Any URL that does not provide a package index URL download can be used.
https://downloads.arduino.cc/packages/package_nonexistent_index.json
- Click the OK button.
- Select File > Quit from the Arduino IDE menus.
- Start the Arduino IDE.
- Open the "Board Selector" menus.
🐛 No boards are shown. - Open the Tools menu.
🐛 There is no "Boards" menu. - Open the "Boards Manager" view.
🐛 The view is empty, not even showing the currently installed platforms. - 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:
- https://forum.arduino.cc/t/arduino-2-0-0-rc-7-no-board-manager-or-library-manager/1004131/6
- https://forum.arduino.cc/t/ide-2-0-0-rc8-missing-tools-board-and-other-menus/1007606
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