IDE hangs on startup: "mkdir C:\Users\user: Access is denied."

I have the same problem:

PS C:\Program Files\Arduino IDE> & ".\Arduino IDE"
PS C:\Program Files\Arduino IDE>
Arduino IDE 2.3.2
Checking for frontend application configuration customizations. Module path: C:\Program Files\Arduino IDE\resources\app\lib\backend\electron-main.js, destination 'package.json': C:\Program Files\Arduino IDE\resources\app\package.json
Setting 'theia.frontend.config.appVersion' application configuration value to: "2.3.2" (type of string)
Setting 'theia.frontend.config.cliVersion' application configuration value to: "0.35.3" (type of string)
Setting 'theia.frontend.config.buildDate' application configuration value to: "2024-02-20T10:04:35.814Z" (type of string)
Frontend application configuration after modifications: {"applicationName":"Arduino IDE","defaultTheme":{"light":"arduino-theme","dark":"arduino-theme-dark"},"defaultIconTheme":"none","electron":{"windowOptions":{}},"defaultLocale":"","validatePreferencesSchema":false,"preferences":{"window.title":"${rootName}${activeEditorShort}${appName}","files.autoSave":"afterDelay","editor.minimap.enabled":false,"editor.tabSize":2,"editor.scrollBeyondLastLine":false,"editor.quickSuggestions":{"other":false,"comments":false,"strings":false},"editor.maxTokenizationLineLength":500,"editor.bracketPairColorization.enabled":false,"breadcrumbs.enabled":false,"workbench.tree.renderIndentGuides":"none","explorer.compactFolders":false},"appVersion":"2.3.2","cliVersion":"0.35.3","buildDate":"2024-02-20T10:04:35.814Z"}
Starting backend process. PID: 13300
Using browser-only version of superagent in non-browser environment
Configuration directory URI: 'file:///c%3A/Users/ramis/.arduinoIDE'
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
2024-03-16T18:44:13.875Z root INFO Backend Object.initialize: 13.4 ms [Finished 1.948 s after backend start]
2024-03-16T18:44:13.878Z root INFO Backend Object.configure: 10.6 ms [Finished 1.949 s after backend start]
2024-03-16T18:44:13.878Z root INFO Backend s.onStart: 5.6 ms [Finished 1.949 s after backend start]
2024-03-16T18:44:13.880Z root INFO Backend s.configure: 0.8 ms [Finished 2.020 s after backend start]
2024-03-16T18:44:13.882Z root INFO Backend d.onStart: 0.6 ms [Finished 2.020 s after backend start]
2024-03-16T18:44:13.884Z root INFO Backend d.configure: 0.3 ms [Finished 2.021 s after backend start]
2024-03-16T18:44:13.887Z root WARN Backend d.initialize took longer than the expected maximum 50 milliseconds: 71.4 ms [Finished 2.021 s after backend start]
2024-03-16T18:44:13.887Z root INFO Backend c.onStart: 0.8 ms [Finished 2.021 s after backend start]
2024-03-16T18:44:13.889Z root INFO Backend a.configure: 3.9 ms [Finished 2.025 s after backend start]
2024-03-16T18:44:13.894Z config INFO >>> Initializing CLI configuration...
2024-03-16T18:44:13.894Z root INFO Backend c.initialize: 1.6 ms [Finished 2.026 s after backend start]
2024-03-16T18:44:13.894Z root INFO Backend R.onStart: 2.4 ms [Finished 2.028 s after backend start]
2024-03-16T18:44:13.896Z config INFO Loading CLI configuration from c:\Users\ramis\.arduinoIDE\arduino-cli.yaml...
2024-03-16T18:44:13.898Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\lib\backend\resources\arduino-cli.exe...
2024-03-16T18:44:13.898Z root INFO Backend a.initialize: 1.2 ms [Finished 2.031 s after backend start]
2024-03-16T18:44:13.898Z root INFO Backend w.onStart: 3.6 ms [Finished 2.033 s after backend start]
2024-03-16T18:44:13.898Z root INFO Backend r.configure: 5.6 ms [Finished 2.034 s after backend start]
2024-03-16T18:44:13.899Z discovery-log INFO start
2024-03-16T18:44:13.899Z discovery-log INFO start new deferred
2024-03-16T18:44:13.899Z root INFO Backend d.initialize: 1.3 ms [Finished 2.035 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend y.onStart: 6.2 ms [Finished 2.040 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend r.configure: 5.4 ms [Finished 2.041 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend a.onStart: 1.6 ms [Finished 2.045 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend h.configure: 1.4 ms [Finished 2.045 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend s.configure: 0.4 ms [Finished 2.045 s after backend start]
2024-03-16T18:44:13.899Z root INFO Backend l.configure: 0.2 ms [Finished 2.046 s after backend start]
2024-03-16T18:44:13.907Z root INFO Theia app listening on http://127.0.0.1:56988.
2024-03-16T18:44:13.907Z root INFO Finished starting backend application: 8.0 ms [Finished 2.053 s after backend start]
2024-03-16T18:44:13.930Z root WARN The local plugin referenced by local-dir:/c%3A/Users/ramis/.arduinoIDE/plugins does not exist.
2024-03-16T18:44:13.930Z root WARN The local plugin referenced by local-dir:/c%3A/Users/ramis/.arduinoIDE/extensions does not exist.
2024-03-16T18:44:13.930Z root WARN The local plugin referenced by local-dir:C:\Users\ramis\.arduinoIDE\plugins does not exist.
2024-03-16T18:44:13.955Z config INFO Loaded CLI configuration: {"board_manager":{"additional_urls":[]},"daemon":{"port":"50051"},"directories":{"data":"C:\\Users\\user\\AppData\\Local\\Arduino15","downloads":"C:\\Users\\user\\AppData\\Local\\Arduino15\\staging","user":"C:\\Users\\user\\Documents\\Arduino"},"library":{"enable_unsafe_install":false},"logging":{"file":"","format":"text","level":"info"},"metrics":{"addr":":9090","enabled":true},"output":{"no_color":false},"sketch":{"always_export_binaries":false},"updater":{"enable_notification":true}}
2024-03-16T18:44:13.956Z config INFO 'directories.data' and 'directories.user' are set in the CLI configuration model.
2024-03-16T18:44:13.956Z config INFO Loaded the CLI configuration.
2024-03-16T18:44:14.045Z config WARN Could not ensure user directory existence: C:\Users\user\Documents\Arduino Error: EPERM: operation not permitted, mkdir 'C:\Users\user'
2024-03-16T18:44:14.045Z config INFO Mapped the CLI configuration: {"dataDirUri":"file:///c%3A/Users/user/AppData/Local/Arduino15","sketchDirUri":"file:///c%3A/Users/user/Documents/Arduino","additionalUrls":[],"network":"none","locale":"en"}
2024-03-16T18:44:14.045Z config INFO Validating the CLI configuration...
2024-03-16T18:44:14.046Z root ERROR Check accessible failed for input: C:\Users\user\Documents\Arduino Error: ENOENT: no such file or directory, scandir 'C:\Users\user\Documents\Arduino'
2024-03-16T18:44:14.047Z config ERROR Failed to initialize the CLI configuration. Error: InvalidConfigError:
 - Could not access the sketchbook location at 'C:\Users\user\Documents\Arduino': Error: ENOENT: no such file or directory, scandir 'C:\Users\user\Documents\Arduino'
    at R.validateCliConfig (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:616109)
    at async R.initConfig (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:613928)
2024-03-16T18:44:14.087Z daemon INFO Error: invalid path creating config dir: C:\Users\user\AppData\Local\Arduino15 error: mkdir C:\Users\user: Access is denied.
2024-03-16T18:44:14.088Z daemon ERROR Error: Error: invalid path creating config dir: C:\Users\user\AppData\Local\Arduino15 error: mkdir C:\Users\user: Access is denied.
    at Socket.<anonymous> (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:43051)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Socket.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-03-16T18:44:14.088Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\lib\backend\resources\arduino-cli.exe...
2024-03-16T18:44:14.105Z daemon INFO Daemon exited with exit code: 7.
2024-03-16T18:44:14.116Z root INFO Resolve plugins list: 220.2 ms [Finished 2.261 s after backend start]
2024-03-16T18:44:14.259Z daemon INFO Error: invalid path creating config dir: C:\Users\user\AppData\Local\Arduino15 error: mkdir C:\Users\user: Access is denied.
2024-03-16T18:44:14.259Z daemon ERROR Error: Error: invalid path creating config dir: C:\Users\user\AppData\Local\Arduino15 error: mkdir C:\Users\user: Access is denied.
    at Socket.<anonymous> (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:43051)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Socket.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-03-16T18:44:14.259Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\lib\backend\resources\arduino-cli.exe...

Hi @ramush77. It looks this was caused by your Windows username changing since the time you installed Arduino IDE.

The first time you run Arduino IDE, it generates a configuration file that defines the paths to several folders used by the IDE. The default locations of these folders are under your home folder, which means the username is part of the path. When you change your username it makes the paths in the configuration file outdated. When the IDE attempts to access the old path, the operating system does not allow it, which causes the startup to hang.

I think the easiest solution will be to simply delete the configuration file. Arduino IDE will automatically generate a new file on startup with the correct paths.

I'll provide instructions you can follow to do that:

  1. Select File > Quit from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close.
  2. Delete the file at the following path:
    C:\Users\ramis\.arduinoIDE\arduino-cli.yaml
    
    :warning: Please be careful when deleting things from your computer. When in doubt, back up!
  3. Start Arduino IDE.

Arduino IDE should now start up fully and be functional as usual.

Note that the file you deleted is used to store some of your IDE preferences. These will all have been reset to the default values. If you had customized either the "Sketchbook location" or "Additional Boards Manager URLs" preferences before, you'll need to select File > Preferences... from the Arduino IDE menus and then set those preferences once again after performing the instructions I provided above.


Please let me know if you have any questions or problems while following those instructions.