devonfw / IDEasy

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

pgadmin not working on Mac #798

Open hohwille opened 6 days ago

hohwille commented 6 days ago

Expected behavior

As a IDEasy user, I want to install and run pgadmin with ide command so that I can access my DB.

Actual behavior

$ ide pgadmin
Trying to download pgadmin-8.13-mac-x64.dmg from https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v8.13/macos/pgadmin4-8.13-x86_64.dmg
Downloading 100% │██████████████████████████████████████████████████████████████████████████████████│ 202/202MiB (0:00:10 / 0:00:00) 20.3MiB/s
Checksum 70c7ab01ee7c54ede70bd69ef7bfd1f57717bc383aa737a82f75d236e4ad4974 is correct.
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/IDEasy/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=IllegalStateException%3A+Running+command+%27%2FUsers%2Fhohwille%2FDownloads%2Fide%2Fdefault%2Fpgadmin-8.13-mac-x64.dmg%27+with+arguments+%27bash%27+%27-c%27+%27+%26+disown%27+failed%3A+Cannot+run+program+%22%2FUsers%2Fhohwille%2FDownloads%2Fide%2Fdefault%2Fpgadmin-8.13-mac-x64.dmg%22%3A+error%3D13%2C+Permission+denied
java.lang.IllegalStateException: Running command '/Users/hohwille/Downloads/ide/default/pgadmin-8.13-mac-x64.dmg' with arguments 'bash' '-c' ' & disown' failed: Cannot run program "/Users/hohwille/Downloads/ide/default/pgadmin-8.13-mac-x64.dmg": error=13, Permission denied
    at com.devonfw.tools.ide.process.ProcessContextImpl.run(ProcessContextImpl.java:204)
    at com.devonfw.tools.ide.tool.GlobalToolCommandlet.install(GlobalToolCommandlet.java:145)
    at com.devonfw.tools.ide.tool.pgadmin.PgAdmin.install(PgAdmin.java:38)
    at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:166)
    at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:152)
    at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:139)
    at com.devonfw.tools.ide.tool.ToolCommandlet.run(ToolCommandlet.java:130)
    at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:860)
    at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:767)
    at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:89)
    at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:52)
    at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:29)
    at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.io.IOException: Cannot run program "/Users/hohwille/Downloads/ide/default/pgadmin-8.13-mac-x64.dmg": error=13, Permission denied
    at java.base@21.0.2/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
    at java.base@21.0.2/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
    at com.devonfw.tools.ide.process.ProcessContextImpl.run(ProcessContextImpl.java:173)
    ... 12 more
Caused by: java.io.IOException: error=13, Permission denied
    at java.base@21.0.2/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base@21.0.2/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
    at java.base@21.0.2/java.lang.ProcessImpl.start(ProcessImpl.java:225)
    at java.base@21.0.2/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
    ... 14 more

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ide pgadmin

Related/Dependent Issues

Comments/Hints:

Why do we try to execute the *.dmg file? We need to mount it and copy the content what is already implemented by our extract method. Seems that our GlobalToolCommandlet code by default runs anything that was downloaded independent of the extensiion. This can be fixed easily. However, this requires MacOS knowledge - we do have the logic to mount dmg and copy its contents already in extract functionality. However, here we need to copy the app to /applications what is a privileged operation. IMHO to be done with sudo - see also #415

Affected version:

hohwille commented 4 days ago

Duplicate of #799 ? Nope.