en
Language
  • en
  • de
  • fr
  • es
  • br
  • ru
  • jp
  • kr
AI translation
  • ae
  • cn
  • vn
  • id
  • eu
  • il
  • gr
  • no
  • fi
  • dk
  • se
  • tr
  • bg
  • nl
  • it
  • pl
  • hu
  • ro
  • ua
  • cs

I can't export to PDF (internal server error)

When you try to fo a PDF export which results in an error (or acts as if nothing happens). The production log would list error similar to
Errno::EPIPE (Broken pipe) or wkhtmltopdf: cannot connect to X server

Caused by issues with exporting component wkhtmltopdf

Here are the proposed solutions.

Headless server

Get needed version of wkhtmltopdf from http://wkhtmltopdf.org/downloads.html

Example (you have to work with details of your own environment):

  1. sudo apt-get install xvfb xauth
  2. wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
  3. sudo dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
  4. sudo apt-get -f install
  5. sudo mv /usr/local/bin/wkhtmltopdf /usr/local/bin/xwkhtmltopdf
  6. echo 'exec xvfb-run -a -s "-screen 0 640x480x16" xwkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf >/dev/null
  7. sudo chmod a+x /usr/local/bin/wkhtmltopdf

Non-headless server only

  1. You need to have wkhtmltopdf installed on your server in PATH
    (apt-get install wkhtmltox, yum install wkhtmltox)
    It must be installed in bundler, otherwise it may not work after updating Easy Redmine
  2. Make sure that program works correctly (run from the console for example wkhtmltopdf https://easyredmine.com homepage.pdf)
  3. re-run rake easyproject:install RAILS_ENV=production
  4. restart server

Try Easy Redmine in 30 days free trial

Full features, SSL protected, daily backups, in your geolocation