Anki fails to execute on Linux wattOS

The installation of anki-23.12.1-linux-qt6 in the wattOS version of Linux completed without generating any error messages but when I try to run Anki by typing “anki” in a terminal window where the installation was executed the following is displayed:

“bash: /usr/local/bin/anki: Permission denied”

However, when I browse to /usr/local/bin/anki the permissions associated with the anki executable are that it can be executed by “Anyone”.

I would appreciate any help on how to overcome this error and get Anki to run.

Best regards

I haven’t had this issue and haven’t used wattOS. But just in case it helps somehow, I’ll add some context from my computer that has a working Anki installation.

On my computer (not wattOS), /usr/local/bin/anki is a symlink pointing to the file /usr/local/share/anki/anki. Here’s my output from ls -lh /usr/local/{bin,share/anki}/anki:

$ ls -lh /usr/local/{bin,share/anki}/anki
lrwxrwxrwx 1 root root  26  1月 20 12:04 /usr/local/bin/anki -> /usr/local/share/anki/anki
-rwxr-xr-x 1 root root 82M 12月 28 01:53 /usr/local/share/anki/anki

edit1:
Here’s my Anki version info
Version ⁨23.12.1 (1a1d4d54)⁩
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1

1 Like

Thank you for your response.

My response to “ls -lh /usr/local/{bin,share/anki}/anki” is as follows:

lrwxrwxrwx 1 root root 26 Mar 13 13:39 /usr/local/bin/anki → /usr/local/share/anki/anki
-rw-r–r-- 1 root root 82M Dec 28 08:53 /usr/local/share/anki/anki

They look similar to yours except for some execution permissions in the final line. Might that be the problem?

Also, we seem to have the same Anki version, anki-23.12.1, but I have a different version of Python, ie Python 3.11.2.

Best regards

I think you’re right. On my file, execution permissions are present for all of user, group, and other. On yours, none of those have execution permission.

To give it execution permission, do this:

  1. cd /usr/local/share/anki/
  2. ls -lh anki to verify that you’re looking at the file that needs to be changed
  3. sudo chmod +x anki to add execution permission to user, group, and other. The sudo usage is required because the file is owned by root.
  4. ls -lh anki to verify that x is present in all three spots of -rwxr-xr-x

Then try to launch Anki again.

edit2: Launch with just a plain anki, don’t use sudo. Root is the owner and the group, but step 3 above gives permission to everyone to execute it.


That Python difference is a bit strange. I wonder if you’ll see the same as me when you’re able to launch Anki and check under Help -> About. The reason is that Anki reports a different Python version than what I have installed. Here’s my output for checking my installed version with pacman:

$ pacman -Ss ^python$
core/python 3.11.8-1 [installed]
    The Python programming language

That’s much closer to your version.

edit1: It could be that Anki uses its own version of Python. We’ll know if you see 3.9.15 under Help -> About.
edit3: Nevermind. It’s almost definitely the case. That entire line of Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 differs from my system, so it should just be what this version of Anki has included.

1 Like

Thank you for your message.

Your suggestions seem to have solved the initial problem but there now seems to be a Qt problem, see commands and responses below.

  1. Verify file to change:
    niall@niall-satelliteproc660:~$ cd /usr/local/share/anki/
    niall@niall-satelliteproc660:/usr/local/share/anki$ ls -lh
    total 82M
    -rw-r–r-- 1 root root 82M Dec 28 08:53 anki
    -rw-r–r-- 1 root root 528 Feb 22 2023 anki.xml
    drwxr-xr-x 10 root root 4.0K Mar 11 08:51 lib
    -rw-r–r-- 1 root root 618 Feb 22 2023 README.md
    -rw-r–r-- 1 root root 380 Feb 22 2023 uninstall.sh

  2. Change permission and verify:
    niall@niall-satelliteproc660:/usr/local/share/anki$ sudo chmod +x anki
    [sudo] password for niall:
    niall@niall-satelliteproc660:/usr/local/share/anki$ ls -lh anki
    -rwxr-xr-x 1 root root 82M Dec 28 08:53 anki

  3. Run Anki:
    niall@niall-satelliteproc660:/usr/local/share/anki$ anki
    Anki starting…
    Initial setup…
    Preparing to run…
    Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
    Qt warning: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
    Qt info: Could not load the Qt platform plugin “xcb” in “” even though it was found.
    Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-egl, eglfs, wayland, xcb, offscreen, minimal, linuxfb, vnc, minimalegl, vkkhrdisplay.

Aborted

Based on the above xcb-cursor0 or libxcb-cursor0 seems to be needed for the Qt xcb plugin, libxcb-cursor0 was installed via Synaptic. The output from another attempt to run Anki follows below.

  1. Run Anki again:
    niall@niall-satelliteproc660:/usr/local/share/anki$ anki
    Anki starting…
    Initial setup…
    Preparing to run…
    File “”, line 1, in
    File “aqt”, line 509, in run
    File “aqt”, line 583, in _run
    File “aqt.profiles”, line 139, in setupMeta
    File “aqt.profiles”, line 421, in _loadMeta
    resetting corrupt _global
    Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
    Qt warning: OpenType support missing for “DejaVu Sans”, script 15
    Qt warning: OpenType support missing for “Nimbus Sans”, script 15
    Qt warning: OpenType support missing for “URW Gothic”, script 15
    Qt warning: OpenType support missing for “Nimbus Sans Narrow”, script 15
    Qt warning: OpenType support missing for “Quicksand”, script 15
    Qt warning: OpenType support missing for “DejaVu Math TeX Gyre”, script 15
    Qt warning: OpenType support missing for “DejaVu Sans Mono”, script 15
    Qt warning: OpenType support missing for “DejaVu Serif”, script 15
    Qt warning: OpenType support missing for “Noto Sans Mono”, script 15
    Qt warning: OpenType support missing for “D050000L”, script 15
    Qt warning: OpenType support missing for “Standard Symbols PS”, script 15
    Qt warning: OpenType support missing for “Special Elite”, script 15
    Qt warning: OpenType support missing for “Classic Console”, script 15
    Qt warning: OpenType support missing for “C059”, script 15
    Qt warning: OpenType support missing for “Nimbus Mono PS”, script 15
    Qt warning: OpenType support missing for “Nimbus Roman”, script 15
    Qt warning: OpenType support missing for “P052”, script 15
    Qt warning: OpenType support missing for “Noto Mono”, script 15
    Qt warning: OpenType support missing for “Droid Sans Fallback”, script 15
    Qt warning: OpenType support missing for “Cantarell”, script 15
    Qt warning: OpenType support missing for “Quicksand Medium”, script 15
    Qt warning: OpenType support missing for “gallant12x22”, script 15
    Qt warning: OpenType support missing for “OCR A Std”, script 15
    Qt warning: OpenType support missing for “Quicksand Light”, script 15
    Qt warning: OpenType support missing for “URW Bookman”, script 15
    Qt warning: OpenType support missing for “Z003”, script 15
    Qt warning: OpenType support missing for “Noto Color Emoji”, script 15
    Qt warning: OpenType support missing for “”, script 15
    Qt warning: OpenType support missing for “”, script 15
    Qt warning: OpenType support missing for “”, script 15
    Qt warning: OpenType support missing for “”, script 15
    Qt warning: OpenType support missing for “”, script 15
    Qt warning: OpenType support missing for “”, script 15
    LaunchProcess: failed to execvp:
    /usr/local/share/anki/lib/PyQt6/Qt6/libexec/QtWebEngineProcess
    [4258:4258:0315/145503.152771:FATAL:zygote_communication_linux.cc(275)] Cannot communicate with zygote
    Trace/breakpoint trap

Any further suggestions much appreciated.

Good job spotting that and working on it! Based on what you found, there’s another step that follows:

The Anki manual has a page for installation instructions here: Install & Upgrade - Anki Manual
The requirements given include the libxcb-cursor0 package that you installed. This is the full installation command:
sudo apt install libxcb-xinerama0 libxcb-cursor0 libnss3

You installed one package already, so I think you should use
sudo apt install libxcb-xinerama0 libnss3
Or you can use Synaptic again for libxcb-xinerama0 and libnss3 since it’s another way of doing the same thing.

1 Like

Thanks again, nearly there but some problems still remain.

When I used the command “sudo apt install libxcb-xinerama0 libxcb-cursor0 libnss3” the result was the following:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
libxcb-xinerama0 is already the newest version (1.15-1).
libxcb-xinerama0 set to manually installed.
libxcb-cursor0 is already the newest version (0.1.4-1).
libnss3 is already the newest version (2:3.87.1-1).
libnss3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

