Generation of documentation fails: "qt.qpa.xcb: could not connect to display"

I am able to generate the documentation locally, but when I try to do so on Github I get the following errors during execution of make.jl:

[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

Aborted (core dumped)
connect: Connection refused
GKS: can't connect to GKS socket application

The package is PSSFSS.jl and the documentation build log is here
I thought it was allowed to include plots in the online generated documentation. Is that correct? If that’s not it, then I could sure use some help debugging this. Thanks in advance.

1 Like

I see you’re using Plots.jl, and “GKS” sounds like the GR backend. In that case, set the magic environmental variable

ENV["GKSwstype"] = "100"

which tells it to operate in “headless” mode where it doesn’t expect an active display connected. (AFAIK this is undocumented but it’s super useful!).


Thanks! That did the trick (for that error, at least).

1 Like

For anyone wondering where this information originated from, see Workstation Types — GR Framework 0.57.3 documentation.

1 Like