Wkhtmltopdf: Proper debugging - Exit with code 1 due to network error: ContentNotFoundError

Created on 19 Jan 2017  路  4Comments  路  Source: wkhtmltopdf/wkhtmltopdf

Exit with code 1 due to network error: ContentNotFoundError

I guess this speaks volumes to a a lot of users of wkhtmltopdf, the problem I am in now, I get no errors even with enable js debug parameter, no 404's by testing the exact same url from my machine (wkhtmltopdf also runs from my machine) and yet the PDF is created, but the task fails with the above mentioned error.

How can we do proper debugging of these errors so I don't spend hours over hours to go with the educated guesses and trial & error approach ?

Fixed

Most helpful comment

After 14 hours of debugging, the trial and error way, I just removed pieces of my application to see where wkhtmltopdf fails I found out that the issue was the way I loaded a local font through CSS. I didn't fix the issue yet, but I came here just to say this, maybe it'll help someone else.

As an idea, is there no way to output the browser warnings besides the console.log debugging ? Because the browser notifies the user that a font wasn't loaded, even the headless browser should have this implemented. Or even better, to just skip this error ?

I'm not closing this yet, as I want to see something made about this

All 4 comments

After 14 hours of debugging, the trial and error way, I just removed pieces of my application to see where wkhtmltopdf fails I found out that the issue was the way I loaded a local font through CSS. I didn't fix the issue yet, but I came here just to say this, maybe it'll help someone else.

As an idea, is there no way to output the browser warnings besides the console.log debugging ? Because the browser notifies the user that a font wasn't loaded, even the headless browser should have this implemented. Or even better, to just skip this error ?

I'm not closing this yet, as I want to see something made about this

I think I've run into a similar issue. It would be great if the attempted url was included in the error message.

+1

It's now included in 0.12.5.

Was this page helpful?
0 / 5 - 0 ratings