IDE hangs on startup: "mkdir /Users/papahotel: permission denied"

Hi,

I have tried downloading IDE 2.0 to my Mac Studio running MacOS Monterey, but it only gets to a black app background with the new Arduino logo.

I used terminal to run the command:

"/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE" with the following printout. I hope this helps sort out any issues. I have no problems with IDE 1.8.19.

Last login: Sat Sep 24 18:03:32 on ttys000
Pete@Petes-Mac-Studio ~ % "/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE"
Starting backend process. PID: 6992
Using browser-only version of superagent in non-browser environment
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
root INFO Configuration directory URI: 'file:///Users/Pete/.theia'
root INFO Backend Object.initialize: 9.6 ms [Finished 1.938 s after backend start]
root INFO Backend Object.configure: 6.3 ms [Finished 1.938 s after backend start]
root INFO Backend MessagingContribution.onStart: 2.9 ms [Finished 1.938 s after backend start]
root INFO Backend OSBackendApplicationContribution.configure: 1.7 ms [Finished 2.009 s after backend start]
root INFO Backend DefaultWorkspaceServer.onStart: 1.2 ms [Finished 2.009 s after backend start]
root INFO Backend LocalizationBackendContribution.configure: 0.8 ms [Finished 2.010 s after backend start]
root WARN Backend LocalizationBackendContribution.initialize took longer than the expected maximum 50 milliseconds: 73.2 ms [Finished 2.012 s after backend start]
root INFO Backend TaskBackendApplicationContribution.onStart: 1.8 ms [Finished 2.012 s after backend start]
root INFO Backend ElectronTokenBackendContribution.configure: 5.2 ms [Finished 2.017 s after backend start]
root INFO Backend PluginDeployerContribution.initialize: 0.8 ms [Finished 2.018 s after backend start]
root INFO Backend ConfigServiceImpl.onStart: 5.7 ms [Finished 2.023 s after backend start]
root INFO Backend WebviewBackendSecurityWarnings.initialize: 4.0 ms [Finished 2.031 s after backend start]
root INFO Backend ArduinoDaemonImpl.onStart: 5.6 ms [Finished 2.033 s after backend start]
root INFO Backend NodeFileUploadService.configure: 10.3 ms [Finished 2.034 s after backend start]
daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli...
discovery-log INFO start
discovery-log INFO start new deferred
root INFO Backend BoardDiscovery.onStart: 2.2 ms [Finished 2.037 s after backend start]
root INFO Backend FileDownloadEndpoint.configure: 1.1 ms [Finished 2.037 s after backend start]
root INFO Backend AuthenticationServiceImpl.onStart: 0.8 ms [Finished 2.040 s after backend start]
root INFO Backend PluginApiContribution.configure: 1.7 ms [Finished 2.041 s after backend start]
root INFO Backend HostedPluginReader.configure: 0.3 ms [Finished 2.043 s after backend start]
root INFO Backend HostedPluginReader.configure: 0.3 ms [Finished 2.043 s after backend start]
root INFO Backend PlotterBackendContribution.configure: 3.5 ms [Finished 2.048 s after backend start]
root INFO Theia app listening on http://localhost:50444.
root INFO Finished starting backend application: 12.4 ms [Finished 2.055 s after backend start]
root WARN The local plugin referenced by local-dir:/Users/Pete/.arduinoIDE/plugins does not exist.
root WARN The local plugin referenced by local-dir:/Users/Pete/.arduinoIDE/extensions does not exist.
root WARN The local plugin referenced by local-dir:/Users/Pete/.arduinoProIDE/plugins does not exist.
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "cortex-debug" to a VS Code extension "cortex-debug@0.3.10" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-arduino-tools" to a VS Code extension "vscode-arduino-tools@0.0.2-beta.5" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-builtin-cpp" to a VS Code extension "cpp@1.52.1" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-builtin-json" to a VS Code extension "json@1.46.1" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-builtin-json-language-features" to a VS Code extension "json-language-features@1.46.1" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-cs" to a VS Code extension "vscode-language-pack-cs@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-de" to a VS Code extension "vscode-language-pack-de@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-es" to a VS Code extension "vscode-language-pack-es@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-fr" to a VS Code extension "vscode-language-pack-fr@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-it" to a VS Code extension "vscode-language-pack-it@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-ja" to a VS Code extension "vscode-language-pack-ja@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-nl" to a VS Code extension "vscode-language-pack-nl@1.48.3" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-pt-BR" to a VS Code extension "vscode-language-pack-pt-BR@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-ru" to a VS Code extension "vscode-language-pack-ru@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-tr" to a VS Code extension "vscode-language-pack-tr@1.69.0" with engines:
root INFO PluginTheiaDirectoryHandler: accepting plugin with path
root INFO Resolved "vscode-language-pack-zh-hans" to a VS Code extension "vscode-language-pack-zh-hans@1.69.0" with engines:
root ERROR ---- !!!SLOW!!! DURATION: loadCliConfig took 116.916 ms. Args: [] ----
root INFO Resolve plugins list: 126.3 ms [Finished 2.164 s after backend start]
root INFO Deployed backend plugin "cortex-debug@0.3.10" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/cortex-debug/extension/dist/extension": 9.8 ms [Finished 2.175 s after backend start]
root INFO Deployed backend plugin "vscode-arduino-tools@0.0.2-beta.5" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-arduino-tools/extension/dist/bundle": 8.5 ms [Finished 2.183 s after backend start]
root INFO Deployed backend plugin "cpp@1.52.1" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-builtin-cpp/extension": 15.3 ms [Finished 2.199 s after backend start]
root INFO Deployed backend plugin "json@1.46.1" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-builtin-json/extension": 7.4 ms [Finished 2.206 s after backend start]
root INFO Deployed backend plugin "json-language-features@1.46.1" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-builtin-json-language-features/extension/client/dist/jsonMain": 4.9 ms [Finished 2.211 s after backend start]
root INFO Deployed backend plugin "vscode-language-pack-cs@1.69.0" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-language-pack-cs/extension": 216.9 ms [Finished 2.428 s after backend start]
daemon INFO Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied
time="2022-09-24T18:09:43+01:00" level=error msg="Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied"

