daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
74 stars 22 forks source link

Missing X server or $DISPLAY #412

Closed CanOfBees closed 3 months ago

CanOfBees commented 3 months ago

Please provide the following details if possible or relevant:

$ node -v
v18.20.2
$ ace --version --verbose
[55499:0514/185751.032283:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY
[55499:0514/185751.032342:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
/usr/lib/node_modules/@daisy/ace/node_modules/electron/dist/electron exited with signal SIGABRT

I've tried to install the missing requirements (libgtk, libatk, etc) but this is on a headless server. Is there some workaround for this error, short of installing a full X.org server? I've seen suggestions re configuring a $DISPLAY environmental variable or modifying the puppeteer.launch syntax but haven't had any luck with those.

Thanks in advance for any suggestions!

danielweck commented 3 months ago

hello, ace is an alias for ace-electron, you can call ace-puppeteer instead to avoid the Electron "runner" which is shared between the Ace command line tool and the graphical user interface.

danielweck commented 3 months ago

you can also run the Ace Electron runner (instead of Puppeteer) successfully inside a Docker container via a virtual frame buffer as demonstrated here:

https://github.com/daisy/ace/blob/master/Dockerfile

https://github.com/daisy/ace/blob/master/docker.sh

Ace's current integration of Puppeteer doesn't run as fast as Electron, and it uses an older version of the Chromium web browser engine. We decided to make the Electron runner the default also because of consistency issues with Ace App (GUI) which must use Electron (cannot switch to Puppeteer).

I hope this helps.

CanOfBees commented 3 months ago

Hi @danielweck - thanks very much for the pointers; the first option looks like it's going to work quite well for us. I appreciate your time and advice!