cognidox / OfficeToPDF

A command line tool to convert Microsoft Office documents to PDFs
https://www.cognidox.com/
Other
610 stars 137 forks source link

Conversion fail with "Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))" #5

Open rniedosmialek opened 6 years ago

rniedosmialek commented 6 years ago

I am running into a problem where conversions are failing with the output message of "Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))". I am using the last version released on a Windows 2012 system running Office 2016 Professional Plus.

I have searched around on this error and see that there it seems to refer to a timing issue.

The majority of our conversions are PPT/PPTX to PDF.

Any thoughts on what this could be and what I may need to address?

vittala commented 6 years ago

Hi - Are you repeatedly calling OfficeToPDF through a batch job?

If so, have you tried introducing a pause between each time you call OfficeToPDF?

Cheers Vittal

rniedosmialek commented 6 years ago

There is a one minute delay between calls as we have a process that monitors a pool of jobs every minute but will skip if a job is currently running. We have seen this error even running on just a manual cmd test but if we run it immediately after it fails it will convert. Re-running the conversion seems to resolve the issue but at times we have had to run some conversion jobs up to 4 times before a successful commit occurs.

vittala commented 6 years ago

Does the failure tend to happen with any particular class of PowerPoint file (e.g. very large, containing images or macros, etc.). I'd like to try and replicate the problem here, if possible.

Roughly how long does a typical conversion of one of your documents take? Is it sub-second, seconds or minutes?

Is the machine running the conversion running any other tasks, or is it just doing PDF conversion?

Regards Vittal

Pana commented 6 years ago

I have across this problem to, but mine job is convert doc to pdf. and not find any regular thing

kkman2008 commented 6 years ago

Here is a quick and dirty solution, add a thread.sleep after you create the word object.

Something like this:

var app = new Microsoft.Office.Interop.Word(); Thread.Sleep(2000);

Pana commented 6 years ago

sleep is ok for me

vittala commented 6 years ago

Can you see if https://github.com/cognidox/OfficeToPDF/releases/tag/v1.8.7.0 is also affected by this issue?

svanveldhuijzen commented 6 years ago

I've been testing with 1.8.7.0 a week now, but tonight the error occured again while converting word documents. This happend on Server 2008r2, office 2013 professional plus. I have tried adding a delay like kkman2016 suggggested, but this als did not work.

MontyZoomer commented 6 years ago

I have been using 1.8.0.0 and I get this error now most of the time. I tried 1.8.7.0 and its is the same. I have a VS VB windows service wrapper script that monitors a folder and runs OfficeToPDF as a single instance and this error is now appearing in my conversion log almost all the time.

Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)) Did not convert

Windows Server 2012R2 with Office R2016

MontyZoomer commented 6 years ago

Now working OK. Issue was caused by installing LibreOffice on the same server. LibreOffice reset file associations which caused a dialog box prompt in word. As word was running as a service account it was not obvious. Once logged in as service account and start word the prompt came up

"Word is not your default program for viewing and editing documents. Do you want to select the file types that word can open"

So once I'd run through the associations which I dont think is necessary because there is a checkbox "Do not show this message again" which I checked, OfficeToPDF started working correctly. Pretty obvious really with hindsight...

vittala commented 6 years ago

Another pre-release is now available that may introduce more stability when repeatedly calling OfficeToPDF.exe. See if it helps with the issue you're seeing. https://github.com/cognidox/OfficeToPDF/releases/tag/1.8.10.0

Regards Vittal

svanveldhuijzen commented 6 years ago

the problem still occurs to me sometimes with version 1.8.10.0. If I try the same batch of files again a couple of hours later there are no problems

chrisribe commented 4 years ago

I am getting the same issues, I am running the command via IIS php command prompt (url get trigger).

I did set the Word DCOM identity to the running IIS user and that got me going at first. https://theether.net/download/Microsoft/kb/288367.html

But I have noticed that if the IIS user is not connected or does not have a logged in session (task manager "sign off"). I consistently get the message: "Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))"

Any ideas ??

krbora commented 4 years ago

I had the similar issue. The WebEx plugin for office was causing the issue. Removing the plugin from Microsoft Word Add-Ins resolved the issue.