Forums

wkhtmiltopdf Exit with code 1 due to network error: ContentAccessDenied

Hello. I am working on an app that uses django-wkhtmltopdf . When I try to generate a pdf via the web interface, I get this error: Command '['/usr/bin/wkhtmltopdf', '--enable-local-file-access', '--encoding', 'utf8', '--margin-top', '15', '--quiet', '--title', 'title', '/tmp/wkhtmltopdf7odvs7s9.html', '-']' returned non-zero exit status 1.

On the command line with this command: wkhtmltopdf --disable-javascript --encoding utf8 --quiet False /tmp/wkhtmltopdf7odvs7s9.html

I get this: Exit with code 1 due to network error: ContentAccessDenied

I would like to know if this is a problem of access to the /tmp folder, and if so, how to fix it.

Thank you

I do not know how django-wkhtmltopdf works under the hood. It looks like it tries to do some network connection and fails. It does not look like the problem with access to /tmp

Try running it from console to find out the error. I'm getting the error "Exit with code 1 due network error: ContentAccessDenied" and I was unable to solve it yet.

@Yikiri I can't reproduce that error -- I rather get HostNotFoundError , because Error: Failed to load http://false/ -- is the command you pasted the exact one you're using in the console?

@systemhelpme what's the command you're running?