esteinberg / plantuml4idea

Intellij IDEA plugin for PlantUML
Apache License 2.0
618 stars 111 forks source link

Plugin not working properly on IntelliJ, but works on PyCharm #379

Open GabrielDumbrava opened 1 year ago

GabrielDumbrava commented 1 year ago

It seems that the plugin is not working properly on IntelliJ, but works perfectly on PyCharm.

Here is a comparison of the two, with the IntelliJ on the left and pycharm on the right:

2023-02-13_11-44

If I remove the second object from the IntelliJ definition then the code is rendered properly: 2023-02-13_11-44_1

I'm using the same plugin version and the same configuration on the same Ubuntu 22.04 machine. 2023-02-13_11-46

GabrielDumbrava commented 1 year ago

If I change the path to the dot to /usr/bin/dot which is the place where the bash shell finds it then I get the same error, File does not exist. Upon further investigation I see that IntelliJ is using /bin/sh as shell whereas PyCharm uses /bin/bash. If I try to find /usr/bin/dot with sh the I get no file with that name.

On bash it's a link to /usr/bin/dot -> ../sbin/libgvc6-config-update*, so this might be a difference between the two apps.

ConorGarry commented 1 year ago

I'm having a very similar issue with Android Studio.

Seems to work fine if I have a single class in a diagram: Screenshot 2023-02-21 at 14 56 18

But if I add a second class it breaks with the same error:

Screenshot 2023-02-21 at 14 56 12

From the logs:

2023-02-21 13:30:49,134 [4857496]   INFO - STDERR - java.io.IOException: Cannot run program "/opt/local/bin/dot": error=2, No such file or directory
2023-02-21 13:30:49,134 [4857496]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
2023-02-21 13:30:49,134 [4857496]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
2023-02-21 13:30:49,134 [4857496]   INFO - STDERR -     at java.base/java.lang.Runtime.exec(Runtime.java:594)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.cucadiagram.dot.ProcessRunner$MainThread.startThreads(ProcessRunner.java:163)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.cucadiagram.dot.ProcessRunner$MainThread.runJob(ProcessRunner.java:123)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.api.TimeoutExecutor$MyThread.run(TimeoutExecutor.java:79)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR - Caused by: java.io.IOException: error=2, No such file or directory
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     ... 5 more
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR - java.io.IOException: Cannot run program "/opt/local/bin/dot": error=2, No such file or directory
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.Runtime.exec(Runtime.java:594)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.cucadiagram.dot.ProcessRunner$MainThread.startThreads(ProcessRunner.java:163)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.cucadiagram.dot.ProcessRunner$MainThread.runJob(ProcessRunner.java:123)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at net.sourceforge.plantuml.api.TimeoutExecutor$MyThread.run(TimeoutExecutor.java:79)
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR - Caused by: java.io.IOException: error=2, No such file or directory
2023-02-21 13:30:49,135 [4857497]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
2023-02-21 13:30:49,136 [4857498]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
2023-02-21 13:30:49,136 [4857498]   INFO - STDERR -     at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
2023-02-21 13:30:49,136 [4857498]   INFO - STDERR -     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
2023-02-21 13:30:49,136 [4857498]   INFO - STDERR -     ... 5 more

Android Studio Flamingo | 2022.2.1 Beta 2 Build #AI-222.4459.24.2221.9526055, built on January 25, 2023 Runtime version: 17.0.5+7-b469.71 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

krasa commented 1 year ago

Isn't there some permission problem? Does it work directly from the IDE's terminal? https://plantuml.com/command-line

krasa commented 1 year ago

A single class in a diagram works because it does not use Graphviz.

What does this show?

@startuml
testdot
@enduml
REBOOTERS commented 10 months ago

A single class in a diagram works because it does not use Graphviz.

What does this show?

@startuml
testdot
@enduml
image
REBOOTERS commented 10 months ago

activity-diagram is ok, object-diagram don't work

krasa commented 10 months ago

@REBOOTERS That did not work, because of a configured skin. Try this:

image

krasa commented 10 months ago

Is it still broken? It should be fixed with 1.2023.8 But if the configured path (in the plugin settings dialog) did not work before, then I doubt that it will help.

https://github.com/plantuml/plantuml/issues/469

GabrielDumbrava commented 10 months ago

I did take a second look and I have a few more details. First the PyCharm (left) and IntelliJ (right) configurations are the same:

2023-09-06_20-44

One difference between them is that IntelliJ is using sh as shell and the file owners seem to be completely different than the ones on the system, and as seen by PyCharm.

IntelliJ can't find /usr/bin/dot and the file owner is nfsnobody.nfsnobody as you can see bellow:

2023-09-06_20-37

PyCharm correctly, and using bash, can access the file:

2023-09-06_20-49

Also the locale is different on IntelliJ than with PyCharm, even if I did a complete reset of IntelliJ settings.