daemon ERROR Error: Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied
time="2022-09-24T18:09:43+01:00" level=error msg="Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied"
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/lib/node/arduino-daemon-impl.js:220:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at Socket.Readable.push (node:internal/streams/readable:226:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli...
daemon INFO Daemon exited with exit code: 7.
root INFO Deployed backend plugin "vscode-language-pack-de@1.69.0" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-language-pack-de/extension": 94.5 ms [Finished 2.523 s after backend start]
root INFO Deployed backend plugin "vscode-language-pack-es@1.69.0" from "/Applications/Arduino IDE.app/Contents/Resources/app/plugins/vscode-language-pack-es/extension": 179.1 ms [Finished 2.702 s after backend start]
daemon INFO Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied
time="2022-09-24T18:09:43+01:00" level=error msg="Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied"

daemon ERROR Error: Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied
time="2022-09-24T18:09:43+01:00" level=error msg="Error: invalid path creating config dir: /Users/papahotel/Library/Arduino15 error: mkdir /Users/papahotel: permission denied"
    at Socket.<anonymous> (/Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/lib/node/arduino-daemon-impl.js:220:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at Socket.Readable.push (node:internal/streams/readable:226:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli...

Hi @mysterons

Do you have any idea why your operating system would deny the Arduino IDE permission to create this folder?

There isnt a user called papahotel (anymore) deleted a few years ago. Perhaps a relic from when I copied over the backup from the old imac to the new machine?

Found the problem - just had to run the command as superuser:

sudo "/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE"

All running ok now.

Thanks for taking the time to post an update with your findings @mysterons. I'm glad you got it working now.

It should not be necessary to run Arduino IDE as superuser, but it seems there is a problem with your system configuration.

I am having a real problem trying to run IDE 2.0 on a new Mac Studio with a clean install of Monterey. I have one user set up on the mac but the IDE is trying to install to an old (now deleted user) 'papahotel' Is there a way to for the installer to use the current user. I have deleted Arduino15, removed the Arduino folders and still the same. Why is it picking up an old user rather than the current one? I have no problems with IDE 1.18.

The error message displayed:

Error saving downloaded index: open
/users/papahotel/Library/Arduino15/package_index.json: permission denied

Thanks in advance.

Hi @mysterons. I'm sorry to hear you are still having trouble with this bad system configuration.

In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to run a command from the command line terminal, then share the output.

Please do this:

  1. Open your Applications folder.
  2. Open Utilities.
  3. Double-click on "Terminal".
  4. Type the following command:
    echo "$HOME"
    
  5. Press Enter
  6. Press +A.
    This will select all the text in the terminal window.
  7. Press +C.
    This will copy the selected text to the clipboard.
  8. Open a forum reply here by clicking the Reply button.
  9. Press +V.
    This will paste the output into the code block.
  10. Click the Reply button to post the output.

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

Hi,

Thanks for your time on this.

This is the screen grab:

Last login: Thu Oct 6 07:59:44 on console
Pete@Petes-Mac-Studio ~ % echo "$HOME"
/Users/Pete
Pete@Petes-Mac-Studio ~ %

The default configuration will base the location on the path defined by the HOME environment variable, so It should use the correct /Users/Pete/Library/Arduino15 instead of /Users/papahotel/Library/Arduino15.

I think the problem might be that the configuration file where this path is stored was was created at a time when the HOME variable still had the previous username. In this case, the solution will be to delete the configuration file, which will cause the Arduino IDE to create it over again with the right user name. I'll provide instructions:

  1. Close the Arduino IDE window if it is running.
  2. Delete the file at this path:
    /Users/Pete/.arduinoIDE/arduino-cli.yaml
    
    • :warning: Please be very careful when deleting things from your computer. When in doubt, back up!
    • :exclamation: The /Users/Pete/.arduinoIDE folder might be hidden by default in Finder. You can use the Command+Shift+. keyboard shortcut to reveal it.

Now try starting the IDE again. Hopefully it will start up without any problems this time.


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

Hi,

This seems to have sorted things out for me. The IDE now works everytime!

Thank you for taking the time to help resolver this - very much appreciated.

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

Regards,
Per

Hi @ptillisch I'm having the same problem as mysterons: I'm trying to download and run arduino 2.0.3 on my mac running Monterey 12.5 but when I open the application, no window appears, even though arduino opens in the menu bar. I went into terminal and tried to open it from the backend using ""/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE"" but this is the reply I get.

Last login: Mon Feb 20 11:57:25 on console
eleanormayes1@MacBook-Air-6 ~ % "/Applications/Arduino IDE.app/Contents/MacOS/Arduino IDE"
Arduino IDE 2.0.3
Starting backend process. PID: 1280
Using browser-only version of superagent in non-browser environment
Configuration directory URI: 'file:///Users/eleanormayes%201/.theia'
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
2023-02-20T20:27:08.654Z root INFO Backend Object.initialize: 5.7 ms [Finished 2.532 s after backend start]
2023-02-20T20:27:08.655Z root INFO Backend Object.configure: 4.5 ms [Finished 2.533 s after backend start]
2023-02-20T20:27:08.655Z root INFO Backend MessagingContribution.onStart: 2.4 ms [Finished 2.533 s after backend start]
2023-02-20T20:27:08.656Z root INFO Backend OSBackendApplicationContribution.configure: 0.7 ms [Finished 2.629 s after backend start]
2023-02-20T20:27:08.657Z root INFO Backend DefaultWorkspaceServer.onStart: 0.6 ms [Finished 2.629 s after backend start]
2023-02-20T20:27:08.658Z root INFO Backend PluginLocalizationBackendContribution.configure: 0.2 ms [Finished 2.629 s after backend start]
2023-02-20T20:27:08.659Z root WARN Backend PluginLocalizationBackendContribution.initialize took longer than the expected maximum 50 milliseconds: 96.7 ms [Finished 2.630 s after backend start]
2023-02-20T20:27:08.660Z root INFO Backend TaskBackendApplicationContribution.onStart: 0.4 ms [Finished 2.630 s after backend start]
2023-02-20T20:27:08.661Z root INFO Backend ElectronTokenBackendContribution.configure: 1.3 ms [Finished 2.631 s after backend start]
2023-02-20T20:27:08.662Z root INFO Backend PluginDeployerContribution.initialize: 0.7 ms [Finished 2.632 s after backend start]
2023-02-20T20:27:08.663Z root INFO Backend ConfigServiceImpl.onStart: 1.2 ms [Finished 2.632 s after backend start]
2023-02-20T20:27:08.664Z root INFO Backend WebviewBackendSecurityWarnings.initialize: 0.6 ms [Finished 2.634 s after backend start]
2023-02-20T20:27:08.665Z root INFO Backend ArduinoDaemonImpl.onStart: 1.5 ms [Finished 2.635 s after backend start]
2023-02-20T20:27:08.665Z root INFO Backend NodeFileUploadService.configure: 2.8 ms [Finished 2.635 s after backend start]
2023-02-20T20:27:08.665Z daemon INFO Starting daemon from /Applications/Arduino IDE.app/Contents/Resources/app/node_modules/arduino-ide-extension/build/arduino-cli...
2023-02-20T20:27:08.665Z discovery-log INFO start
2023-02-20T20:27:08.665Z discovery-log INFO start new deferred
2023-02-20T20:27:08.665Z root INFO Backend HostedPluginLocalizationService.initialize: 0.7 ms [Finished 2.637 s after backend start]
2023-02-20T20:27:08.666Z root INFO Backend BoardDiscovery.onStart: 1.6 ms [Finished 2.638 s after backend start]
2023-02-20T20:27:08.666Z root INFO Backend FileDownloadEndpoint.configure: 1.3 ms [Finished 2.638 s after backend start]
2023-02-20T20:27:08.666Z root INFO Backend AuthenticationServiceImpl.onStart: 0.7 ms [Finished 2.640 s after backend start]
2023-02-20T20:27:08.666Z root INFO Backend PluginApiContribution.configure: 0.7 ms [Finished 2.640 s after backend start]
2023-02-20T20:27:08.668Z root INFO Backend HostedPluginReader.configure: 0.4 ms [Finished 2.641 s after backend start]
2023-02-20T20:27:08.668Z root INFO Backend HostedPluginReader.configure: 0.2 ms [Finished 2.642 s after backend start]
2023-02-20T20:27:08.668Z root INFO Backend PlotterBackendContribution.configure: 1.8 ms [Finished 2.644 s after backend start]
2023-02-20T20:27:08.670Z root ERROR Failed to start the backend application:
2023-02-20T20:27:08.671Z root ERROR Error: getaddrinfo ENOTFOUND localhost
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
2023-02-20T20:27:08.671Z root ERROR Uncaught Exception: 
2023-02-20T20:27:08.671Z root ERROR Error: getaddrinfo ENOTFOUND localhost
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
2023-02-20T20:27:08.676Z root WARN The local plugin referenced by local-dir:/Users/eleanormayes%201/.arduinoIDE/plugins does not exist.
2023-02-20T20:27:08.676Z root WARN The local plugin referenced by local-dir:/Users/eleanormayes%201/.arduinoIDE/extensions does not exist.
2023-02-20T20:27:08.677Z root WARN The local plugin referenced by local-dir:/Users/eleanormayes 1/.arduinoProIDE/plugins does not exist.

when I run echo "$HOME" I get

Last login: Mon Feb 20 12:25:30 on ttys000
eleanormayes1@MacBook-Air-6 ~ % echo "$HOME"
/Users/eleanormayes 1
eleanormayes1@MacBook-Air-6 ~ % 

I've never had a user called eleanormayes%201, so I'm not sure where it is getting that from. I also removed my old sketchbook from my documents (I put it on an external drive) and deleted it from my computer, as well as removing the Arduino15 folder before I tried installing 2.0.3 again. No luck unfortunately. Any help or other ideas you can provide would be amazing, thank you!

Hi @emayes

Have you made any modifications, or is there anything notable about your "hosts file", especially in regards to the definition of localhost?

The "hosts file" is located at /etc/hosts (AKA /private/etc/hosts).

%20 is "percent encoding" for the space character in your username eleanormayes 1. This is not related to the problem.

That was it! Turns out my hosts file was corrupted, and when I repaired it the IDE opened properly! Thanks so much

You are welcome. I'm glad it is working now. Thanks for taking the time to post an update with your solution!

Regards,
Per

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