Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz error now breaking schemaspy db generation

I have been using Schemaspy(v5.0) to diagram mySQL(v5.7.11) using Graphviz via Homebrew on my Mac (El Capitan). A recent update to Graphviz(v2.40.1) apparently has broken Schemaspy's ability to generate the relational diagrams.

Writing/graphing summary.....org.schemaspy.util.Dot$DotFailure: 'dot -Tpng:gd 
/Tools/docs/data/project/diagrams/summary/relationships.real.compact.dot 
-o/Tools/docs/data/project/diagrams/summary/relationships.real.compact.png 
-Tcmapx' 
failed with return code 139

To solve this issue, I have tried:

  • uninstall/reinstall graphviz
  • downgrade Graphviz(v2.38 - it was the only version I could find and homebrew didn't have any older versions either) but it hosed my install
  • attempted to run on a colleague's computer with same results
  • tried the new beta version of schemaspy(v6.0-beta3)
  • searched graphviz forums (page crashed), stackoverflow, and general google search.

Looking to figure out how to get this working again.


[Edit] I didn't find a solution to why SchemaSpy/Graphviz stopped working (or wtf "code 139" meant), but I did use a workaround.

  • Install Docker
  • Get mnuessler/schemaspy or similar from hub.docker.com
  • open a volume to your host - it will be used in the docker command
  • run the command below

docker run -it --rm -v /docs/data:/data mnuessler/schemaspy -hq -t mysql -host localhost -u root -p root -db things -o /data/leads

where -v is the volume you opened on your host and -o /data/... is where the output will show up after the run

like image 326
Shane Funk Avatar asked Jan 24 '17 19:01

Shane Funk


1 Answers

Version 6.1.0 of SchemaSpy has removed the dependency on GraphViz, so you can avoid this problem by using this version.


Version 6.1.0 has not been released yet, but you can download a snapshot. This version includes a JavaScript implementation of GraphViz which can be used instead of looking for GraphViz on the PATH.

I'm not sure whether the JavaScript version is used by default, but you can force this behaviour by supplying a -vizjs argument, e.g.

java -jar ./schemaspy-6.1.0-SNAPSHOT.jar -vizjs -t pgsql -o output 
    -host localhost -port 5432 -s public -db my_db -u root -p password 
    -dp jdbc/postgresql-42.2.6.jar
like image 60
Dónal Avatar answered Oct 21 '22 16:10

Dónal