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

Random Error when running HTML checks: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded #339

Closed
siddoib opened this issue Feb 5, 2021 · 13 comments

Comments

@siddoib
Copy link

siddoib commented Feb 5, 2021

Running ACE command line using the following versions:

  • [Ace 1.1.1]
  • [Node v14.15.3]
  • [Windows_NT 10.0.17763] your operating system and version.

I keep getting - randomly - the following error message:

  • debug: Error when running HTML checks: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    info: Error HTML check: Error: Failed to check Content Document 'isbn-9780190632991-book-part-1-sec-7.xhtml'
    debug: Error when running HTML checks: Error: Navigation failed because browser has disconnected!
    debug: Error when running HTML checks: Error: Protocol error (Runtime.callFunctionOn): Target closed.
    debug: Error when running HTML checks: Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.

The time out keeps happening at different xhtml page each time. The only thing peculiar with our epubs is that they tend to include various external resources (iframes). Strangely as I mentioned the same epub can be processed some times and other times we get this time out.

I believe this is bug with ACE as it seems to be timing out for xhtml pages with external resources. Is there any possibility to increase the max time out?

@danielweck
Copy link
Member

Hello, I am surprised that Ace version 1.1.1 exhibits this kind of timeout error, as this problem was first discovered in the "beta" 1.2.x version of Ace used in the Ace App (GUI) project, due to different libraries running behind the scenes (i.e. both Chromium web browser engine, but via Electron instead of Puppeteer).

Anyway, could you please test your publication with Ace App?
https://github.com/daisy/ace-gui/releases/tag/v1.1.2

You may also install the latest "beta" Ace command line tool: npm install -g @daisy/ace@next (this installs the Ace executable globally), or npx @daisy/ace@next /PATH/TO/BOOK.EPUB (this runs Ace temporarily without installing it globally).

Thank you very much! Daniel

@siddoib
Copy link
Author

siddoib commented Feb 9, 2021

@danielweck , thank you so much for the reply. I am going to try that in the version 1.1.2 as recommended. I have also strumbled across a simillar ticket and ironically left a comment for you there not knowing that you've already commented here.

@siddoib
Copy link
Author

siddoib commented Feb 9, 2021

@danielweck , using the Ace App version 1.1.2, I am still getting the same timeout error. As already mentioned above, these errors seem to only happen to xhtml pages containing some iframe content.

ACE_timeout

@danielweck
Copy link
Member

Thank you, useful troubleshooting information.
Could you please privately share an EPUB at daniel.weck@gmail.com
Regards, Daniel

@siddoib
Copy link
Author

siddoib commented Feb 9, 2021

That's fantastic - thank you so much for the prompt reply. I will send you one file soon!

@danielweck
Copy link
Member

Hello, thank you very much for sharing your EPUB. I ran tests with Ace command line (both Puppeteer and Electron "runners"), and I did not experiencing any timeouts. The entire publication is analysed in approximately 4 minutes.

However on several occasions I experienced premature ending of the accessibility evaluation (using the Electron runner), because of an external resource failing to load (I guess this is the iframe URL you mentioned: https://aa.bbb.com/signin?referrer=/embed/access/content/xxx/yyy ). It would seem that this problem does not affect the Puppeteer runner, probably because of different conditions for accessing external web pages.

I will need to investigate this further.

@danielweck
Copy link
Member

danielweck commented Feb 9, 2021

I fixed this issue in the Electron "runner", which is used in Ace App but not in Ace command line (as this program uses Puppeteer by default). In my local tests I am of course able to compare the Electron and Puppeteer "runners" side by side, from the command line: the Electron "runner" is now much faster than the Puppeteer one when external webpages are involved, as the former now skips requests to external URLs, whereas the latter continues to fetch the external webpages.
Here is a sample benchmark output from https://github.com/daisy/ace/blob/ace-next/scripts/compareAxeRunners.sh (the Electron "runner" takes 1 minute to evaluate your EPUB, whereas the Puppeteer one takes 4 minutes)

./scripts/compareAxeRunners.sh /PATH/TO/9780197545454_EPUB.epub 
ElectronAxeRunner ...
>>> ACE PERF: 59 seconds + 998136614 nanoseconds
PuppeteerAxeRunner ...
>>> ACE PERF: 212 seconds + 689942854 nanoseconds

@danielweck
Copy link
Member

Fixed via c1cb9db
(Electron only, need to fix Puppeteer too)

@danielweck
Copy link
Member

Fixed via 64439a0
(Puppeteer now fixed too, in addition to Electron)

@danielweck
Copy link
Member

danielweck commented Feb 9, 2021

The runtime performance is now roughly equal:

./scripts/compareAxeRunners.sh /PATH/TO/9780197545454_EPUB.epub
ElectronAxeRunner ...
>>> ACE PERF: 60 seconds + 702028831 nanoseconds
PuppeteerAxeRunner ...
>>> ACE PERF: 71 seconds + 424940796 nanoseconds

@danielweck
Copy link
Member

Hello, I published 1.2.0-beta.13 of Ace command line, under the NPM tag next. You can install it from your shell with:
sudo npm --global install @daisy/ace@next --unsafe-perm=true
(you may need to remove sudo in Windows MSDOS / PowerShell, in which case if you get an error message, try to open the shell window with administrator privileges)

Alternatively, you may run Ace directly (without installing it) with:
npx @daisy/ace@next /PATH/TO/BOOK.EPUB

I strongly recommend installing the latest LTS version of NodeJS (14.15.5) which comes with NPM 6.14.11:
https://nodejs.org

Note that I created this wiki page for future reference (choice of Electron vs. Puppeteer "runners"):
https://github.com/daisy/ace/wiki/Ace-command-line-with-Electron-(in-addition-to-Puppeteer)

@danielweck
Copy link
Member

I am closing this issue now. Do not hesitate to post further comments if you still have issues.

Note that Ace 1.1.1 will not be updated with these bug fixes. Please consider Ace 1.2.0 the actively maintained branch of Ace (it will come out of beta soon)

@siddoib
Copy link
Author

siddoib commented Feb 10, 2021

Thank you so much @danielweck. I have already tried with npx @daisy/ace@next and the publication was processed successful. I will let you know if any question but I think I have all I need for now.
Best wishes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants