Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

EOPDF htmltopdf throwing exception Options
KumoJosh
Posted: Wednesday, February 6, 2019 5:21:58 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
PDF conversion call is throwing below exception when idle for a while (more than a day) and running again after app service restart.

Below code snippet placed in Web API controller and its hosted on Azure app service running on 32 bit.

Code: C#
try
                                {
                                    HtmlToPdfOptions op = new HtmlToPdfOptions();
                                    op.HeaderHtmlFormat = headerDecodeString;
                                    op.FooterHtmlFormat = footerDecodeString;
                                    HtmlToPdf.Options.NoCache = false;
                                    op.StartPageIndex = 1;
                                    op.RepeatTableHeaderAndFooter = true;
                                    if (orientation.Equals("portrait"))
                                    {
                                        op.PageSize = new SizeF(PdfPageSizes.Letter.Width, PdfPageSizes.Letter.Height);
                                        op.OutputArea = new RectangleF(0.4f, 0.7f, 7.7f, 9.5f);
                                    }
                                    else
                                    {
                                        op.PageSize = new SizeF(PdfPageSizes.Letter.Height, PdfPageSizes.Letter.Width);
                                        op.OutputArea = new RectangleF(0.4f, 0.8f, 10.2f, 7f);
                                    }
                                    MemoryStream pdfStream = new MemoryStream();
                                    {
                                        HtmlToPdf.ConvertHtml(contentDecodeString, pdfStream, op);
                                        
                                        byte[] pdfFileBytes = pdfStream.ToArray();
                                        MemoryStream outPutStream = new MemoryStream(pdfFileBytes);
                                        response.Content = new PushStreamContent((responseStream, httpContent, tc) =>
                                        {
                                            outPutStream.CopyTo(responseStream);
                                            responseStream.Close();
                                        }, "application/octet-stream");
                                        HttpStatusCode successStatus = HttpStatusCode.Created;
                                        response.StatusCode = successStatus;
                                        response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
                                        response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
                                        response.Content.Headers.ContentDisposition.FileName = "sample.pdf";
                                        response.Content.Headers.ContentLength = new MemoryStream(pdfFileBytes).Length;
                                        HtmlToPdf.ClearResult();
                                        return response;
                                    }
                                }
                                catch (Exception ex)
                                {
                                    throw ex;
                                }




Code: C#
Message	: Child process not ready.	

Call Stack :

EO.Internal.jq+e:
   at AP_PDF.Controllers.PDFController.HtmlToPDF (AP!PDF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullAP!PDF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: D:\EO PDF Project Git\pdfgeneration-development\AP!PDF\Controllers\PDFController.csAP!PDF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 130)
   at lambda_method (Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor+ActionExecutor+<>c__DisplayClass6_2.b__2 (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor+ActionExecutor.Execute (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Web.Http.Controllers.ApiControllerActionInvoker+d__1.MoveNext (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Web.Http.Controllers.ActionFilterResult+d__5.MoveNext (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher+d__15.MoveNext (System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
eo_support
Posted: Wednesday, February 6, 2019 1:56:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
Have you tried to set EO.Base.Runtime.EnableEOWP to true? See here for more details:

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

Thanks
KumoJosh
Posted: Thursday, February 7, 2019 7:52:29 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Team,

Set EO.Base.Runtime.EnableEOWP = true in application_start but still seeing the same issue after idle for few hours.

eo_support
Posted: Thursday, February 7, 2019 8:36:46 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
Hi,

What version do you use?

Thanks
KumoJosh
Posted: Friday, February 8, 2019 7:15:23 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Version - 18.3.46.0
eo_support
Posted: Friday, February 8, 2019 3:41:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
We are not sure what else to tell you. Last time you had problem with Azure App Service we were not able to reproduce it in our environment and I assume some how you have resolved the issue yourself. If somehow you can give us access to your system (ideally a separate test system since we may need to replace files/restart during our troubleshoot process), we would be very happy to investigate further there.
KumoJosh
Posted: Tuesday, February 12, 2019 5:38:23 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Team,

Sent you the details on your support mail box, please let me know if needed any more details.
KumoJosh
Posted: Thursday, February 14, 2019 2:00:25 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Team,

Please let us know whether you have received the details shared on support mail box and did you get chance to replicate the issue.
eo_support
Posted: Thursday, February 14, 2019 11:15:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
Hi,

We did receive it and we have been working on it. Please keep the system available. We will let you know as soon as we find anything or need anything else.

Thanks!
KumoJosh
Posted: Monday, February 18, 2019 11:50:06 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Team,

Are you able to replicate the issue and any resolution for this.
eo_support
Posted: Monday, February 18, 2019 2:11:30 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
Hi,

We are able to replicate it with the old build. Right now we are testing this issue with the new 2019 build (we have already updated your server with the new build) and it does not seem to happen any more. However we still noticed a few things that are not normal through our internal debug tools. Since it takes a while to run a single test (as you know the original issue takes more than a day to reproduce), so the whole process has been taking a long time. Please bear with us and as soon as we have reached a definite conclusion we will reply here again.

Thanks!
KumoJosh
Posted: Thursday, February 21, 2019 10:12:01 AM
Rank: Member
Groups: Member

Joined: 12/14/2018
Posts: 21
Any further update on this.

We also tried using 2019 version dll but did not see any luck, it has thrown exception after idle for 12-15 hrs.

Please help us in resolving this asap.
eo_support
Posted: Thursday, February 21, 2019 10:41:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,999
Yes. We are able to reproducing the problem with 2019 build as well. We are adding debug features into our DLLs and trying to run it on your server. Most recently we added this feature:

https://www.essentialobjects.com/doc/eo.base.runtime.startdebugmonitor.aspx

Currently we have this running on your server. This allows us to see some insight but the debug information we retrieved still puzzles us. We are adding more debug information, copy it over to your server and then wait for a day to get something back. Because every time we change something we have to wait for a day for it to happen, the whole process has been taking long. Do you know if there is any settings on app service that can reduce this wait time? If we can manually trigger what happens after 12 to 15 hours it would be of great help.


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.