devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
8 stars 18 forks source link

Mac not able to create temporary download directory #524

Open jan-vcapgemini opened 1 month ago

jan-vcapgemini commented 1 month ago

IDEasy is not able to create the temporary download directory on Mac.

IdeasyTestProjects % ide
/Users/mymac/Documents/Dev/IdeasyTestProjects/_ide/bin/ide:14: no such file or directory: ./ideasy
IdeasyTestProjects % ideasy
zsh: command not found: ideasy
IdeasyTestProjects % bash
devonfw-ide environment variables have been set for /Users/mymac in workspace main

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ ide
Exception in thread "main" java.lang.IllegalStateException: Failed to create directory /Users/_ide/tmp/Downloads
        at com.devonfw.tools.ide.io.FileAccessImpl.mkdirs(FileAccessImpl.java:194)
        at com.devonfw.tools.ide.context.AbstractIdeContext.<init>(AbstractIdeContext.java:202)
        at com.devonfw.tools.ide.context.IdeContextConsole.<init>(IdeContextConsole.java:29)
        at com.devonfw.tools.ide.cli.Ideasy.context(Ideasy.java:36)
        at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:73)
        at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:28)
        at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.nio.file.AccessDeniedException: /Users/_ide
        at java.base@21.0.2/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:438)
        at java.base@21.0.2/java.nio.file.Files.createDirectory(Files.java:699)
        at java.base@21.0.2/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
        at java.base@21.0.2/java.nio.file.Files.createDirectories(Files.java:793)
        at com.devonfw.tools.ide.io.FileAccessImpl.mkdirs(FileAccessImpl.java:192)
        ... 6 more

Hints:

This Failed to create directory /Users/_ide/tmp/Downloads looks bad.

Affected version:

hohwille commented 2 weeks ago

This Failed to create directory /Users/_ide/tmp/Downloads looks bad.

There is either a clean bug in our code or the installation was done wrong. IDE_ROOT should point to the users home directory /Users/mymac or somewhere within that but NOT /Users. Therefore /Users/_ide is dead wrong. Due to limited permissions and security restrictions you cannot create new user directories on MacOS without privileges.

The error messages at the beginning however look as if the installation is not sane and IDEasy was not properly installed on that Mac:

  1. IDE_ROOT is not defined
  2. If IDE_ROOT was /Users/mymac/Documents/Dev/IdeasyTestProjects/ then /Users/mymac/Documents/Dev/IdeasyTestProjects/_ide/bin/ needs to be added to the PATH what is obviously not the case (command not found: ideasy).