Skip to content

IDE hangs on startup if drive containing sketchbook location not accessible #1764

Closed
@per1234

Description

@per1234

Describe the problem

The Arduino sketchbook is a convenient place to store sketches and the location where Arduino IDE installs libraries.

The user can set a custom location for the sketchbook via the "Sketchbook location" preference.

🐛 If the drive containing the "Sketchbook location" path is not available, the Arduino IDE startup hangs. The cause is not communicated to the user in any way.

To reproduce

Setup

  1. Connect a removable drive to your computer.
  2. Select File > Preferences... from the Arduino IDE menus.
  3. Set a path under the removable drive in the "Sketchbook location" field.
  4. Click the OK button.
  5. Select File > Quit from the Arduino IDE menus.

-OR-

The fault can also be reproduced even if you don't have a removable drive on hand:

  1. Select File > Quit from the Arduino IDE menus.
  2. Open the file at the following path in a text editor:
    • Windows:
      C:\Users\<username>\.arduinoIDE\arduino-cli.yaml
      
      (where <username> is your Windows username)
    • Linux:
      ~/.arduinoIDE/arduino-cli.yaml
      
    • macOS:
      ~/.arduinoIDE/arduino-cli.yaml
      
  3. Change the path in the directories.user key to one under a drive that doesn't exist on your computer.
    For example:
    user: L:\Arduino
  4. Save the file.

Steps

  1. Start Arduino IDE.

🐛 Startup hangs at the loading animation:

image

Expected behavior

Arduino IDE clearly communicates to the user that the sketchbook location is inaccessible. If it is not possible for the IDE to be functional under these conditions, this should also be clearly communicated to the user and they should still be able to change the "Sketchbook location" preference to an accessible path to restore the functionality.

Arduino IDE version

f8c01e3

Operating system

Windows

Operating system version

10

Additional context

I bisected the introduction of the bug to 6983c5b (does not occur with the build for the previous commit b3ab5cb)


I see this in the logs on startup:

2022-12-12T06:43:22.393Z root ERROR Uncaught Exception:
2022-12-12T06:43:22.393Z root ERROR Error: ENOENT: no such file or directory, mkdir '\\?'

The fault does not occur if the drive is accessible but the sketchbook folder is missing. In this case, the missing folder is simply created on startup (6983c5b).


Originally reported at https://forum.arduino.cc/t/arduino-ide-2-wont-start/1063769

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions