Welcome Guest Search | Active Topics | Sign In | Register

Regular child process errors using EO-PDF 22.2.49 in AppServices Options
Phil
Posted: Thursday, September 29, 2022 4:39:08 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
Hello - we are calling EO-PDF 22.2.49 from .NET Core 3.1 under AppServices and are regularly receiving child process errors on reports that are 5-10 (or less) pages. Note that I have just upgraded from EO-PDF 22.1.94 and that 22.1.94 successfully generated these reports (i.e. those that are now failing using 22.2.49). The exception is as follows

Child process not ready.
at System.Environment.get_StackTrace()
at EO.Base.BaseException..ctor(String lsq, Exception lsr)
at EO.Internal.xzzw.dcxk..ctor(dcxj nna, String nnb)
at EO.Internal.xzzw.dcxk..ctor(dcxj nnc)
at EO.Internal.xzzw.gxpl(xzvv nml)
at EO.Internal.xzzw.gxoz(Boolean& nlj, Type[] nlk, String nll, String nlm)
at EO.Internal.xzzw.ikoz(Type[] nlg, String nlh, String nli)
at EO.Internal.xzzx.ikoz(String nrb, String nrc)
at EO.Internal.vpid.cmvw()
at EO.Internal.vpid.fmfq.efwc()
at EO.Internal.xzvl.umrw(Action lue)
at EO.Internal.vpid.ffoo(WindowsIdentity fw)
at EO.WebEngine.Engine.Start(WindowsIdentity user)
at EO.WebEngine.Engine.Start()
at EO.Internal.tbqq.exji()
at EO.Internal.tbqr.exji(tbqq& bqy)
at EO.Internal.tbqs.exji(vphy brc, tbqq& brd)
at EO.Internal.tbqv.pqhs()
at EO.Internal.tbqv..ctor(vphy brh, HtmlToPdfOptions bri)
at EO.Pdf.HtmlToPdfSession.omeo(HtmlToPdfOptions yw)
at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions yt, HtmlToPdfSession yu, ResourceHandler yv)
at EO.Pdf.HtmlToPdfSession.Create(HtmlToPdfOptions options, ResourceHandler resourceHandler)
at EO.Pdf.HtmlToPdf.sovp.nued()
at EO.Internal.tbqs.kphi[a](Func`1 brg)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream)
at MI.ParentReporting.Web.PdfGenerate.NetCore.Controllers.PdfGenerateController.GeneratePdf(UploadData uploadData, Int32& pageCount, HtmlToPdfResult& coversheetHtmlToPdfResult, Byte[]& coversheetPdf, Boolean generateFromCoversheetHtml) in e:\DevOpsBuilds\7\s\MI.ParentReporting.Web.PdfGenerate.NetCore\Controllers\PdfGenerateController.cs:line 752
at MI.ParentReporting.Web.PdfGenerate.NetCore.Controllers.PdfGenerateController.Post(UploadData uploadData) in e:\DevOpsBuilds\7\s\MI.ParentReporting.Web.PdfGenerate.NetCore\Controllers\PdfGenerateController.cs:line 117
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at MI.ParentReporting.Web.PdfGenerate.NetCore.Controllers.PdfGenerateController.Post(UploadData uploadData)
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointFactory.<>c__DisplayClass7_0.<CreateRequestDelegate>b__0(HttpContext context)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Hosting.HostingApplication.ProcessRequestAsync(Context context)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest()
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()


Our settings are as follows:-
EnableEOWP=true
MaxConcurrentTaskCount=16

Note that we enable crash data, internal logs, runtime exceptions to be collected when available, however these were not produced (whereas they have been produced in the past using previous versions)

Also note that I have waited ample time for the application to start-up (> 5 minutes) and have tried (several times) restarting the AppService slot as well as redeploying the application

I have created an Azure memory dump and sent the link to your private email address

Can you help ?
eo_support
Posted: Thursday, September 29, 2022 3:22:22 PM
Rank: Administration
Groups: Administration

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

We have looked into the dump file and we can see that a number of threads are waiting for one engine instance to start, which is waiting for the child process to be ready. But we can not identify why the child process is not ready. Can you call the following method when you run into this error?

https://www.essentialobjects.com/doc/eo.base.runtime.getlogs.html

You can change your code to something like this:

Code: C#
try
{
    HtmlToPdf.ConvertHtml(...);
}
catch
{
    string log = EO.Base.Runtime.GetLogs();
    //Send log to us

    throw;
}


We will investigate further as soon as we receive the additional log data.

Thanks!
Phil
Posted: Friday, September 30, 2022 6:59:45 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
Hi - as I mentioned in the original post, we enable all of the recommended EO-PDF logging (i.e. crash data, internal logs [via the process "EO.Base.Runtime.GetLogs()" you mention], runtime exceptions) however none of these actually get generated in this scenario - it may have something to do with the version (with the 22.1.94 these logs do get generated, at the appropriate time, when the process fails) - our call looks like the following

Code: C#
HtmlToPdfResult htmlToPdfResult = null;
using (var debugConsoleLog = new StringWriter())
{
        HtmlToPdf.DebugConsole = debugConsoleLog;
        using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
        {
            try
            {
                htmlToPdfResult = HtmlToPdf.ConvertHtml(uploadData.InputHtml, stream);
            }
            catch
            {
                _logger.LogInformation($"Log internal log to folder {uploadData.EoPdfInternalLogFolderName}");
                string log = EO.Base.Runtime.GetLogs();
                var logBytes = Encoding.ASCII.GetBytes(log);
                WriteToTimestampedFile(uploadData.EoPdfInternalLogFolderName, "InternalLog", logBytes);
                throw;
            }
            bytes = stream.ToArray();
        }
        debugConsoleLog.Flush();
        _logger.LogInformation(debugConsoleLog.ToString());
}

private void WriteToTimestampedFile(string folderName, string baseFileName, byte[] bytes)
{
        string fullPathAndFileName = CreateFolder(folderName, baseFileName);
        System.IO.File.WriteAllBytes(fullPathAndFileName, bytes);
}


Although the issue occurs frequently, sometimes the PDF does generate successfully - I have generated another memory dump that contains some failures as well as one that was successfully generated - this has been uploaded to the same folder as the initial memory dump (date stamped 20220930) so you can access it with the same link - does this help ?
eo_support
Posted: Friday, September 30, 2022 11:03:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Your code looks fine. It is impossible that you get an exception but the catch block is not hit. So if no log files are written, something must have gone wrong inside the catch block. In that case you must try to troubleshoot that part to get it working first.

The dump file is a static snapshot, so it tells us where it is and it does not tell us how it got there. The log data is what might provide more information on that part. That's why it's crucial for us to get the EO.Base.Runtime.GetLogs(). We may need to change our code to add additional logs to that log as well as part of our troubleshooting process. But it is not possible for us to add any additional information to the dump file.
Phil
Posted: Tuesday, October 25, 2022 1:12:52 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
Hello, I've captured the internal log via EO.Base.Runtime.GetLogs() (as well as saving the corresponding Azure memory dump) when the application fails and have sent a link to these to your support email address.

Note that this forum thread initially targeted EO-PDF version 22.2.49. I have since tested against the newest version (22.2.79, which the internal logs and memory dump was obtained against) - hence the issues I was seeing in 22.2.49 are still evident in 22.2.79 (it's difficult to say whether the issue Internal Log file is generated from relates to "Child process not ready." or "Child process exited unexpectedly." as both are still occurring). As mentioned in the original post, just to confirm I do *not* see these issues in 22.1.94
eo_support
Posted: Monday, October 31, 2022 2:19:39 PM
Rank: Administration
Groups: Administration

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

We have sent a test build to you through private message. Please try that build and send the additional log data to us.

Thanks!
Phil
Posted: Thursday, November 3, 2022 4:45:16 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
Hi, I've used the new build to capture the additional logging which has been uploaded - I've replied to your email with the link
Kind regards
Phil
eo_support
Posted: Friday, November 4, 2022 10:23:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Thanks for the additional information. We did find something from the dump and we are working on it. We should have another test build available for you soon.
eo_support
Posted: Saturday, November 5, 2022 3:35:17 PM
Rank: Administration
Groups: Administration

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

We have sent a new build to you. Please take a look and let us know how it goes.

Thanks!
Phil
Posted: Friday, November 11, 2022 6:11:42 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
Hi, I've done some testing using the new build (22.2.93) - I've replied to your email with a link to some logs
Kind regards
Phil
Phil
Posted: Wednesday, February 15, 2023 5:22:30 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
After further testing regarding this issue, I have sent a reply to this to your personal email address - are you able to take a look
Phil
Posted: Monday, April 3, 2023 4:55:28 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2017
Posts: 66
This issue now seems to be resolved
Thank you
eo_support
Posted: Monday, April 3, 2023 1:52:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Thanks for confirming!


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.