Description
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
- Connect a removable drive to your computer.
- Select File > Preferences... from the Arduino IDE menus.
- Set a path under the removable drive in the "Sketchbook location" field.
- Click the OK button.
- 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:
- Select File > Quit from the Arduino IDE menus.
- Open the file at the following path in a text editor:
- Windows:
(where
C:\Users\<username>\.arduinoIDE\arduino-cli.yaml
<username>
is your Windows username) - Linux:
~/.arduinoIDE/arduino-cli.yaml
- macOS:
~/.arduinoIDE/arduino-cli.yaml
- Windows:
- 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
- Save the file.
Steps
- Start Arduino IDE.
🐛 Startup hangs at the loading animation:
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
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