Welcome Guest Search | Active Topics | Sign In | Register

Random PDF Failures Options
Johnathan
Posted: Friday, August 25, 2017 5:07:50 AM
Rank: Member
Groups: Member

Joined: 1/10/2012
Posts: 15
Hi

Having followed your previous instructions we have upgraded to the very latest release. But we are still experiencing problems.
We have been using HtmlToPdf for about 5 years without any problems until the last 6 months.
Our application produces about 30 PDFs per day at various different times. The same PDFs are produced daily but contain different numbers in the text.

Every 2-3 days one or more of the PDF will fail. We get two different exceptions - all seem very random.
The exception will occur randomly and then the next time will work perfectly.

With the previous release we found a bug that you guys corrected when an <a> tag was added was added the footer, but I noticed that when this exception occurred the PDF build method spiralled into an infinite loop. I'm wondering if this occurs with other error occasional errrors, maybe file locks etcs and this results an 1000's of retries and then the message "All engines are busy". I doubt that there are ever more then two PDFs converted at the same time as we only built about 30 PDFs per day spread over 24hrs.

Any ideas??

Regards

Johnathan

EXCEPTIIONS
Can not create additional conversion task. All engines are busy.,
Stack Trace: at EO.Internal.alw.a(av A_0, sw& A_1) at EO.Internal.pa..ctor(av A_0, HtmlToPdfOptions A_1) at EO.Pdf.HtmlToPdfSession.a(HtmlToPdfOptions A_0) at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0, Boolean A_1) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) at

Conversion failed. Object reference not set to an instance of an object.,
Stack Trace: at EO.Pdf.HtmlToPdfException.b(Exception A_0) at EO.Internal.a24.a(af1 A_0) at EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) at
eo_support
Posted: Friday, August 25, 2017 7:56:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

The first error is caused by the fact that you have too many on going conversion tasks. The total number of on going conversion task is controlled by this property:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdf.maxconcurrenttaskcount.aspx

The default value is 25 in the current version. So for example, if you create 30 threads and start conversion in all 30 threads at once then 5 of them may get "all engines are busy" exception. However if you do not start them all at once, then by the time some task starts some other tasks have already finished, then you may not run into this error. Because it's triggered by number of concurrent task that varies from time to time, usually if you get this exception, it will work if you try again since at that time, some other tasks have already finished. This is the designed behavior --- it's similar to "system busy, please try again later".

If you see this error rather often but when it occurs your system still have plenty of resources (CPU & memory), then you can try to increase MaxConcurrentTaskCount and that should reduce the chance of running into this error. However if your system is indeed very busy when you receive this error, then your system is simply overloadded and raising MaxConcurrentTaskCount won't solve the problem for you --- it will just kick the can down the road and give you other problems. For example, conversion time out, out of memory, etc. Those can be even harder to troubleshoot, which is why there is the MaxConcurrentTaskCount safe guard at the first place.

The "Object reference not set to an instance of an object" appears to be a bug. So if you can reproduce it please send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will be happy to investigate further.

Thanks!
Johnathan
Posted: Monday, August 28, 2017 4:11:00 AM
Rank: Member
Groups: Member

Joined: 1/10/2012
Posts: 15
Hi

Thanks for the reply

when you say "if you create 30 threads and start conversion in all 30 threads"
do you mean kick of 30 PDF builds simultaneously in eo.pdf or 30 threads doing other activities across our application?
Our app has many threaded processed unconnected to the PDF build, we will be lucky if we build 30 PDF in any 24 hour period, so an overlap is possible but unlikely.

Our system have 8 cores and lots of memory. They run at about 3% utilisation most of the time, we watched the CPU levels on screens on our wall during the working day. - So I doubt we will ever be maxed out and not know about it.

we have added multiple retries to the PDF build so the PDF build retries 10 minutes later if it fails this mostly works around the problem.


For example, this morning we have had two PDF failures with the error message below.
Both then retried 10 minutes later and worked.

This all seems very random. The exact same PDFs occasionally randomly fail with what appears to be random exceptions. We have lots of CPU and memory capacity and we build 1 or 2 PDF per hour during the working day. So we are not doing many. We do build the PDF inside a thread and I wonder if this has something to do with it?


Conversion failed. Browser engine failed to render page. WebView is closed. Reason: Normal,
Stack Trace: at EO.Pdf.HtmlToPdfException.b(Exception A_0) at EO.Internal.a28.a(af3 A_0) at EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) at
eo_support
Posted: Monday, August 28, 2017 8:49:33 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

Yes. Your understanding about the concurrent task is correct.

This last error message is different than the previous one. This last one usually indicates a crash inside the browser engine. Obviously the best way to track down a crash is to reproduce it. However if you can not reproduce it, you can follow the steps here to allow us to collect crash report:

https://www.essentialobjects.com/doc/common/crash_report.aspx

Make sure you update to the latest build before you do so. We are only able to analyze the crash report of most recent builds. So if you use earlier builds, then the crash report would have no use. Also there might be issues that can indirectly cause/affects the issue you are having that have already been fixed in the latest build.

Thanks!
Johnathan
Posted: Wednesday, September 6, 2017 8:55:29 AM
Rank: Member
Groups: Member

Joined: 1/10/2012
Posts: 15
Hi

I've have implemented the crash handler yet after the crashes we could not find any crash files. After a few tweaks to our code we are 99% sure the crash event handler is never firing.

Here is an example of the code.
The second method builds the PDF file, the first is the crash event handler as defined in your help (BTW I think you have a syntax error on the VB code snippet when adding the handler)

https://www.screencast.com/t/DM9GaNco

Have we got something wrong?

Thanks

Johnathan
eo_support
Posted: Wednesday, September 6, 2017 1:38:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

Thank you very much for pointing out the documentation issue. We will fix that in our next build.

As to your code, they look fine to me. So I am not sure what else to tell you. If you somehow managed to reproduce the problem reliability, please send the repro app to us and we will be happy to investigate further. See here for details on sending test app to us:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.