Skip to content

First run hangs if IDE fails to download assets #2042

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

Open
3 tasks done
per1234 opened this issue May 4, 2023 · 1 comment
Open
3 tasks done

First run hangs if IDE fails to download assets #2042

per1234 opened this issue May 4, 2023 · 1 comment
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 May 4, 2023

Describe the problem

On the first run after a fresh installation, Arduino IDE downloads some files from the Internet:

  • The builtin:serial-discovery pluggable discovery tool
  • The builtin:mdns-discovery pluggable discovery tool
  • The Library Manager index
  • The primary Boards Manager package index

🐛 If the download of these files is not possible due to lack of Internet access, or some other problem (e.g., #2606), the startup hangs.

This is a change from Arduino IDE 1.x, which is in a fully functional state from the start with no hard dependency on an Internet connection (though obviously Library/Boards Manager can't be used).

To reproduce

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Rename or delete (:warning: cautiously) the following folder to effectively simulate the environment of a first run:
    • If you are using Windows:
      C:\Users\<username>\AppData\Local\Arduino15
      
      (where <username> is your Windows username)
    • If you are using Linux:
      ~/.arduino15
      
    • If you are using macOS:
      ~/Library/Arduino15
      
  3. Disconnect your computer from the Internet.
  4. Start Arduino IDE.

🐛 Startup hangs at the startup animation.

🐛 The cause of the hang is not communicated to the user.

Expected behavior

Complete startup even when the essential resources could not be installed.

This is important because, once it has started up, Arduino IDE shows notifications that communicate the Internet access dependency to the user.

  • Record whether the arduino:avr and "Arduino_BuiltIn" installations were successful, and if not then retry on subsequent startups.
    • Note: This must be done based on a dedicated record, and not on the presence/absence of these installations because users may have later removed unwanted installations after they were successfully installed automatically.

Arduino IDE version

097c92d

Operating system

Windows

Operating system version

11

Additional context

The regression was introduced at a36524e


The logs include this:

2023-05-03T23:57:19.823Z root ERROR Uncaught Exception: 
2023-05-03T23:57:19.823Z root ERROR Error: The index of the cores and libraries must be updated before initializing the core gRPC client.
The following problems were detected during the gRPC client initialization:
[platform-index] - code: 9, message: Loading index file: loading json index file C:\Users\per\AppData\Local\Arduino15\package_index.json: open C:\Users\per\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
[library-index] - code: 9, message: Loading index file: reading library_index.json: open C:\Users\per\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.

    at isIndexUpdateRequiredBeforeInit (C:\arduino-tools\193-097c92d\resources\app\node_modules\arduino-ide-extension\lib\node\core-client-provider.js:388:11)
    at CoreClientProvider.evaluateErrorStatus (C:\arduino-tools\193-097c92d\resources\app\node_modules\arduino-ide-extension\lib\node\core-client-provider.js:200:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ClientReadableStreamImpl.<anonymous> (C:\arduino-tools\193-097c92d\resources\app\node_modules\arduino-ide-extension\lib\node\core-client-provider.js:184:31)

Related

Additional reports:

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels May 4, 2023
@kittaakos kittaakos self-assigned this May 4, 2023
@dkorzhevin

This comment has been minimized.

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

3 participants