This seems to suggest that the three packages were already installed and were the newest versions, however on running Anki the output was different to my previous post, see below:

~$ anki
Anki starting…
Initial setup…
Preparing to run…
Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
LaunchProcess: failed to execvp:
/usr/local/share/anki/lib/PyQt6/Qt6/libexec/QtWebEngineProcess
[2042:2042:0316/093624.248016:FATAL:zygote_communication_linux.cc(275)] Cannot communicate with zygote
Trace/breakpoint trap

The problems seem to be a file with .desktop as suffix and with LaunchProcess. Do you know the location of this desktop file and could it be the cause of the second problem?

Any suggestions much appreciated.

Best regards

That’s surprising to me!

I found it at /usr/local/share/applications/anki.desktop. I looked in all the wrong spots before that. I’m not knowledgeable about .desktop files, but I can try to figure something out if you’ve got a guess. Here are the contents of mine:

[Desktop Entry]
Name=Anki
Comment=An intelligent spaced-repetition memory training program
GenericName=Flashcards
Exec=anki %f
TryExec=anki
Icon=anki
Categories=Education;Languages;KDE;Qt;
Terminal=false
Type=Application
Version=1.0
MimeType=application/x-apkg;application/x-anki;application/x-ankiaddon;
#should be removed eventually as it was upstreamed as to be an XDG specification called SingleMainWindow
X-GNOME-SingleWindow=true
SingleMainWindow=true

edit:

I just checked via my terminal. I get the same warning, but Anki launches anyway. So that can probably be safely ignored on your end too.


Now that you’ve checked the dependencies, I’ll give my unfortunate suspicion. Files that should have execution permissions don’t have them.

Here’s my output from checking the execution permissions on that file:

$ ls -lh /usr/local/share/anki/lib/PyQt6/Qt6/libexec/QtWebEngineProcess
-rwxr-xr-x 1 root root 24K 12月  7 22:25 /usr/local/share/anki/lib/PyQt6/Qt6/libexec/QtWebEngineProcess

If yours doesn’t have execution permissions on it, it’s likely that there are many others without them. For example, here’s my output when checking how many files have execution permission set for any of user, group, or other in the directory /usr/local/share/anki:

$ find /usr/local/share/anki -perm /111 | wc -l
248

If your situation looks different, I recommend reinstalling Anki. I could give you the list of files, but that’s a bit much for around 250 files. And it wouldn’t guarantee a solution.

For uninstalling, if you had something else install Anki, use it again to uninstall.

If not, your uninstall.sh needs to be given execution permission: your prior results gave -rw-r–r-- 1 root root 380 Feb 22 2023 uninstall.sh. So the steps would be a bit different:

  1. cd /usr/local/share/anki/
  2. sudo chmod +x uninstall.sh
  3. sudo ./uninstall.sh

For installing, redownload Anki from https://apps.ankiweb.net and then reinstall by following the directions in the installation section of Install & Upgrade - Anki Manual

1 Like

I’m guessing QtWebEngineProcess is also not executable. Did you extract the .tar.zst file using the documented tar command? It seems as if the files in the Anki distribution that are supposed to be marked as executable are not, which implies that either the program that extracted the files (e.g. a GUI file manager) didn’t preserve the permissions, or for some reason they were lost when installing.

2 Likes

Thank you both for your messages. After uninstalling and reinstalling Anki, without generating any error messages, it is now working but on startup the error message about a .desktop file is still displayed along with quite a few others.

For the new installation the downloaded Anki distribution was extracted via the tar command rather than by a GUI file manager as previously.

The output on starting Anki follows below:

anki
Anki starting...
Initial setup...
Preparing to run...
Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix 
Qt debug: doh set to ""  --  SystemOnly 
Starting main loop...
blocked main thread for 581ms:
  File "<string>", line 1, in <module>
  File "aqt", line 509, in run
  File "aqt", line 717, in _run
  File "aqt.progress", line 118, in handler
  File "aqt.main", line 218, in on_window_init
  File "aqt.main", line 317, in setupProfile
  File "aqt.main", line 474, in loadProfile
  File "aqt.main", line 610, in loadCollection
  File "aqt.main", line 646, in _loadCollection
  File "anki.collection", line 150, in __init__
  File "anki.collection", line 291, in reopen
  File "anki._backend_generated", line 133, in open_collection
  File "anki._backend", line 162, in _run_command

