daisy / ace

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

Fails with Unexpected error: Chromium revision is not downloaded #325

Closed egli closed 3 years ago

egli commented 4 years ago

Please provide the following details if possible or relevant:

Here are the steps to reproduce. Chromium is installed but as this is Ubuntu 20.4 it is probably installed in a snap, i.e. sandboxed.

eglic@wharton:~$ sudo npm uninstall -g chromium
removed 46 packages in 0.197s
eglic@wharton:~$ sudo npm uninstall -g @daisy/ace
removed 229 packages in 0.79s
eglic@wharton:~$ ace --verbose Downloads/Augenyoga.epub 
bash: /usr/local/bin/ace: No such file or directory
eglic@wharton:~$ sudo npm install -g chromium

> chromium@2.1.2 postinstall /usr/local/lib/node_modules/chromium
> node install.js

eglic@wharton:~$ sudo npm install -g @daisy/ace
/usr/local/bin/ace -> /usr/local/lib/node_modules/@daisy/ace/bin/ace.js
/usr/local/bin/ace-http -> /usr/local/lib/node_modules/@daisy/ace/bin/ace-http.js

> puppeteer@1.20.0 install /usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer
> node install.js

eglic@wharton:~$ ace --verbose Downloads/Augenyoga.epub 
verbose: Ace 1.1.1, Node v10.19.0, Linux 5.4.0-39-generic
verbose: Options: cwd=/home/eglic, outdir=undefined, tmpdir=undefined, verbose=true, silent=false, jobId=, lang=undefined
info:    Processing Downloads/Augenyoga.epub
verbose: Extracting EPUB
info:    Parsing EPUB
verbose: at location '/tmp/tmp-556557YfLvip6oJ148'
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: No issues found
error:   Unexpected error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
debug:   Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
    at Launcher.launch (/usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer/lib/Launcher.js:119:15)
info:    Closing logs.
Re-run Ace using the --verbose option to enable full debug logging.
eglic@wharton:~$ ace -v
1.1.1
eglic@wharton:~$ node -v
v10.19.0
danielweck commented 4 years ago

Hello, could you please try with a more recent version of Ace, currently under the NPM tag next: https://www.npmjs.com/package/@daisy/ace/v/1.2.0-beta.12

sudo npm -g install @daisy/ace@next should work for a global installation, or alternatively for a temporary test you may use the npx command: npx @daisy/ace@next /PATH/TO/BOOK.epub

egli commented 4 years ago

Hi @danielweck thanks for your answer

eglic@wharton:~/Downloads$ sudo npm uninstall -g chromium
removed 46 packages in 0.192s
eglic@wharton:~/Downloads$ sudo npm uninstall -g @daisy/ace
removed 306 packages in 0.941s
eglic@wharton:~/Downloads$ sudo npm install -g chromium

> chromium@2.1.2 postinstall /usr/local/lib/node_modules/chromium
> node install.js

eglic@wharton:~/Downloads$ sudo npm install -g @daisy/ace@next
/usr/local/bin/ace -> /usr/local/lib/node_modules/@daisy/ace/bin/ace.js
/usr/local/bin/ace-http -> /usr/local/lib/node_modules/@daisy/ace/bin/ace-http.js

> puppeteer@3.3.0 install /usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer
> node install.js

eglic@wharton:~/Downloads$ ace -v
1.2.0-beta.12
eglic@wharton:~/Downloads$ ace Augenyoga.epub 
info:    Processing Augenyoga.epub
info:    Parsing EPUB
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: No issues found
error:   Ace processing error: Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
error:   Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
info:    Closing logs.
Re-run Ace using the --verbose option to enable full debug logging.
eglic@wharton:~/Downloads$ 
danielweck commented 4 years ago

It would we great if you could try with the LTS version of Node (v12.18.2), rather than v10.x, just to help troubleshoot this installer issue. Would you mind?

danielweck commented 4 years ago

When launching Ace from the command line, try the environment variable DEBUG=puppeteer:* ace path/to/epub. This should give us more information.

danielweck commented 4 years ago

What is your npm version? (installing the current Node LTS v12 should ensure NPM is up to date too)

I would also recommend sudo npm cache clear to make sure no stale modules are cached.

egli commented 4 years ago
eglic@wharton:~/Downloads$ DEBUG=puppeteer:* ace --verbose Augenyoga.epub 
verbose: Ace 1.2.0-beta.12, Node v10.19.0, Linux 5.4.0-39-generic
verbose: Options:
info:    Processing Augenyoga.epub
verbose: Extracting EPUB
info:    Parsing EPUB
verbose: at location '/tmp/tmp-558588-Mnoe4c5S2Tji'
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: No issues found
  puppeteer:fetcher { revision: '756035',
  puppeteer:fetcher   executablePath:
  puppeteer:fetcher    '/usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome',
  puppeteer:fetcher   folderPath:
  puppeteer:fetcher    '/usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer/.local-chromium/linux-756035',
  puppeteer:fetcher   local: false,
  puppeteer:fetcher   url:
  puppeteer:fetcher    'https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/756035/chrome-linux.zip',
  puppeteer:fetcher   product: 'chrome' } +0ms
