IDE hangs on startup: "ENOENT: no such file or directory, scandir ..."

IDE 2.2.1 fails to complete launch on my Mac mini m2 running Sonoma (14.2.1 (23C71). The splash screen launches with the pulsing trademark but after more than 30 minutes there is no change.
I've deleted existing app files, rebooted downloaded arm64 instance and it repeats.

Judging from this thread there's something common to both platforms.

Hi @jadonovan. I'm going to ask you to post some additional information that might help us to identify the problem.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Close all Arduino IDE windows if the IDE is already running.
  2. Open macOS Launchpad.
  3. Type terminal in the "Search" field.
  4. Click on the "Terminal" icon.
    A "zsh" window will open.
  5. Type the following command in the zsh window:
    "/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE"
    
  6. Press the Enter key.
  7. Wait until you are sure the IDE startup has gone into the hang state
    (as indicated by no additional output being printed to the Terminal window).
  8. Switch back to the Terminal window if the Arduino IDE window took the focus.
  9. Press the Command+A keyboard shortcut.
    This will select all the text in the Terminal window.
  10. Press the Command+C keyboard shortcut.
    This will copy the selected text to the clipboard.
  11. Open a forum reply here by clicking the "Reply" button.
  12. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the output is correctly formatted.
    Code block icon on toolbar
  13. Press the Command+V keyboard shortcut.
    This will paste the output into the code block.
  14. Move the cursor outside of the code block markup before you add any additional text to your reply.
  15. Click the "Reply" button to post the output.

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

Topic split from topic with different issue.

1 Like

Thanks for your email.

Here’s the terminal as requested:

ptillisch.Ard.Support.txt (16.5 KB)

Following are the contents of the file I attached to my email reply. I stopped the spewing with a ctrl-c as it didn't stop.

Last login: Thu Jan 18 16:02:46 on ttys000
/Users/iMac.jadonovan/.zshrc:source:73: no such file or directory: /Users/jadonovan/.oh-my-zsh/oh-my-zsh.sh
iMac.jadonovan@Mac-mini-M2 ~ % /Applications/"Arduino IDE.app"/Contents/MacOS/"Arduino IDE"
Arduino IDE 2.2.1
Checking for frontend application configuration customizations. Module path: /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/electron-main.js, destination 'package.json': /Applications/Arduino IDE.app/Contents/Resources/app/package.json
2024-01-18 16:39:54.806 Arduino IDE[55726:11997643] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
Setting 'theia.frontend.config.appVersion' application configuration value to: "2.2.1" (type of string)
Setting 'theia.frontend.config.cliVersion' application configuration value to: "0.34.0" (type of string)
Setting 'theia.frontend.config.buildDate' application configuration value to: "2023-08-31T13:53:43.373Z" (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.2.1","cliVersion":"0.34.0","buildDate":"2023-08-31T13:53:43.373Z"}
Starting backend process. PID: 55747
Using browser-only version of superagent in non-browser environment
Configuration directory URI: 'file:///Users/iMac.jadonovan/.arduinoIDE'
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
2024-01-18T21:39:55.074Z root INFO Backend Object.initialize: 2.0 ms [Finished 0.229 s after backend start]
2024-01-18T21:39:55.074Z root INFO Backend Object.configure: 1.7 ms [Finished 0.229 s after backend start]
2024-01-18T21:39:55.074Z root INFO Backend a.onStart: 0.6 ms [Finished 0.229 s after backend start]
2024-01-18T21:39:55.074Z root INFO Backend a.configure: 0.1 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.075Z root INFO Backend u.onStart: 0.1 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.075Z root INFO Backend d.configure: 0.0 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.075Z root INFO Backend d.initialize: 12.8 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.075Z root INFO Backend c.onStart: 0.1 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.075Z root INFO Backend s.configure: 0.4 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.076Z config INFO >>> Initializing CLI configuration...
2024-01-18T21:39:55.076Z root INFO Backend c.initialize: 0.2 ms [Finished 0.242 s after backend start]
2024-01-18T21:39:55.076Z root INFO Backend P.onStart: 0.3 ms [Finished 0.243 s after backend start]
2024-01-18T21:39:55.076Z config INFO Loading CLI configuration from /Users/iMac.jadonovan/.arduinoIDE/arduino-cli.yaml...
2024-01-18T21:39:55.077Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.077Z root INFO Backend s.initialize: 0.2 ms [Finished 0.243 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend w.onStart: 0.4 ms [Finished 0.243 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend r.configure: 0.7 ms [Finished 0.243 s after backend start]
2024-01-18T21:39:55.077Z discovery-log INFO start
2024-01-18T21:39:55.077Z discovery-log INFO start new deferred
2024-01-18T21:39:55.077Z root INFO Backend d.initialize: 0.2 ms [Finished 0.244 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend y.onStart: 0.8 ms [Finished 0.244 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend r.configure: 0.7 ms [Finished 0.244 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend s.onStart: 0.2 ms [Finished 0.245 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend h.configure: 0.2 ms [Finished 0.245 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend a.configure: 0.1 ms [Finished 0.245 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend s.configure: 0.0 ms [Finished 0.245 s after backend start]
2024-01-18T21:39:55.077Z root INFO Backend l.configure: 0.0 ms [Finished 0.245 s after backend start]
2024-01-18T21:39:55.078Z root INFO Theia app listening on http://localhost:54996.
2024-01-18T21:39:55.078Z root INFO Finished starting backend application: 1.5 ms [Finished 0.246 s after backend start]
2024-01-18T21:39:55.079Z root WARN The local plugin referenced by local-dir:/Users/iMac.jadonovan/.arduinoIDE/plugins does not exist.
2024-01-18T21:39:55.079Z root WARN The local plugin referenced by local-dir:/Users/iMac.jadonovan/.arduinoIDE/extensions does not exist.
2024-01-18T21:39:55.085Z config INFO Loaded CLI configuration: {"board_manager":{"additional_urls":["https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"]},"daemon":{"port":"50051"},"directories":{"builtin":{"libraries":"/Users/jaydonovan/Library/Arduino15/libraries"},"data":"/Users/jaydonovan/Library/Arduino15","downloads":"/Users/jaydonovan/Library/Arduino15/staging","user":"/Users/jaydonovan/Documents/Arduino"},"library":{"enable_unsafe_install":false},"locale":"en","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-01-18T21:39:55.085Z config INFO 'directories.data' and 'directories.user' are set in the CLI configuration model.
2024-01-18T21:39:55.085Z config INFO Loaded the CLI configuration.
2024-01-18T21:39:55.088Z config WARN Could not ensure user directory existence: /Users/jaydonovan/Documents/Arduino Error: EACCES: permission denied, mkdir '/Users/jaydonovan'
2024-01-18T21:39:55.088Z config INFO Mapped the CLI configuration: {"dataDirUri":"file:///Users/jaydonovan/Library/Arduino15","sketchDirUri":"file:///Users/jaydonovan/Documents/Arduino","additionalUrls":["https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"],"network":"none","locale":"en"}
2024-01-18T21:39:55.088Z config INFO Validating the CLI configuration...
2024-01-18T21:39:55.088Z root ERROR Check accessible failed for input: /Users/jaydonovan/Documents/Arduino Error: ENOENT: no such file or directory, scandir '/Users/jaydonovan/Documents/Arduino'
2024-01-18T21:39:55.088Z config ERROR Failed to initialize the CLI configuration. Error: InvalidConfigError:
 - Could not access the sketchbook location at '/Users/jaydonovan/Documents/Arduino': Error: ENOENT: no such file or directory, scandir '/Users/jaydonovan/Documents/Arduino'
    at P.validateCliConfig (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:579373)
    at async P.initConfig (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:577192)
2024-01-18T21:39:55.093Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.093Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.093Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.093Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.094Z root INFO Resolve plugins list: 17.1 ms [Finished 0.262 s after backend start]
2024-01-18T21:39:55.101Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.101Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.101Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.101Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.127Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.127Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.127Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.127Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.173Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.173Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.173Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.173Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.215Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.215Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.215Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.215Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.248Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.248Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.248Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.248Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.290Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.290Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.290Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.290Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.316Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.316Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.316Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.316Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.368Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.368Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
2024-01-18T21:39:55.368Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/resources/arduino-cli...
2024-01-18T21:39:55.368Z daemon INFO Daemon exited with exit code: 7.
2024-01-18T21:39:55.400Z daemon INFO Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
2024-01-18T21:39:55.400Z daemon ERROR Error: Error: invalid path creating config dir: /Users/jaydonovan/Library/Arduino15 error: mkdir /Users/jaydonovan: permission denied
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/lib/backend/main.js:2:46444)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Thanks. That is useful.

It looks this was caused by your macOS 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:

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Delete the file at the following path:
    /Users/<username>/.arduinoIDE/arduino-cli.yaml
    
    (where <username> is your macOS username)
    :exclamation: The .arduinoIDE folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
    :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 Arduino IDE > Settings... 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.

1 Like

moved Arduino-cli.yaml out of the folder, launched the Arduino IDE and I'm back in business!

Thanks so much!

The root cause was getting a new computer and, just as you said, used a different username when transferring files from the old system.

Cheers!

You are welcome. I'm glad it is working now.

Regards,
Per

Very, very helpful! Thank You!

:grinning:

1 Like

Try running your mac in safe mode by holding the shift key until the Apple logo see. Then trying open the Arduino IDE 2.2.1

Thanks you for the previous mentioned step. I too have a new computer and ran into the same problem. Again thanks!!!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.