Closed LukeCarrier closed 4 years ago
Hello, Any updates on this issue ? facing same issue :
+ xvfb-run -a mkdocs build
ERROR - Unable to find Draw.io executable; ensure it's on PATH or set drawio_executable option
INFO - Cleaning site directory
INFO - Building documentation to directory: /tmp/workspace/
INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration:
- index.md
WARNING - Skipping export of "/tmp/workspace/xxxxxxxxxxxxx/xxx-docs/workspace/xxxxxxxxxxxxx/xxx-docs/src/drawio/jvm_monitoring.drawio" as Draw.io executable not available
@Aminechakr the issue is fixed, you're not seeing a traceback. Is the Draw.io binary on your path?
$ which drawio
If not, have you installed the desktop app?
Hello @LukeCarrier, Thank you for your quick feedback, yes we using the drawio desktop app to develop our diagrams and architectures in local. But it seems im facing another issue, we using a markdown documentation, that is running under a docker container. and we wan't to display our drawio diagrams (.drawio) under mkdocs instead of images (.png),
I think i need to add my drawio_executable on my alpine image any references. Thanks.
Hey @Aminechakr, yup, you'll need to install Draw.io in your Dockerfile. It'll make for a fairly large container. I've started the work to do the exports without the Electron app in #16, so you may want to subscribe to that for updates.
Something like this should work:
Thanks @LukeCarrier was really helpful.
It's seems that i end up on an electron issue once i tried to export my Draw.io diagrams on MKdocs 😅 :
Error: Failed to get 'appData' path at App.l._setDefaultAppPaths (electron/js2c/browser_init.js:5:1420) at Object.<anonymous> (electron/js2c/browser_init.js:205:2348) at Object../lib/browser/init.ts (electron/js2c/browser_init.js:205:3577) at __webpack_require__ (electron/js2c/browser_init.js:1:128) at electron/js2c/browser_init.js:1:1200 at electron/js2c/browser_init.js:1:1267
Is this related to #16 ? is there any workarround ?
@Aminechakr can you try setting the XDG_CONFIG_HOME
environment variable in your Dockerfile? If you're not running as a specific user root
should do.
The relevant Electron docs: https://github.com/electron/electron/blob/master/docs/api/app.md#appgetpathname
@LukeCarrier Yes ! It's working when setting XDG_CONFIG_HOME on my dockerfile
ENV XDG_CONFIG_HOME=~/.config
And since i am running my MkDocs as a non-privileged user, i had to make some changes for the security context.
--no-sandbox
args to disable the Chrome sandbox. DEBUG - Exporting "/tmp/workspace/docs/workspace/src/drawio/my_diagrma.drawio" to "/tmp/workspace/docs/workspace/src/drawio-exporter/1e5c3fdc662620e797c25120515c25ffb865fd-0"
DEBUG - Using export command ['/usr/bin/drawio', '--export', '/tmp/workspace/docs/workspace/src/drawio/my_diagrma.drawio', '--page-index', '0', '--output', '/tmp/workspace/docs/workspace/src/drawio-exporter/1e5c3fdc662620e797c25120515c25ffb865fd-0', '--format', 'svg', '--no-sandbox']
/tmp/workspace/docs/workspace/src/drawio/my_diagrma.drawio -> /tmp/workspace/docs/workspace/src/drawio-exporter/1e5c3fdc662620e797c25120515c25ffb865fd-0
INFO - Documentation built in 1.92 seconds
Big thanks for the support.
👏 🎉
@Aminechakr awesome -- thanks for reporting back! 👍
This isn't a great look -- we need to handle the case that
drawio_executable
isNone
: