Welcome Guest Search | Active Topics | Sign In | Register

Conversion failed. Browser engine failed to render page. Failed on command 1 Options
ckmba
Posted: Monday, April 29, 2019 10:16:01 AM
Rank: Member
Groups: Member

Joined: 4/25/2013
Posts: 17
We upgraded our EO.PDF (and EO.Web) library to the newest version over the weekend and now we're getting errors. We didn't have these issues with our previous version and we haven't changed our code. Interestingly, it seems the problem is somewhat intermittent. Here is what we're seeing:

EO.Pdf.HtmlToPdfException: Conversion failed. Browser engine failed to render page. Failed on command 1 ---> System.Exception: Browser engine failed to render page. Failed on command 1
at EO.Internal.pb.a(String A_0)
at EO.Internal.pb.a(b A_0, a8d A_1, WriteArgDelegate A_2)
at EO.Internal.pb.a(HtmlToPdfOptions A_0, Single A_1, Single A_2, ame A_3, List`1 A_4, agb A_5)
at EO.Internal.a3l.a(agb A_0, Single& A_1)
at EO.Internal.a3l.a(agb A_0)
--- End of inner exception stack trace ---
at EO.Pdf.HtmlToPdfException.b(Exception A_0)
at EO.Internal.a3l.a(agb 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, Stream stream, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream)
at [our_function] in [our_page]

Seems to be coming from the EO.Pdf.HtmlToPdf.ConvertUrl call
eo_support
Posted: Monday, April 29, 2019 1:57:45 PM
Rank: Administration
Groups: Administration

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

We do not know what causes this error. You can try to switch to EO worker process and see if it resolves the issue for you:

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

If the problem continues, please enable crash log if possible:

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

Once we get the crash log, we will see if what we can find.

Thanks!
ckmba
Posted: Monday, April 29, 2019 2:12:40 PM
Rank: Member
Groups: Member

Joined: 4/25/2013
Posts: 17
I'll see what I can do about this. In the meantime I put back all the old EO dlls and the global.asax.cs file. However, we have one specific page which is breaking saying "Could not load file or assembly 'EO.Pdf, Version=19.1.11.0, Culture=neutral, PublicKeyToken=e92353a6bf73fffc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference". Oddly enough other pages seem to be working fine with no problem.

Is the new dll being cached somewhere? I'm not sure how it would know to reference it when I rolled back all file changes. FYI: Because of how much legacy code we have when we manipulate the website we open it in Visual Studio as a 'web site' not a 'project/solution' so I'm never able mess with the references through VS.
eo_support
Posted: Monday, April 29, 2019 2:26:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
No. We do not cache DLL anywhere. You may want to rebuild your application to make sure all DLLs on your end are properly updated.
ckmba
Posted: Wednesday, May 1, 2019 10:42:47 AM
Rank: Member
Groups: Member

Joined: 4/25/2013
Posts: 17
Ok, so we put back the 2019 EO bin files (including eowp.exe), enabled EOWP, and added code to try to log crash data. We compiled the website and rebooted the server. Here are the modifications we made to our Global.asax.cs file:

Code: C#
//Turn Off Client-Side Debugging
            EO.Web.Runtime.DebugLevel = 0;

            //Enable EnableEOWP 
            EO.Base.Runtime.EnableEOWP = true;

            //Disable the automatic report
            EO.Base.Runtime.EnableCrashReport = false;

            //Handle CrashDataAvailable event
            EO.Base.Runtime.CrashDataAvailable += Runtime_CrashDataAvailable;

        void Runtime_CrashDataAvailable(object sender, EO.Base.CrashDataEventArgs e)
        {
            //Log the Crash Data to our internal Error Log
           Error_Log.Write(e.Data.ToString(), "EO Crash Log");
        }


Does this look like the changes we need to make?

Also, we wrapped the EO calls in a try/catch

Code: C#
try
        {
            //Get the pdf result
            EO.Pdf.HtmlToPdfResult result = EO.Pdf.HtmlToPdf.ConvertUrl(Itinerary_URL, doc);
        }
        catch (Exception ex) //<--Problem Detected
        {
            //Write to error log
            Error_Log.Write($"There was a problem converting the PDF URL to document. Exception:{ex}", "lnkbtn_PDF_Itinerary_Click");
        }



However, the PDF is still giving us errors intermittently:

Exception:EO.Pdf.HtmlToPdfException: Conversion failed. Browser engine failed to render page. Failed on command 1 ---> System.Exception: Browser engine failed to render page. Failed on command 1
at EO.Internal.pb.a(String A_0)
at EO.Internal.pb.a(b A_0, a8d A_1, WriteArgDelegate A_2)
at EO.Internal.pb.a(HtmlToPdfOptions A_0, Single A_1, Single A_2, ame A_3, List`1 A_4, agb A_5)
at EO.Internal.a3l.a(agb A_0, Single& A_1)
at EO.Internal.a3l.a(agb A_0)
--- End of inner exception stack trace ---
at EO.Pdf.HtmlToPdfException.b(Exception A_0)
at EO.Internal.a3l.a(agb 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, Stream stream, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream)


It's not writing the more detailed EO information to our error log...is that because we have the offending call in a try/catch?
ckmba
Posted: Wednesday, May 1, 2019 11:23:52 AM
Rank: Member
Groups: Member

Joined: 4/25/2013
Posts: 17
Actually in looking at our error log I think the EO crash logging isn't working. The reason I think this is that there is an error that is occurring outside of a try/catch and it's not logging the crash details. Am I missing something?
eo_support
Posted: Wednesday, May 1, 2019 3:37:31 PM
Rank: Administration
Groups: Administration

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

Try/catch should not affect crash log. However your CrashDataAvailable event handling code is wrong. Inside the event you should write e.Data into a binary file directly. DO NOT call ToString on it. It should be something like this: File.WriteAllBytes(e.Data, your_crash_log_file). You can then email us the crash log file. The key is the crash log file is a binary file, it's not a text file. So you must save it as is.

We do not know what caused this problem, we are suspecting it is a crash in the browser engine, but if you do not see CrashDataAvailable event being triggered, then it can be something else. Is there any way you can have a test system available for us to investigate further? We are not able to reproduce the problem here.

Thanks!
ckmba
Posted: Wednesday, May 1, 2019 3:57:15 PM
Rank: Member
Groups: Member

Joined: 4/25/2013
Posts: 17
I put some trace logging in the CrashDataAvailable event above the error logging line to confirm that the event isn't being triggered. It seems like the cases where it is failing is when we're trying to build multiple pages (like in the example I sent you where there are 2 certficates...one on each page) or where we're writing from a memory stream. If we're just taking a page and exporting it with a "EO_PDF.RenderAsPDF(File_Name)" call appears to always work fine.


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.