30
Views
2
Comments
[Ultimate PDF] We intermittently failed to generate PDF - Execution context was destroyed
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes
Application Type
Reactive

We intermittently failed to generate PDF on production environment, and the message is " : "Execution context was destroyed, most likely because of navigation".

But this message shown even when the application is generating PDF and the users wait on that screen.

Can you point what is the cause for this error ?

2018-01-05 02-53-30
Grayson Udstrand

Toto's issue and the one I identified a fix for in the post you linked are almost certainly unrelated.

@Toto if you are using an up-to-date version of Ultimate PDF, you could certainly try the fix to upgrade puppeteer sharp and see if perhaps it helps, but to me it seems more like your PDF generation screens are being redirected when the component makes the call to render the screen. I'd perhaps start by checking the following:

  1. If the PDF is being generated from a user context (that is, a logged in user is clicking a button to generate the PDF) make sure that user has the correct roles to view the PDF generation screen. Session cookies are carried over into the puppeteer browser so the PDF generation happens within the context of that logged in user. If the user doesn't have the right roles to view the screen, you will get a security exception and likely a redirect. 
  2. If the PDF is being generated from a system action somewhere (like a timer) then make sure Anonymous users can access the PDF generation screens and use a token or something to make sure those screens are still inaccessible by those you want to keep out.

Hope this helps.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.