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

getting errors when run this program #270

Open
cloudjourney101 opened this issue Sep 10, 2020 · 16 comments
Open

getting errors when run this program #270

cloudjourney101 opened this issue Sep 10, 2020 · 16 comments
Labels
help wanted Extra attention is needed

Comments

@cloudjourney101
Copy link

Hi There, I am following the website install guide to install and try a demo diagram. but I am getting below errors, could you provide some help on fixing this error? I am running it on MacOS Catalina.

python3.7 demo.py
Traceback (most recent call last):
File "databasechoices.py", line 10, in
EC2("web")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 147, in exit
self.render()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 189, in render
self.dot.render(format=self.outformat, view=self.show, quiet=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/files.py", line 209, in render
quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 206, in render
run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 172, in run
output=out, stderr=err)
graphviz.backend.CalledProcessError: Command '['dot', '-Tpng', '-O', 'simple_diagram']' died with <Signals.SIGABRT: 6>. [stderr: b"2020-09-10 14:05:35.547 dot[4726:59127] +[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff88cd88e0\n2020-09-10 14:05:35.547 dot[4726:59127] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff88cd88e0'\n*** First throw call stack:\n(\n\t0 CoreFoundation 0x00007fff313b0b57 __exceptionPreprocess + 250\n\t1 libobjc.A.dylib 0x00007fff6a1f75bf objc_exception_throw + 48\n\t2 CoreFoundation 0x00007fff3142fb37 __CFExceptionProem + 0\n\t3 CoreFoundation 0x00007fff313153bb forwarding + 1427\n\t4 CoreFoundation 0x00007fff31314d98 _CF_forwarding_prep_0 + 120\n\t5 CoreFoundation 0x00007fff312c8588 CFStringCompareWithOptionsAndLocale + 72\n\t6 ImageIO 0x00007fff341f7686 _ZN17IIO_ReaderHandler15readerForUTTypeEPK10__CFString + 50\n\t7 ImageIO 0x00007fff341f74b1 _ZN14IIOImageSource14extractOptionsEP13IIODictionary + 155\n\t8 ImageIO 0x00007fff34224ce1 CGImageSourceCreateWithDataProvider + 213\n\t9 libgvplugin_quartz.6.dylib 0x000000010e16fc5c quartz_loadimage_quartz + 224\n\t10 libgvc.6.dylib 0x000000010e0b49bd gvloadimage + 269\n\t11 libgvc.6.dylib 0x000000010e0b3a21 gvrender_usershape + 956\n\t12 libgvc.6.dylib 0x000000010e0e16ba poly_gencode + 2168\n\t13 libgvc.6.dylib 0x000000010e0edb41 emit_node + 1025\n\t14 libgvc.6.dylib 0x000000010e0ec8d0 emit_graph + 5048\n\t15 libgvc.6.dylib 0x000000010e0f1e4c gvRenderJobs + 4936\n\t16 dot 0x000000010e0a7d62 main + 697\n\t17 libdyld.dylib 0x00007fff6b39fcc9 start + 1\n)\nlibc++abi.dylib: terminating with uncaught exception of type NSException\n"]

@cloudjourney101
Copy link
Author

I am using python3.7, MacOS Catalina 10.15.6 (19G2021)
dot -V
dot - graphviz version 2.40.1 (20161225.0304)

@MaxwellNM
Copy link

Same thing for me
python3.7, MacOS Catalina 10.15.6
dot -V
dot - graphviz version 2.44.1 (20200629.0846)
when I run this sample
`# diagram.py
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Web Service", show=False):
ELB("lb") >> EC2("web") >> RDS("userdb")`
It doesn't display

@cloudjourney101
Copy link
Author

@mingrammer Could give us some help on this issue?Thanks

@mingrammer
Copy link
Owner

mingrammer commented Sep 14, 2020

@MaxwellNM @cloudjourney101 It seems an issue related to Graphviz. Could you please update the Xcode to the latest version?

@gabriel-tessier
Copy link
Collaborator

@cloudjourney101 @MaxwellNM
I can't help you on the error but I can propose an alternative, If you can use docker there's a docker image that can run and execute your python to generate the image. Follow the instruction in the DEVELOPMENT.md and run docker exec diagrams python your_file.py
There's a web alternative with docker: https://github.com/diagrams-web/diagrams-web
or an heroku app: https://github.com/renyuanz/microdiagram

@cloudjourney101
Copy link
Author

@mingrammer I installed the latest beta Xcode, reinstalled graphviz and diagramss, still get below error. Any suggestions?

python3.7 diagram.py
Traceback (most recent call last):
File "diagram.py", line 8, in
ELB("lb") >> EC2("web") >> RDS("userdb")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 147, in exit
self.render()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 189, in render
self.dot.render(format=self.outformat, view=self.show, quiet=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/files.py", line 209, in render
quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 206, in render
run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 172, in run
output=out, stderr=err)
graphviz.backend.CalledProcessError: Command '['dot', '-Tpng', '-O', 'web_service']' died with <Signals.SIGABRT: 6>. [stderr: b"2020-09-19 09:46:21.260 dot[8529:160865] +[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff8d9298e0\n2020-09-19 09:46:21.260 dot[8529:160865] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff8d9298e0'\n*** First throw call stack:\n(\n\t0 CoreFoundation 0x00007fff36001b57 __exceptionPreprocess + 250\n\t1 libobjc.A.dylib 0x00007fff6ee8b5bf objc_exception_throw + 48\n\t2 CoreFoundation 0x00007fff36080b37 __CFExceptionProem + 0\n\t3 CoreFoundation 0x00007fff35f663bb forwarding + 1427\n\t4 CoreFoundation 0x00007fff35f65d98 _CF_forwarding_prep_0 + 120\n\t5 CoreFoundation 0x00007fff35f19588 CFStringCompareWithOptionsAndLocale + 72\n\t6 ImageIO 0x00007fff38e48686 _ZN17IIO_ReaderHandler15readerForUTTypeEPK10__CFString + 50\n\t7 ImageIO 0x00007fff38e484b1 _ZN14IIOImageSource14extractOptionsEP13IIODictionary + 155\n\t8 ImageIO 0x00007fff38e75ce1 CGImageSourceCreateWithDataProvider + 213\n\t9 libgvplugin_quartz.6.dylib 0x000000010e9fcc5c quartz_loadimage_quartz + 224\n\t10 libgvc.6.dylib 0x000000010e9409bd gvloadimage + 269\n\t11 libgvc.6.dylib 0x000000010e93fa21 gvrender_usershape + 956\n\t12 libgvc.6.dylib 0x000000010e96d6ba poly_gencode + 2168\n\t13 libgvc.6.dylib 0x000000010e979b41 emit_node + 1025\n\t14 libgvc.6.dylib 0x000000010e9788d0 emit_graph + 5048\n\t15 libgvc.6.dylib 0x000000010e97de4c gvRenderJobs + 4936\n\t16 dot 0x000000010e937d62 main + 697\n\t17 libdyld.dylib 0x00007fff70033cc9 start + 1\n\t18 ??? 0x0000000000000004 0x0 + 4\n)\nlibc++abi.dylib: terminating with uncaught exception of type NSException\n"]

@mingrammer
Copy link
Owner

How did you install the Graphviz?

@mingrammer
Copy link
Owner

Please check this similar issue as reference: #125

@cloudjourney101
Copy link
Author

brew uninstall graphviz
then
brew install graphviz

@cloudjourney101
Copy link
Author

hmm, that is reall strange

xcodebuild -version
Xcode 12.0
Build version 12A8189n
dot -V
dot - graphviz version 2.40.1 (20161225.0304)

python3.7 diagram.py
Traceback (most recent call last):
File "diagram.py", line 8, in
ELB("lb") >> EC2("web") >> RDS("userdb")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 147, in exit
self.render()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diagrams/init.py", line 189, in render
self.dot.render(format=self.outformat, view=self.show, quiet=True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/files.py", line 209, in render
quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 206, in render
run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/graphviz/backend.py", line 172, in run
output=out, stderr=err)
graphviz.backend.CalledProcessError: Command '['dot', '-Tpng', '-O', 'web_service']' died with <Signals.SIGABRT: 6>. [stderr: b"2020-09-19 10:37:59.490 dot[11031:185105] +[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff8d9298e0\n2020-09-19 10:37:59.491 dot[11031:185105] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[__NSCFConstantString length]: unrecognized selector sent to class 0x7fff8d9298e0'\n*** First throw call stack:\n(\n\t0 CoreFoundation 0x00007fff36001b57 __exceptionPreprocess + 250\n\t1 libobjc.A.dylib 0x00007fff6ee8b5bf objc_exception_throw + 48\n\t2 CoreFoundation 0x00007fff36080b37 __CFExceptionProem + 0\n\t3 CoreFoundation 0x00007fff35f663bb forwarding + 1427\n\t4 CoreFoundation 0x00007fff35f65d98 _CF_forwarding_prep_0 + 120\n\t5 CoreFoundation 0x00007fff35f19588 CFStringCompareWithOptionsAndLocale + 72\n\t6 ImageIO 0x00007fff38e48686 _ZN17IIO_ReaderHandler15readerForUTTypeEPK10__CFString + 50\n\t7 ImageIO 0x00007fff38e484b1 _ZN14IIOImageSource14extractOptionsEP13IIODictionary + 155\n\t8 ImageIO 0x00007fff38e75ce1 CGImageSourceCreateWithDataProvider + 213\n\t9 libgvplugin_quartz.6.dylib 0x000000010a78ec5c quartz_loadimage_quartz + 224\n\t10 libgvc.6.dylib 0x000000010a6cc9bd gvloadimage + 269\n\t11 libgvc.6.dylib 0x000000010a6cba21 gvrender_usershape + 956\n\t12 libgvc.6.dylib 0x000000010a6f96ba poly_gencode + 2168\n\t13 libgvc.6.dylib 0x000000010a705b41 emit_node + 1025\n\t14 libgvc.6.dylib 0x000000010a7048d0 emit_graph + 5048\n\t15 libgvc.6.dylib 0x000000010a709e4c gvRenderJobs + 4936\n\t16 dot 0x000000010a6c2d62 main + 697\n\t17 libdyld.dylib 0x00007fff70033cc9 start + 1\n\t18 ??? 0x0000000000000004 0x0 + 4\n)\nlibc++abi.dylib: terminating with uncaught exception of type NSException\n"]

@mingrammer
Copy link
Owner

🤔 Hmm .. I also need to find a solution with googling.

@mingrammer mingrammer added the help wanted Extra attention is needed label Sep 19, 2020
@cloudjourney101
Copy link
Author

I got no luck googling LOL

@mingrammer
Copy link
Owner

Could you please try this? #125 (comment)

@cloudjourney101
Copy link
Author

yes, I tried brew install pango librsvg && brew reinstall graphviz

@steschuser
Copy link

maybe you could try to let diagrams create a DOT file as per #182.
Then run graphviz against that and check with graphviz people.
It doesnt look like a diagrams error to me

@singha200
Copy link

Check if Graphviz is installed and is added to ENV variables.
Got the same problem and was resolved by re-installing the Graphviz and adding it to env variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants