Error generating the document No attachment found with sysId

Ratan B
Tera Contributor

Dear Form,
After Tokyo Upgradation, while generating PDF from Document Template getting below error log "

Error generating the document No attachment found with sysId : d61d125a1b539110292b859e7b4bcbfe, aborting conversion. 

And If I click preview as pdf showing below message "Error MessageUnable to preview document due to an error" .

9 REPLIES 9

Tim Preston
Tera Contributor

I just ran across this issue too. For me, the issue was with the HTML passed to the PDFGenerationAPI. It contained broken links to images and since the image didn't exist, the API couldn't translate it. Once those images were fixed, everything worked properly. I don't know if it helps, but that's what fixed the issue for us.

Justin N
Tera Contributor

I have ran into this issue as well. Our specific problem was caused by the document template containing an image that was not captured and moved from lower instances. To determine if this is your issue I would navigate to your document template record and attempt to preview it. If you can preview the document template, but it actually 'breaks' when trying view in PDF format, then you have an image in your template that doesnt exist in you sys_attachment table.

To fix this issue, we had to edit the document template in each instance, re-insert the image, and then publish the document template.

Really hope this fixes your issue because it annoyed us for a WHILE!

Had the same exact issue

briannice
Kilo Sage

I'm having the exact same problem when calling the method sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDF(...). Anyone has a solution for this? It seems like an error from the ServiceNow PDF Generation Utilities (com.snc.apppdfgenerator) application.

Hi, Justin N had the solution for me. Try and scan your html for any attachment references that might be outdated. In my case, another developer deleted a shared image without informing others.