Blank screen after system & Anki upgrade

Hi, I just upgraded my OS yesterday to:

lsb_release -a
No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy

Now when I start Anki, I see just menus and otherwise a gray screen. Sync progress dialog and menus render normally. Looks to me like some sort of QtWebEngine problem. Starting with Shift held to disable addons doesn’t help. Console does not have any interesting logs:

$ anki
Anki starting...
Initial setup...
Preparing to run...
Gtk-Message: 07:44:28.386: Failed to load module "appmenu-gtk-module"
addons21/295889520/main.py:18:isWin is deprecated: please use 'is_win'
addons21/295889520/main.py:18:isMac is deprecated: please use 'is_mac'
cloze_overlapper/libaddon/platform.py:43:isMac is deprecated: please use 'is_mac'
cloze_overlapper/libaddon/platform.py:43:isWin is deprecated: please use 'is_win'
addons21/cloze_overlapper/config.py:40:stripHTML is deprecated: please use 'strip_html'
libaddon/anki/configmanager.py:42:json is deprecated: please implement your own
addons21/cloze_overlapper/sched.py:49:intTime is deprecated: please use 'int_time'
review_heatmap/libaddon/platform.py:45:isMac is deprecated: please use 'is_mac'
review_heatmap/libaddon/platform.py:45:isWin is deprecated: please use 'is_win'
libaddon/anki/configmanager.py:42:json is deprecated: please implement your own
addons21/review_heatmap/heatmap.py:36:json is deprecated: please implement your own
addons21/syntax_highlighting/config.py:16:json is deprecated: please implement your own
Starting main loop...
addons21/review_heatmap/activity.py:161:schedVer is deprecated: please use 'sched_ver'
conf key heatmap should be fetched with col.get_config(), and saved with col.set_config()
conf key heatmap should be fetched with col.get_config(), and saved with col.set_config()
addons21/review_heatmap/activity.py:161:schedVer is deprecated: please use 'sched_ver'
conf key imgocc should be fetched with col.get_config(), and saved with col.set_config()
conf key imgocc should be fetched with col.get_config(), and saved with col.set_config()
conf key imgocc should be fetched with col.get_config(), and saved with col.set_config()
addons21/cloze_overlapper/template.py:420:byName is deprecated: please use 'by_name'
conf key syntax_highlighting_conf should be fetched with col.get_config(), and saved with col.set_config()
addons21/syntax_highlighting/config.py:61:setMod() is deprecated: no longer required
addons21/review_heatmap/activity.py:161:schedVer is deprecated: please use 'sched_ver'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "logging", line 2141, in shutdown
  File "logging", line 1066, in flush
RuntimeError: wrapped C/C++ object of type ErrorHandler has been deleted

dpkg.log does not show any recent operations on any package containing substring qtwebengine. Just in case, I tried:

sudo apt install qtwebengine5-dev qtwebengine5-examples libqt5webengine5 python3-pyqt5.qtwebengine

I’ve tried upgrading to latest Anki version from GitHub, no dice.

About dialog doesn’t show anything, either, but at least the Copy Debug Info button works:

    Anki 2.1.51 (cf78a555) Python 3.9.10 Qt 5.15.2 PyQt 5.15.5
    Platform: Linux
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2022-05-01 08:51:09
    
    
    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Cloze Overlapper ['cloze_overlapper', 2019-02-01T04:37, 'None', '']
    CrowdAnki JSON exportimport Edit history Collaborate on deck creation ['1788670778', 2021-12-18T16:21, 'None', mod]
    External Editor ['16727059', 2020-11-07T08:15, 'None', mod]
    Image Occlusion Enhanced for Anki 21 ['1374772155', 2022-04-09T00:15, 'None', '']
    Mini Format Pack ['295889520', 2020-11-15T08:59, 'None', '']
    Review Heatmap ['review_heatmap', 2020-04-30T06:23, 'None', '']
    Syntax Highlighting ['syntax_highlighting', 2021-03-07T13:42, 'None', '']
    
    ===IDs of active AnkiWeb add-ons===
    1374772155 16727059 1788670778 295889520
    
    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    BetterTags ['bettertags', 2020-04-28T08:40, 'None', '']
    Syntax Highlighting for Code ['1463041493', 2020-11-01T05:58, 'None', '']

Anyone got any other ideas?

Uninstall Anki.
Download Anki from main Anki website, unpack and run like this:

env QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox" /home/user/path_to_anki_folder/./anki

I use this version on Manjaro without problems.

1 Like

@gnomek is right, but there’s no need for a reinstall. Simply running Anki with the flag --no-sandbox should fix the webview display issue.

3 Likes

@gnomek’s solution works. Just anki --no-sandbox does not, flags probably don’t get passed down.

Is there some already known upstream issue with QtWebEngine or something? I’d just like to know when can I upgrade and stop having to resort to the workaround.

1 Like

https://docs.ankiweb.net/platform/linux/installing.html#qt5-vs-qt6

1 Like

Tried switching to Qt 6 version of Anki, got this error in command line:

$ anki
Anki starting...
Initial setup...
Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
Preparing to run...
Gtk-Message: 09:12:43.383: Failed to load module "appmenu-gtk-module"
xkbcommon: ERROR: Couldn't process include statement for 'us(qwerty)'
xkbcommon: ERROR: Abandoning symbols file "(unnamed)"
xkbcommon: ERROR: Failed to compile xkb_symbols
xkbcommon: ERROR: Failed to compile keymap
[1852571:1852734:0504/091243.889625:FATAL:xkb_keyboard_layout_engine.cc(640)] Keymap file failed to load: us-qwerty
/home/agentydragon/.local/bin/anki: line 3: 1852571 Trace/breakpoint trap   (core dumped) /usr/local/bin/anki -b $HOME/drive/anki

I do have xkbcomp installed:

$ sudo apt search xkbcomp
Sorting... Done
Full Text Search... Done
x11-xkb-utils/jammy,now 7.7+5build4 amd64 [installed,automatic]
  X11 XKB utilities

Following Jami breaks after last update - Support in English - Jami Forum, I tried switching to Czech keyboard (from my default English QWERTY), and surprisingly, it worked. So, still not ideal. Let me know if anyone has ideas how to make Anki + Qt6 start for me with English QWERTY keyboard selected…

--no-sandbox worked for me. I had the same problem after updating from ubuntu 21.04 to ubuntu 22.04.

Since I am a Linux newbie, does anyone know where I can permanently add the flag? so when I press super and search for Anki, Anki is automatically started with this flag?

If you start Anki through the command line, you can make an alias (assuming you use Bash, which is the default on Ubuntu): add to your .profile the following line alias anki='anki --no-sandbox'. Now, when you open a new terminal, it will always automatically add that flag by default when you start Anki. If you have already opened terminals, and you want to update them without closing and reopening them, you could source that file with . ~/.profile, but in theory that file should only ever be sourced only once per bash session, at the bash login (but whatever…).

If you start Anki by clicking on an icon, or by pressing super and searching for Anki as you describe, you can modify the desktop entry. The easiest way, if you are a beginner with Linux, is to use Alacarte. I don’t recall if it’s installed by default on Ubuntu. You can press super, and search for alacarte. If you find something called “Menu Editor” or alike, click on it. Otherwise, first install it with sudo apt install alacarte (it will prompt you for your password). Then, it will show you every desktop entry you have (ie. every button you have access to when you press Super). Search for Anki’s entry (maybe it’s in Education?), then click on it and modify the command executed by adding the --no-sandbox flag. Done!

1 Like