-failsafe doesn't catch graphviz missing error

0 votes
asked Oct 9, 2023 in Bug by costateixeira (500 points)

On Mac, if graphviz is needed but not installed, even adding -failsafe2 doesn't make plantuml fail. Testing shows that there's an error log but error code is 0:

➜  scripts git:(master) ✗ java -jar ./plantuml.jar -nometadata -failfast2 -tpng  2023genderharmony.plantuml
java.io.IOException: Cannot run program "/opt/local/bin/dot": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:615)
at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.startThreads(ProcessRunner.java:160)
at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.runJob(ProcessRunner.java:120)
at net.sourceforge.plantuml.api.TimeoutExecutor$MyThread.run(TimeoutExecutor.java:76)
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 5 more
java.io.IOException: Cannot run program "/opt/local/bin/dot": error=2, No such file or directory
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:615)
at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.startThreads(ProcessRunner.java:160)
at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.runJob(ProcessRunner.java:120)
at net.sourceforge.plantuml.api.TimeoutExecutor$MyThread.run(TimeoutExecutor.java:76)
Caused by: java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 5 more
➜  scripts git:(master) ✗ echo $?                                                                         
0

I presume this is a bug - this should return a non-zero value

commented Oct 17, 2023 by costateixeira (500 points)
Anything we can do to work around this?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...