avisi-cloud/structurizr-site-generatr

structurizr-site-generatr can't find dot executable (but plantuml can)

hertzsprung opened this issue · 6 comments

On xubuntu 22.04 I install graphviz and dot with apt install graphviz. dot is installed at /usr/bin/dot.
From structurizr-site-generatr/lib (version 1.0.25), running java -jar plantuml-1.2023.1.jar -testdot succeeds with:

dot version: dot - graphviz version 2.43.0 (0)
Installation seems OK. File generation OK

But when running structurizr-site-generatr serve and visiting localhost:8080 I get the error:

Dot Executable: /opt/local/bin/dot
File does not exist
Cannot find Graphviz. You should try

@startuml
testdot
@enduml

or

java -jar plantuml.jar -testdot

This error comes from plantuml.

Why can plantuml find dot but structurizr-site-generatr can't? Is structurizr-site-generatr actually looking for /opt/local/bin/dot or is the error message misleading?

qtzar commented

Is there a stacktrace in the console during site generation?

From the PlantUML docs :

By default, the dot executable is expected:

Firstly in: /usr/local/bin/dot
Then in: /usr/bin/dot

You can also specify the environment variable GRAPHVIZ_DOT to set the exact location of your GraphViz executable.

I had the exact same error on one of my machines and then realized that I had not installed Graphviz yet on that machine but that isn't very helpful as you say you have it installed.

I see no stacktraces in the console. I also tried symlinking /opt/local/bin/dot to /usr/bin/dot but the error is the same.

qtzar commented

Just took some time to install XUbuntu 22.04 and JDK19 in a virtual machine and I cannot duplicate the issue.

I did notice that Graphviz was already installed as part of the XUbuntu base install.

Sorry that this hasn't been very helpful.

How strange, thanks so much for taking a look! I started with the minimal install (selected in the xubuntu graphical installer) and installed graphviz separately.

Structurizr Site Generatr does not check whether or not dot exists, so this is 100% PlantUML.

When this error occurs, structurizr-site-generatr should also print a stack trace to the console. Is this the case? If yes, could you please paste it here? This could be helpful in determining why this error occurs.

I don't know what changed (perhaps I just need to reboot) but this is working for me now.