wkhtmltopdf temporary file creation failed

(3 posts) (2 voices)

Tags:

No tags yet.

  1. rmanes, Member

    Was unable to create the export file to system temporary directory /tmp

    We are getting the above error on our fresh install of mydbr when we try to export the report to a pdf.

    We were running mydbr on an old server and started up a new server, installed mydbr and all the accompanying optional modules, hooked up to the existing database, and ran a report. Flawlessly. Then it choked on exporting to pdf.

    I have verified that we have rwx for all on the folder.

    Do you have any idea how to go about troubleshooting this?

  2. myDBR Team, Key Master

    myDBR tries to use the system TMP directory as configured. Some server configurations however, are limiting access to tmp-directory in PHP or in web server. What is the server OS you are using?

    You can check if tmp is included in open_basedir or if your server uses PrivateTmp.

    You can also specify another temp directory to be used in /user/defaults.php:

    $mydbr_defaults['export']['wkhtmltopdf']['tmp_directory'] = '/mytemp';

    --
    myDBR Team

  3. rmanes, Member

    Fixed!!!

    We are using CentOS 7.0.146 & PHP 5.4.16.

    I've verified that open_basedir in php.ini is not being used - it's commented out.

    I ended up creating another temp folder per your instructions, but that still didn't fix it. I eventually had to turn off PrivateTmp for Apache. That allowed me to create the working file in the new temp (/mydbrTemp) folder. Cool.

    Then I got errors about not being able to load various files. wget couldn't get them, either, but openssl could still connect.... I then also turned off client certificate verification for requests that originate from the server (we use both client & server verification). That seems to have been the last fix.

    Thanks for the help. You saved us probably hours of work tracking down the 'PrivateTmp' setting.


Reply

You must log in to post.