[1876:1934:0317/151508.179954:ERROR:shared_context_state.cc(363)] OOP raster support disabled: GrContext creation failed.
[1876:1934:0317/151508.180014:ERROR:gpu_channel_manager.cc(946)] ContextResult::kFatalFailure: Failed to InitializeGrContext for SharedContextState
[1876:1934:0317/151508.181032:ERROR:shared_image_stub.cc(492)] SharedImageStub: unable to create context
[1876:1934:0317/151508.181084:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
[1876:1934:0317/151508.185977:ERROR:shared_context_state.cc(363)] OOP raster support disabled: GrContext creation failed.
[1876:1934:0317/151508.186007:ERROR:gpu_channel_manager.cc(946)] ContextResult::kFatalFailure: Failed to InitializeGrContext for SharedContextState
[1876:1934:0317/151508.186613:ERROR:shared_image_stub.cc(492)] SharedImageStub: unable to create context
[1876:1934:0317/151508.186647:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
[1876:1934:0317/151508.190479:ERROR:shared_context_state.cc(363)] OOP raster support disabled: GrContext creation failed.
[1876:1934:0317/151508.190515:ERROR:gpu_channel_manager.cc(946)] ContextResult::kFatalFailure: Failed to InitializeGrContext for SharedContextState
[1876:1934:0317/151508.191175:ERROR:shared_image_stub.cc(492)] SharedImageStub: unable to create context
[1876:1934:0317/151508.191241:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub
[1876:1934:0317/151508.196706:ERROR:shared_context_state.cc(363)] OOP raster support disabled: GrContext creation failed.
[1876:1934:0317/151508.196754:ERROR:gpu_channel_manager.cc(946)] ContextResult::kFatalFailure: Failed to InitializeGrContext for SharedContextState
[1876:1934:0317/151508.197432:ERROR:shared_image_stub.cc(492)] SharedImageStub: unable to create context
[1876:1934:0317/151508.197502:ERROR:gpu_channel.cc(589)] GpuChannel: Failed to create SharedImageStub

Best regards

Nice! I’ve been ignoring the .desktop warning for a long time without issues. But I haven’t seen the other errors before.

We’re now in an area I can only guess at. From your errors, these are the files concerned.

shared_context_state.cc
gpu_channel_manager.cc
shared_image_stub.cc
gpu_channel.cc

Given that the files mention GPU, this Anki manual section may help: Display Issues - Anki Manual
If you’re able to use Anki despite the errors, I’d try using the different video driver options under Tools -> Preferences. The manual page above tells how to do it if you can’t launch Anki:

If you change it and then can’t launch Anki anymore, run the command rm ~/.local/share/Anki2/gldriver6. That’s the file that non-default video driver options are written to.

If that doesn’t work (edit: I’m guessing this isn’t relevant because qt6 is involved):
When I did a Google search for those files, I got results for Google Chrome and Chromium. Some people have fixed other issues by deleting their GPUCache directory for Chrome and Chromium. Thread for context: Most graphics broken on Chromium on AMD laptop; Skia, shader errors / Applications & Desktop Environments / Arch Linux Forums


edit:
On my end, I couldn’t find a relevant GPUCache folder:

cd /
sudo find . -type d -iname gpucache 2>/dev/null

The only other thing I noticed is that Qt is in those Google search results (and Anki uses Qt). But I’m failing to think of something else to do with that knowledge. Maybe update any qt6 packages?

1 Like

I found someone who had a similar error here on the forums, but with macOS: ELLIOTTCABLE’s response to Anki opens but all windows are blank

It might be worth trying out this command:

QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu" anki
1 Like

Thank you for your response and research.

The problem seems to be related to the video driver as Anki starts without any errors when “Software” is selected as the video driver instead of “OpenGL” or “Vulkan”; see output below. A range of new errors were displayed when either “OpenGL” or “Vulkan” were selected.

$ anki
Anki starting...
Initial setup...
Preparing to run...
Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix 
Qt debug: doh set to ""  --  SystemOnly 
Starting main loop...

Overall then it seems to me that everything is now working as normal.

Many thanks for your help.

Best regards.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.