Help fixing an Anki install on Debian 11

I have 2 Debian 11 environments (Proots in Termux). Both run Anki 2.1.65 installed via pip:

  1. My old Debian 11 install which works just fine and can open a small test collection and my large actual collection .
  2. My new Debian 11 install which can open the small test collection just fine, but the large collection crashes with the following error:
$ pyenv/bin/anki --safemode
Preparing to run...
Qt warning: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-anki-user'
[10456:10497:0809/165356.091414:ERROR:file_path_watcher_linux.cc(71)] Failed to read /proc/sys/fs/inotify/max_user_watches
[10456:10501:0809/165356.146170:ERROR:udev_watcher.cc(50)] Failed to initialize a udev monitor.
pcilib: Cannot open /proc/bus/pci/devices
Qt warning: QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault

I get the max_user_watches error even when running working install of Anki, so I don’t think that’s relevant. The error about the udev_monitor and Timers is unique to the broken install of Anki.

For now, I need these two environments. The old env has a working Anki but can’t recieve updates via apt (It failed the upgrade process to Debian 12, so now part of it thinks it is Debian 12). The new env has a working apt, but not Anki.

I can get the debug info from the about screen. I truncated the add-on info because I disabled them. The working env has:

    Anki 2.1.65 (aa9a734f) Python 3.9.2 Qt 5.15.2 PyQt 5.15.2
    Platform: Linux-6.2.1-PRoot-Distro-aarch64-with-glibc2.36
    Flags: frz=False ao=True sv=2
    Add-ons, last update check: 2023-08-08 11:39:28

And the broken env has:

    
    Anki 2.1.65 (aa9a734f) Python 3.9.2 Qt 5.15.2 PyQt 5.15.2
    Platform: Linux-6.2.1-PRoot-Distro-aarch64-with-glibc2.31
    Flags: frz=False ao=False sv=2
    Add-ons, last update check: 2023-08-08 21:48:59

I note that the working version is using glibc2.36 and a flag of ao=true while the broken version is using glib2.31 and a flag of ao=false. I think the difference in glibc versions is explained by the botched Debian 12 upgrade I mentioned earlier, but nevertheless Anki was working in the old environment before and after the upgrade attempt. Does anyone know what the ao flag is and how I could set it to see if it fixes this?

ao=True just means you have add-ons active. My guess is the crashes are caused by something wrong with your Qt/PyQt install.

Hmm. I’m writing some notes here so I don’t forget the things I’ve tried. This doesn’t require a response, but help is always appreciated :slight_smile: .

The ~/pyenv is now identical as I copied it over with cp --preserve=all.

The system packages, python3-pyqt5.qtwebengine and python3-pyqt5.qtmultimedia, appear to be identical. Apt is broken so for each package I:

  1. Saved a list of files installed by the package:
    dpkg-query -L python3-pyqt5.qtwebengine >> files-python3-pyqt5.qtwebengine.txt
  2. Created a corresponding checksum file for the list of files:
    `xargs -a python3-pyqt5.qtwebengine.txt md5sum >> python3-pyqt5.qtwebengine.txt.md5
  3. Moved the checksum file to the old environment and checked that the files matched:
    md5sum --quiet --check python3-pyqt5.qtwebengine.txt.md5

Thus these packages are identical. Maybe a dependency is different and causing the crash?

On an ARM system your Qt libraries will be installed in system locations, and my guess is there’s a chance either they, or one of the libraries they depend on, differ between one of the two systems.

I use Anki Flatpak from Flathub in my debian installation. Works perfectly.

1 Like

On an ARM system your Qt libraries will be installed in system locations, and my guess is there’s a chance either they, or one of the libraries they depend on, differ between one of the two systems.

Can you give an example of a name of one of these libraries or location where I’d find them? I could then try comparing the libaries betweent the two environments

Edit: In another attempt, I ran a strace pyenv/bin/anki in both PRoots and noticed this difference in the logs:
The working PRoot is using /usr/lib/python3/dist-packages/ when the broken PRoot is using /usr/local/lib/python3/dist-packages/.

Perhaps you installed some packages globally outside of Debian’s system in the past. Maybe removing them will help.

I guess I have to give up and just use my working backup. My phone can afford the storage space. I looked into the flatpak install, but I don’t think it would work because ARM isn’t listed under supported architectures, though I haven’t tried it.

To summarize the problem and what I’ve tried: The segmentation fault happens when trying open my large collection, but does not occur on a small test collection. It occurs in fresh installs of Debian 11, Debian 12, Ubuntu, and Arch, all installed in a PRoot environment in Termux. It does not occur in my Debian 11 backup, but apt/dpkg is broken in this backup due to a botched upgrade.

I don’t think there’s many users out there using Anki in a PRoot on their phone. If there’s someone out there wanting to do it, I can provide my backup file. It’s 3.5GB compressed though

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