-
Notifications
You must be signed in to change notification settings - Fork 5.7k
QXcbConnection: Could not connect to display #14376
Comments
Please check your environment variable |
Yep, it is - in both cases. Does this need to be manually forced for some reason? Thanks! |
I would send a patch to reset all the troublesome environment variables before initializing Qt ... if I could find a list of them anywhere. But it sounds like this isn't actually the problem? |
It doesn't sound like it, but I could definitely be wrong. |
Trying different things, no luck. Is there a setting of QT_QPA_PLATFORM that you believe may help? Thanks! |
Hi, Having same issue here. Where can I find this settings of QT? How to get there. So I can check that on my side. Thanks! |
The
|
can confirm |
We finally got things working by downloading the binary at https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 and extracting the phantomjs to /usr/bin |
I had hard times with ubuntu 16.04 they basically distribute half finished system with lots of broken packages. |
I'm running on 16.04 too, but the problem with the repo's is that they deliver with x11, which fails. So with the binary I don't have that issue and it works perfectly now. |
Works here now also - thanks!!! |
Debian/Ubuntu has a modified version of PhantomJS that can work headlessly, hence the problem with QXcb. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817277 for details. Unfortunately, this is not something that we (=PhantomJS team) can fix. |
@ricohumme Can you provide the steps (commands) to install it? I tried:
but still couldn't get it working |
@3zzy the steps I used are as follows: Does this help your case? |
Thanks for help, solution above works well :) |
I have the same error but in Odoo |
xvfb-run worked best for me, from Ariya's link posted 8/2016. |
@jglogan Thank you for solution with |
It seems that QT_QPA_PLATFORM=offscreen is not perfect. It works on Debian 8 jessie amd64 with PhantomJS 2.1.1 when you want to show version info:
but it fails when you try to, for example, render a website:
So I just extracted phantomjs binary from https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 and this one works great. To be honest most of the binaries on my server are from archives like this. The ones installed with apt-get often doesn't work (like phantomjs), are outdated or contain a lot of unnecessary files. |
This is quite the opposite:
There is also a suggestion to use |
try to uninstall phantomjs and just download the binary then create the softlink. that works for me.. apt-get remove phantomjs |
I can absolutely confirm what ricohumme said: We finally got things working by downloading the binary at https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 and extracting the phantomjs to /usr/bin What we found was that without this specific version of phantomjs on Ubuntu 16, no text would appear in the rendered pdf files. We ran it as: QT_QPA_PLATFORM=phantom QT_QPA_FONTDIR=/usr/share/fonts phantomjs ../vendor/assets/javascripts/rasterize.js file.html file.pdf letter And that successfully rendered a pdf. |
Every time I try to plot anything with RStudio Cloud using the webshot package I obtain an error. An example:
The error says:
Any thoughts? |
`QT_QPA_PLATFORM=offscreen" is used to resolve the error "QXcbConnection: Could not connect to display" from PhantomJS, per ariya/phantomjs#14376 (comment).
phantomjs --version
.2.1.1
Ubuntu 16.04 LTS
Binary - installed it as part of Ubuntu (using apt).
This is very similar to QXcbConnection: Could not connect to display #14240, but I am using the stock version of PhantomJS (with Ubuntu). Below is the output from running the cron job (which calls the script file, to generate a pdf file once a day) ...
Thanks!
The text was updated successfully, but these errors were encountered: