Skip to content
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

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

Closed
3 tasks done
per1234 opened this issue Dec 12, 2022 · 0 comments · Fixed by #1774
Closed
3 tasks done

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

per1234 opened this issue Dec 12, 2022 · 0 comments · Fixed by #1774
Assignees
Labels
conclusion: resolved Issue was resolved 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 Dec 12, 2022

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Dec 12, 2022
@kittaakos kittaakos self-assigned this Dec 12, 2022
@kittaakos kittaakos added the status: in progress Work is in progress on this label Dec 15, 2022
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Dec 15, 2022
Closes arduino#1764

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Dec 15, 2022
Closes #1764

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Dec 15, 2022
Closes #1764

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos removed the status: in progress Work is in progress on this label Dec 19, 2022
kittaakos pushed a commit that referenced this issue Dec 21, 2022
Closes #1764
Closes #796
Closes #569
Closes #655

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Dec 21, 2022
Closes #1764
Closes #796
Closes #569
Closes #655

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants