I am using wkhtmltopdf (wkhtmltopdf 0.11.0 rc1) for generating pdf using x-server (xvfb).
It was working for days but suddenly started showing “cannot connect to X server :99” error on one of our server.
ubuntu@servername:~$ xvfb-run --server-args="-screen 0, 1024x680x24" wkhtmltopdf --use-xserver http://www.google.com google.pdf
wkhtmltopdf: cannot connect to X server :99
But the same setup is working fine on three other servers.
I am not sure what went wrong on that server.
Problem solved.. Xvfb process was already running , By killed process, it is started working again.
ubuntu 29517 0.0 0.0 57576 1180 ? S Feb17 0:00 Xvfb :99 -screen 0, 1024x680x24 -nolisten tcp
also try to delete "/tmp/.tX99-lock",
#rm /tmp/.tX99-lock