<p></p>
<p>While investigating <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="580364210" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2556" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/2556/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/2556">#2556</a> I found a problem with our phantomjs config. After running vagrant up, phantomjs is in a non-working state:</p>
<pre><code>vagrant@ubuntu-bionic:/srv/openstreetmap-website$ /usr/bin/phantomjs --version
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display.
</code></pre>
<p>This turns out to be expected, since the <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817277" rel="nofollow">debian/ubuntu build of phantomjs doesn't use the patched+bundled version of QT that is in the official phantomjs builds</a>.</p>
<p>We <a href="https://github.com/openstreetmap/openstreetmap-website/blob/9b61ec2912dfd15a5edd7ffc5ac3526cd61c9f9a/test/application_system_test_case.rb#L7">already have code to handle this situation</a> in the test suite, namely:</p>
<pre><code>ENV["QT_QPA_PLATFORM"] = "phantom" if IO.popen(["phantomjs", "--version"], :err => :close).read.empty?
</code></pre>
<p>... but this doesn't work on our vagrant boxes, because:</p>
<pre><code>vagrant@ubuntu-bionic:/srv/openstreetmap-website$ QT_QPA_PLATFORM=phantom /usr/bin/phantomjs --version
This application failed to start because it could not find or load the Qt platform plugin "phantom"
in "".

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
</code></pre>
<p>I don't know where the "phantom" in <code>ENV["QT_QPA_PLATFORM"] = "phantom"</code> comes from. Should this be <code>"offscreen"</code>? Or will that break a different situation?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2569">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJEJ5TGI3OP2I7SDUTRJICFTANCNFSM4LTORTPQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLLMPIVGA3RJLP2DKU3RJICFTA5CNFSM4LTORTP2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IYHTTSA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/2569",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/2569",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>