FS#58734 - [anki] Fails to start after today's qt update.
Attached to Project:
Community Packages
Opened by michael Lojkovic (zerophase) - Friday, 25 May 2018, 23:23 GMT
Last edited by Johannes Löthberg (demize) - Tuesday, 01 January 2019, 17:30 GMT
Opened by michael Lojkovic (zerophase) - Friday, 25 May 2018, 23:23 GMT
Last edited by Johannes Löthberg (demize) - Tuesday, 01 January 2019, 17:30 GMT
|
Details
Description:
Anki fails at getting a webview during startup. Additional info: Error during startup: Traceback (most recent call last): File "/usr/share/anki/aqt/main.py", line 50, in __init__ self.setupUI() File "/usr/share/anki/aqt/main.py", line 75, in setupUI self.setupMainWindow() File "/usr/share/anki/aqt/main.py", line 584, in setupMainWindow tweb = self.toolbarWeb = aqt.webview.AnkiWebView() File "/usr/share/anki/aqt/webview.py", line 114, in __init__ self.focusProxy().installEventFilter(self) AttributeError: 'NoneType' object has no attribute 'installEventFilter' Steps to reproduce: 1. Update Arch to latest version 2. open Anki |
This task depends upon
Closed by Johannes Löthberg (demize)
Tuesday, 01 January 2019, 17:30 GMT
Reason for closing: Fixed
Additional comments about closing: Anki now officially supports non-outdated Qt versions.
Tuesday, 01 January 2019, 17:30 GMT
Reason for closing: Fixed
Additional comments about closing: Anki now officially supports non-outdated Qt versions.
First time commenting on a bug report here, so please bear with me as I familiarise myself with the method.
I’ve tried downgrading the two packages listed as dependencies for Anki which I thought to be the culprit: python-pyqt5 & qt5-webengine. I’ve tried to disable them first separately and then together, and here are some tentative remarks:
1) Downgrading qt5-webengine didn’t change the behaviour mentioned in the report: Anki shows an error, fails to start, and is left running in the background. When run from a shell, the process doesn’t seem to output anything useful.
2) Downgrading python-pyqt5 prevents Anki from launching (i.e. it doesn’t even show the error box), which would seem to incriminate it.
I’ve included a log containing the back-trace when running Anki with a downgraded python-pyqt5, but it boils down to:
> Cannot mix incompatible Qt library (version 0x50a01) with this library (version 0x50b00)
So, apparently, you’d have to downgrade the entire Qt library to make it work.
HTH.
[code]
class AnkiWebView(QWebEngineView):
fp = None
def __init__(self, parent=None):
...
if AnkiWebView.fp is None:
AnkiWebView.fp = QQuickWidget()
AnkiWebView.fp.setAttribute(Qt.WA_AlwaysStackOnTop)
AnkiWebView.setFocusProxy(AnkiWebView.fp)
[/code]
Though no cards show up now.
[code]
qt5-base 5.10.1-8 5.10.1-8 0.00 MiB
qt5-declarative 5.11.0-1 5.10.1-4 2.54 MiB
qt5-location 5.11.0-1 5.10.1-2 -1.07 MiB
qt5-multimedia 5.11.0-1 5.10.1-1 -0.14 MiB
qt5-quickcontrols 5.11.0-1 5.10.1-1 1.92 MiB
qt5-sensors 5.11.0-1 5.10.1-1 0.00 MiB
qt5-svg 5.11.0-1 5.10.1-1 0.01 MiB
qt5-tools 5.10.1-1 17.05 MiB
qt5-webchannel 5.11.0-1 5.10.1-1 0.00 MiB
qt5-webengine 5.11.0-2 5.10.1-2 8.66 MiB
qt5-x11extras 5.11.0-1 5.10.1-1 0.00 MiB
qt5-xmlpatterns 5.11.0-1 5.10.1-1 -0.10 MiB
qt5-webkit 5.212.0alpha2-15 5.212.0alpha2-14 0.00 MiB
pyqt5-common 5.10.1-3 5.10.1-2 0.00 MiB
python-pyqt5 5.10.1-3 5.10.1-2 -0.07 MiB
[/code]
and it helped now. If you urgently need that as a quick fix, you should be able to use the file above as `pacman -U $(cat pkgs.txt)`. Not ideal of course, since it can break your other qt5 software expecting 5.11. In my case, it's only anki though (or I don't care)
I am sure that I can input chinese in anki (2.1.0beta39-1), when it can lauch correctly.
There is information below:
1. softwares
```text
fcitx-rime 0.3.2-2
fcitx 4.2.9.6-1
anki 2.1.0beta39-2
```
2. locale
```text
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
```
3. I am sure through `htop` and typeing `e` on process `anki` that these enviroment variables are setting correctly.
At the last, I startup anki at the command line through a command, `LANG=zh_CN.UTF-8 anki`, and there is no difference.
The QT documentation doesn't mention much being being changed with QWebEngineView and related classes. Could this be a bug with PyQt5 with QT 5.11?
As for the other Qt5.11 changes, I tested adding the same check to anki and it does make it open the links in the internal browser, but while clicking on a deck would change the bottom menu buttons, the main page stays the same. Not entirely sure what's going on there.
Replacing acceptNavigationRequest with a QWebEngineUrlRequestInterceptor appears to fix any side effects from acceptNavigationRequest getting hit. I won't know if that's necessary till we can pinpoint why incorrect paths are getting passed to the mediaserver.
@zerophase Thanks a lot, I'm not good at Python and have not used Qt, Hence sorry to don't know the reason of crash when it launch.
Is it possible to fix the issue at 2.1.0beta39 or 2.1.0beta40 builed from sources with Qt5.11?
QObject::setParent: Cannot set parent, new parent is in a different thread
QObject: Cannot create children for a parent that is in a different thread.
(Parent is AnkiQt(0x561b90243990), parent's thread is QThread(0x561b8f57aea0), current thread is QThread(0x7fc970366990)
QObject::startTimer: Timers can only be used with threads started with QThread
So, the Bridge::cmd is running on a separate thread when a deck is selected.
The version 2.1.0beta40-1 is a binary from upstream, which works for me but cant input chinese.
if it is installed by pacman and from repository, it works correctly, because it contains Qt dependencies owe to as a binary release.I have tried it, but it cant input chinese :sob:
I will wish it could be fixed and pay close attention to it.
I installed the official version because the current package is too big...
How does your software work?
[Minor issue with the pkgbuild: mpv is missing as optional dependency for playback, Anki 2.1 prioritizes it over mplayer.]