Headless mode fails with qt 5.7
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
Headless mode (and book import from the gui which seems to depend on headless mode for some books) fails when using qt 5.7 (with the Fedora calibre-2.68.0 pkgs on Fedora 25), the error reported is:
"
This application failed to start because it could not find or load the Qt platform plugin "headless"
in "/usr/lib64/
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem.
"
I've managed to hack around this (fixing using calibre under X at least) with this:
--- /usr/lib64/
+++ /usr/lib64/
@@ -876,10 +876,7 @@
if override_
args = [override_
- if headless:
- if not args:
- args = sys.argv[:1]
- args.extend(
+ headless = False
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
self.pi = plugins[
@@ -1186,6 +1183,7 @@
_ea_lock = Lock()
def ensure_
+ headless = False
global _store_app
with _ea_lock:
if _store_app is None and QApplication.
Which allows me to import books again. I realize this is a useless fix, but it proves that the problem is with headless and that calibre works fine otherwise.
Works fine for me with Qt 5.7.0 on Arch. You want to debug why it is
not working on your machine, you should use the Qt env var to debug
plugin loading, IIRC it was something like QT_DEBUG_PLUGINS
Do,
QT_DEBUG_PLUGINS=1 calibre-debug -c "from calibre.gui2 import *; ensure_app()"
That gives me
QFactoryLoader: :QFactoryLoader () looking at "/home/ kovid/work/ calibre/ src/calibre/ plugins/ libheadless. so" work/calibre/ src/calibre/ plugins/ libheadless. so, metadata= project. Qt.QPA. QPlatformIntegr ationFactoryInt erface. 5.3",
"headless" ationPlugin" ,
Found metadata in lib /home/kovid/
{
"IID": "org.qt-
"MetaData": {
"Keys": [
]
},
"className": "HeadlessIntegr
"debug": false,
"version": 329472
}
Got keys from plugin meta data ("headless")
Most likely you just need to recompile the headless plugin.
status invalid