Rank: Newbie Groups: Member
Joined: 10/13/2014 Posts: 3
|
We are suddenly getting an exception when trying to convert html to pdf.
Error: Convertion failed. Process with an Id of 20276 is not running. (Id changes obviously between runs.)
I have tried both string to steam and string to pdf. HtmlToPdf.ConvertHtml();
Anyone know what this error means?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Please check your Windows event logs and see if you can find any additional information there.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 10/13/2014 Posts: 3
|
Not seeing anything in the event logs. Here is the stack trace from the page if I take out my error handling.
[ArgumentException: Process with an Id of 38492 is not running.] System.Diagnostics.Process.GetProcessById(Int32 processId, String machineName) +6543596 System.Diagnostics.Process.GetProcessById(Int32 processId) +12 EO.Pdf.Internal.cg.a(e4 A_0, String A_1, Boolean A_2) +1061 EO.Pdf.Internal.lt..ctor() +631 EO.Pdf.Internal.lt.a(lt A_0, List`1 A_1, Boolean A_2) +1216 EO.Pdf.Internal.lt.a(hi A_0, Boolean A_1) +412 EO.Pdf.Internal.lt.a(hi A_0) +859
[HtmlToPdfException: Convertion failed. Process with an Id of 38492 is not running.] EO.Pdf.Internal.lt.a(hi A_0) +769 EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0) +303 EO.Pdf.HtmlToPdfSession.Create(HtmlToPdfOptions options) +58 EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options) +85 EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options) +95 EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream) +50 Emdeon.Assistant.Web.Controllers.TranListController.GetPdf(Guid id) in d:\Projects\AssistantTFS\Assistant\Emdeon.Assistant\src\Emdeon.Assistant.Web\Controllers\TranListController.cs:95 lambda_method(Closure , ControllerBase , Object[] ) +184 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +59 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +60 System.Web.Mvc.Async.ActionInvocation.InvokeSynchronousActionMethod() +76 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +36 System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +73 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +136 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +117 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +323 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +323 System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +44 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +47 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +136 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +72 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185 System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +34 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44 System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +39 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +62 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +39 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9657896 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
This may have to do with permissions. Do you get this error every time or just randomly?
Thanks!
|
Rank: Newbie Groups: Member
Joined: 10/13/2014 Posts: 3
|
I've tried running VS as Administrator and I'm a local admin on all the computers. I get this error every time on multiple computers. What permissions do I need to set? Does the conversion write to a temp file somewhere? Also what process is it trying to find? I also get this error when I deploy the project using web deploy or manually to our dev environment.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
At runtime, EO.Pdf would try to start a new process and run the vast majority of the converter's code inside that process instead of inside your own process. This isolate the conversion engine from your application so that if it crashes, EO.Pdf will be able to detect it and your application won't crash (instead you will get an exception which you can handle). The error occurs when this worker process is started, but either for some reason it immediately crashed, or your application process is not able to open the process that it has just created. Both can be caused by permission problems.
The permission involved is the calling thread's permission. For example, if your application is a Web application, then the user context your code is running under usually is the IIS user, which can have a much lower privilege on purpose. If you have enabled IIS impersonation, then that can be the end user's permission (comes from the browser). This is a rather complicated Windows administration topic by itself. However if your application is a traditional Windows application running locally and you are running as an administrator, then you shouldn't run into such problems.
You can also try to test with the latest build and see if that resolves the problem for you. The latest build may have more debug information in the event viewer so even if it does not work for you, it might be able to give you more pointers.
Thanks!
|