daisy / ace

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

Unexpected error: Failed to launch chrome #340

Closed 1manfactory closed 3 years ago

1manfactory commented 3 years ago

ace test.epub

Unexpected error: Failed to launch chrome! /home/juergen/.npm-global/lib/node_modules/@daisy/ace/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

ace - 1.1.1 Node - v12.20.2 npm - 6.14.11 Debian Linux 9 - Linux 4.9.0-14-amd64 on x86_64

I have no idea what to do now. And why do I need to install chrome on a server? I am not going to install any desktop environment there.

Please help or pus me into the right direction. I am gladly willing to help and answer every quetion. But my knowledge is limited here.

danielweck commented 3 years ago

Hello,

Would you mind trying the latest 1.2 "beta" version of Ace (actually considered stable at this stage, it will soon replace version 1.1.1): npm install -g @daisy/ace@next (to install the Ace executable globally), or npx @daisy/ace@next /PATH/TO/BOOK.EPUB (to run it temporarily without installing it).

Note that you might need to use sudo and --unsafe-perm=true on your npm install command.

Just in case you are not aware, Ace App (aka Ace "GUI") is based on the latest 1.2 "beta" version of Ace: https://github.com/daisy/ace-gui/releases/tag/v1.1.2

danielweck commented 3 years ago

With Ace 1.2, you are able to choose an alternative "runner" to the default Puppeteer one (i.e. Electron). See: https://github.com/daisy/ace/wiki/Ace-command-line-with-Electron-(in-addition-to-Puppeteer) You probably will not need to switch to the Electron runner, but if Puppeteer fails, please try.

Another tip, here's a handy NodeJS script to batch-process EPUB files with Ace on the command lint: https://github.com/daisy/ace/wiki/Ace-CLI-batch-processing-(folder-of-EPUB-files)

1manfactory commented 3 years ago

info: Processing 707 test.epub info: Parsing EPUB info: Analyzing accessibility metadata info: Checking package... info: - content.opf: 4 issues found error: Unexpected error: Failed to launch chrome! /home/juergen/.npm-global/lib/node_modules/@daisy/ace/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

So, it looks like ACE already found some issues (which I expected).

Honestly, this is way too complicated for me. NodeJS, Composer and the like are supposed to make installation easy (which most of the time they don't). Of course I could run all the above hints. (Thanks for them). But will it leave remains in the system, which collide with other stuff or clutter up everything?

I am forced to use ACE as a way to check accessibility for my production engine which used to run smooth for years (until now).

I tried the following:

npx @daisy/ace@next test.epub

Downloading Chromium r848005 - 138.2 Mb [====================] 100% 0.0s info: Processing 707 test.epub info: Parsing EPUB info: Analyzing accessibility metadata info: Checking package... info: - content.opf: 2 issues found info: Checking documents... info: - cover.xhtml: No issues found info: - title_page.xhtml: No issues found info: - imprint_page.xhtml: No issues found info: - nav.xhtml: No issues found info: - editorial.xhtml: No issues found info: - sec000001.xhtml: No issues found … info: Consolidating results... … info: Done. info: Closing logs.

Ok, this gives me proper results. But because it loads all the stuff on the fly it took minutes (including downloading of Chromimium). So this is not a really workable solution.

npm install -g @daisy/ace@next # install beta

ace --version

gives me

1.2.0-beta.13

now

ace test.epub

gives me the same results as above but again takes minutes to finish.

Does 1.2 still needs fine tuning?

Thanks for your affords in providing this to us.

danielweck commented 3 years ago

Hello, checking each individual XHTML document in a large EPUB publication can take time. Note that Ace delegates the actual accessibility checking to a library called Axe, which ships with a default set of validation rules (Ace adds a few of its own EPUB-specific rules, and tweaks a few others). I would be happy to test your EPUB at my end, to see if there is a solvable performance bottleneck (maybe some edge case we can work around). My email address is daniel.weck@gmail.com if you wish to privately share your EPUB with me.

danielweck commented 3 years ago

Do you get similar checking times with ‘ace test.epub‘ and ‘ace-electron test.epub‘ ?

danielweck commented 3 years ago

I am closing this issue as the bug described is not reproducible. Please do not hesitate to open new issues regarding performance, etc. Ace "next" is about to replace Ace 1.1.1, so that should help.