error:   Ace processing error: Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
error:   Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.
info:    Closing logs.
Re-run Ace using the --verbose option to enable full debug logging.
egli commented 4 years ago

I just installed npm via apt

$ npm -v
6.14.4
danielweck commented 4 years ago

sudo apt-get update && sudo app-get upgrade should fetch the latest Node LTS v12 too, assuming it is currently installed as a package. I can see from the Puppeteer log (thank you!) that the Chromium binary bundled with Ace is referenced correctly, but does the executable file exists, and what are its permissions, please? (ls -als /usr/local/lib/node_modules/@daisy/ace/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/ etc. :)

egli commented 4 years ago

To get a more modern node it seems that I would have to install debs from nodesource. Might try that or maybe I'll try to cook up a dockerfile with all the right dependencies.

danielweck commented 4 years ago

Yes, that's what I use in my Linux VM.

curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
danielweck commented 4 years ago

Ah, following this issue https://github.com/daisy/ace/issues/326#issuecomment-658875936 it looks like @clapierre is affected by the same Puppeteer / Chromium download problem. And it seems to be specific to Linux.

danielweck commented 3 years ago

I had issues on MacOS because of Chromium (Puppeteer) download, which I solved using --unsafe-perm on the NPM installation command line:

josteinaj commented 3 years ago

This fails for me as well. I've tried installing in a few different ways with no luck.

➜  sudo npm install -g @daisy/ace@next --unsafe-perm=true --allow-root                   
/usr/local/bin/ace -> /usr/local/lib/node_modules/@daisy/ace/bin/ace.js
/usr/local/bin/ace-http -> /usr/local/lib/node_modules/@daisy/ace/bin/ace-http.js
+ @daisy/ace@1.2.0-beta.12
updated 1 package in 6.352s
➜  ace git:(master) ✗ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
➜  ace git:(master) ✗ ace ~/nlb/nordic-epub3-dtbook-migrator/src/test/resources/2015-1/C00000.epub --verbose
verbose: Ace 1.1.1, Node v14.15.4, Linux 5.4.0-62-generic
verbose: Options: cwd=/tmp/ace, outdir=undefined, tmpdir=undefined, verbose=true, silent=false, jobId=, lang=undefined
info:    Processing /home/jostein/nlb/nordic-epub3-dtbook-migrator/src/test/resources/2015-1/C00000.epub
verbose: Extracting EPUB
info:    Parsing EPUB
verbose: at location '/tmp/tmp-38520cqeoDzMKEpoe'
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: 4 issues found
error:   Unexpected error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
debug:   Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"
    at Launcher.launch (/usr/lib/node_modules/@daisy/ace/node_modules/puppeteer/lib/Launcher.js:119:15)
    at async Object.launch (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-axe-runner-puppeteer/lib/index.js:16:20)
    at async Object.module.exports.check (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-core/lib/checker/checker-chromium.js:115:3)
info:    Closing logs.
Re-run Ace using the --verbose option to enable full debug logging.

I have it installed on one of our older servers. I don't remember how I installed it, but I probably just followed the installation instructions:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.7 LTS
Release:    16.04
Codename:   xenial
$ nodejs --version
v8.17.0
$ ace --version
1.0.2
$ ace 625021.epub
info:    Processing 625021.epub
info:    Parsing EPUB
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: 5 issues found
info:    Checking documents...
info:    - 625021.xhtml: 237 issues found
info:    Consolidating results...
(…)
danielweck commented 3 years ago

Despite installing Ace 1.2, your shell console log shows that you are still running Ace 1.1.1 (path problem?)

josteinaj commented 3 years ago

Oh, yeah seems like it. Tried again today and now it works:

➜  ~ ace ~/nlb/nordic-epub3-dtbook-migrator/src/test/resources/2015-1/C00000.epub --verbose
verbose: Ace 1.2.0-beta.12, Node v14.15.4, Linux 5.4.0-62-generic
verbose: Options:
info:    Processing /home/jostein/nlb/nordic-epub3-dtbook-migrator/src/test/resources/2015-1/C00000.epub
verbose: Extracting EPUB
info:    Parsing EPUB
verbose: at location '/tmp/tmp-109180-MdHAyzlO3bHv'
info:    Analyzing accessibility metadata
info:    Checking package...
info:    - EPUB/package.opf: 5 issues found
info:    Checking documents...
(…)

Maybe I just had to start a new terminal session.

Thanks :+1:

danielweck commented 3 years ago

I imagine that you are more than capable enough to setup an Ace batch command line to analyse/evaluate multiple EPUB publications, but just so you know, I created a cross-platform NodeJS script as a starter for this: https://github.com/daisy/ace/wiki/Ace-CLI-batch-processing-(folder-of-EPUB-files)