Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphvizException: None of the provided engines could be initialized #244

Closed
gui1207 opened this issue Feb 28, 2022 · 16 comments · Fixed by #278
Closed

GraphvizException: None of the provided engines could be initialized #244

gui1207 opened this issue Feb 28, 2022 · 16 comments · Fixed by #278
Labels
bug Something isn't working os/ios-arm

Comments

@gui1207
Copy link

gui1207 commented Feb 28, 2022

Hi,
I've installed the mulefd using homebrew and I'm trying to use it but I'm facing the following error:

2022-02-28 15:04:46,789 INFO [c.j.m.a.Application] - Mule Flow Diagrams - 0.7.4, Started at 28-Feb-2022 15:04:46.785
2022-02-28 15:04:46,793 INFO [c.j.m.DiagramRenderer] - Found standard Mule 4 source structure 'src/main/mule'. Source is a Mule-4 project.
2022-02-28 15:04:46,793 INFO [c.j.m.DiagramRenderer] - Source directory 'mule-project/src/main/mule' will be scanned recursively to find Mule 4 configuration files.
2022-02-28 15:04:46,832 INFO [c.j.m.DiagramRenderer] - Initiating drawing Graph at rail-logistics-order-proc
guru.nidi.graphviz.engine.GraphvizException: None of the provided engines could be initialized.
at guru.nidi.graphviz.engine.Graphviz.getEngine(Graphviz.java:162)
at guru.nidi.graphviz.engine.Graphviz.doExecute(Graphviz.java:312)
at guru.nidi.graphviz.engine.Graphviz.execute(Graphviz.java:292)
at guru.nidi.graphviz.engine.Renderer.execute(Renderer.java:139)
at guru.nidi.graphviz.engine.Renderer.toFile(Renderer.java:59)
at com.javastreets.mulefd.drawings.GraphDiagram.writGraphToFile(GraphDiagram.java:145)
at com.javastreets.mulefd.drawings.GraphDiagram.draw(GraphDiagram.java:83)
at com.javastreets.mulefd.DiagramRenderer.diagram(DiagramRenderer.java:186)
at com.javastreets.mulefd.DiagramRenderer.render(DiagramRenderer.java:102)
at com.javastreets.mulefd.app.Application.call(Application.java:59)
at com.javastreets.mulefd.app.Application.call(Application.java:19)
at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
at picocli.CommandLine.access$1100(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
at picocli.CommandLine.execute(CommandLine.java:2058)
at com.javastreets.mulefd.app.Application.main(Application.java:50)

Using Mac M1 Big Sur - 11.6 & Java 8
java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (Zulu 8.60.0.21-CA-macos-aarch64) (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (Zulu 8.60.0.21-CA-macos-aarch64) (build 25.322-b06, mixed mode)

@manikmagar
Copy link
Owner

@gui1207 Thank you very much for trying it out. Apologies for missing this issue, wonder where that notification went 🤔. Are you still facing this issue?

@manikmagar
Copy link
Owner

Just tried same mulefd version but my local env is different -

image

@gui1207
Copy link
Author

gui1207 commented Jun 28, 2022

Hi @manikmagar, no worries.

Yes, I tested it again and had the same issue.

2022-06-28 14:45:18,759 INFO  [c.j.m.a.Application] - Mule Flow Diagrams - 0.7.4, Started at 28-Jun-2022 14:45:18.755
2022-06-28 14:45:18,763 INFO  [c.j.m.DiagramRenderer] - Found standard Mule 4 source structure 'src/main/mule'. Source is a Mule-4 project.
2022-06-28 14:45:18,763 INFO  [c.j.m.DiagramRenderer] - Source directory './src/main/mule' will be scanned recursively to find Mule 4 configuration files.
2022-06-28 14:45:18,789 INFO  [c.j.m.DiagramRenderer] - Initiating drawing Graph at .
guru.nidi.graphviz.engine.GraphvizException: None of the provided engines could be initialized.
	at guru.nidi.graphviz.engine.Graphviz.getEngine(Graphviz.java:162)
	at guru.nidi.graphviz.engine.Graphviz.doExecute(Graphviz.java:312)
	at guru.nidi.graphviz.engine.Graphviz.execute(Graphviz.java:292)
	at guru.nidi.graphviz.engine.Renderer.execute(Renderer.java:139)
	at guru.nidi.graphviz.engine.Renderer.toFile(Renderer.java:59)
	at com.javastreets.mulefd.drawings.GraphDiagram.writGraphToFile(GraphDiagram.java:145)
	at com.javastreets.mulefd.drawings.GraphDiagram.draw(GraphDiagram.java:83)
	at com.javastreets.mulefd.DiagramRenderer.diagram(DiagramRenderer.java:186)
	at com.javastreets.mulefd.DiagramRenderer.render(DiagramRenderer.java:102)
	at com.javastreets.mulefd.app.Application.call(Application.java:59)
	at com.javastreets.mulefd.app.Application.call(Application.java:19)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at com.javastreets.mulefd.app.Application.main(Application.java:50)
java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (Zulu 8.60.0.21-CA-macos-aarch64) (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (Zulu 8.60.0.21-CA-macos-aarch64) (build 25.322-b06, mixed mode)
guilherme@macbook customer-profile-exp-api-example % sw_vers
ProductName:	macOS
ProductVersion:	12.4
BuildVersion:	21F79

@manikmagar
Copy link
Owner

That is puzzling. I will try to reproduce it. The graph engine is bundled, so should be there.

@manikmagar
Copy link
Owner

@gui1207 Are you on the Apple M1 Chip / ARM CPU? Looking at the JDK (Zulu 8.60.0.21-CA-macos-aarch64) you are using, it seems so. I am unable to reproduce it on my mac (Intel chip).

@manikmagar
Copy link
Owner

MuleFD uses V8 engine but looks like it is not compatible with M1 Chip. See notes on nidi3/graphviz-java#230. Need to look for alternative approach.

@gui1207 Is it possible for you to try using docker and run MuleFD? See instructions on https://github.com/manikmagar/mulefd#docker-docker for instructions. Thanks!

@gui1207
Copy link
Author

gui1207 commented Jul 22, 2022

Hi @manikmagar!

No worries, it worked using docker as suggested.

Thanks

@manikmagar
Copy link
Owner

Glad to know that Docker worked. I will keep this issue open to track a fix for M1.

@gui1207
Copy link
Author

gui1207 commented Jul 22, 2022

Cool. If you need any tests with M1, please let me know.

@manikmagar
Copy link
Owner

@gui1207 PR #278 should fix the issue of not able to run on M1. Would you like to clone this repo and run tests to confirm?

In case you need, here are the steps -

  1. Clone this repo.
  2. Run ./gradlew check on the master branch. You should see few failures with the same exception that you reported here.
  3. Change to the fix branch - git switch feat/graphviz-engine-usage
  4. Run ./gradlew check on that branch. All test should succeed due to the fix in the branch.

Thanks in advance!

@gui1207
Copy link
Author

gui1207 commented Oct 3, 2022

Hi @manikmagar,

Master failed as expected with the guru.nidi.graphviz.engine.GraphvizException: None of the provided engines could be initialized. error.

The feature branch did not fail with the GraphvizException but failed in other build tests. Potentially just minor adjustments for other tests.

com.javastreets.mulefd.drawings.GraphDiagramTest

  Test Throw error when given flow name not found PASSED
  Test supports() PASSED
  Test writeFlowGraphWithSubFlow() PASSED
  Test Validate generated graph for APIKIT flows when generated as JSON. FAILED

Full log: https://gist.github.com/gui1207/b0770b75a753eef23bf9e05e1d6160df

@manikmagar
Copy link
Owner

Thank you @gui1207. That's a good catch. I was able to reproduce it and see why it did not fail for me. This existing test compares the JSON previously generated using V8 engine (which isn't available for M1 now).

I have dot installed on my M1 but looks like dot engine isn't accessible to IntelliJ (PATH reference issues depending on how IntelliJ is started). So execution from IntelliJ ended up using JDK Engine which also generated the same JSON. But when I run test from the command line, where dot is not accessible, it is being used over other engines.

It might be best to change the order of available engine checks from the default dot, V8, JDK to V8, JDK, dot and retain same behavior.

I'll let you know once I make that change. Thanks for the help!

@manikmagar
Copy link
Owner

@gui1207 If you can, please give it a try again with the latest code. Thanks!

@gui1207
Copy link
Author

gui1207 commented Oct 4, 2022

Hi @manikmagar

It's working now! BUILD SUCCESSFUL

@manikmagar
Copy link
Owner

Thank you for verifying @gui1207.

@manikmagar
Copy link
Owner

Released with version 0.8.4. Please try installing the latest. For mac brew install manikmagar/tap/mulefd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os/ios-arm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants