Sync error "Could not load PEM file

Hi all,
Since upgrading to Ubuntu 22 I can no longer sync my decks. I installed the latest version (2.1.64) of anki. Anki itself is working perfectly. But as soon as I try to log in with my credentials, it crashes. It has nothing to do with my credentials, because I also tried it with random entries, which resulted in the same error messages.
Hopefully you can help me with that error.


Anki starting…
Initial setup…
Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
Preparing to run…
Qt warning: Could not connect “org.freedesktop.IBus” to globalEngineChanged(QString)
Starting main loop…
mpv not found, reverting to mplayer
thread ‘’ panicked at ‘called Result::unwrap() on an Err value: reqwest::Error { kind: Builder, source: Custom { kind: InvalidData, error: “Could not load PEM file "/usr/lib/ssl/certs/ca-certificates.crt"” } }’, rslib/src/sync/http_client/mod.rs:44:60
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Caught exception:
Traceback (most recent call last):
File “aqt.taskman”, line 122, in _on_closures_pending
File “aqt.taskman”, line 71, in
File “aqt.taskman”, line 90, in wrapped_done
File “aqt.sync”, line 269, in on_future_done
File “concurrent.futures._base”, line 439, in result
File “concurrent.futures._base”, line 391, in __get_result
File “concurrent.futures.thread”, line 58, in run
File “aqt.sync”, line 287, in
File “anki.collection”, line 1247, in sync_login
File “anki._backend_generated”, line 763, in sync_login
File “anki._backend”, line 150, in _run_command
pyo3_runtime.PanicException: called Result::unwrap() on an Err value: reqwest::Error { kind: Builder, source: Custom { kind: InvalidData, error: “Could not load PEM file "/usr/lib/ssl/certs/ca-certificates.crt"” } }

Error in atexit._run_exitfuncs:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):


The path/file /usr/lib/ssl/certs/ca-certificates.crt is present

Seems as if it’s corrupt. Maybe ‘sudo update-ca-certificates’ will help?

Hi, unfortunately this didn’t help…

I tried with a newly-installed and updated Ubuntu 22.04 and syncing worked fine for me, so I still suspect this is an issue with that file. shasum -a 256 /usr/lib/ssl/certs/ca-certificates.crt yields a signature starting with 13a2c4 for me - how about you? If you get the same signature, check if you have any env vars with SSL in the name. If you get a different signature, maybe someone on your distro forums has some ideas on how to fix it.

I have the following (different) signature: a2eb36a380…
Is it a good idea to delete this file and run the command ‘sudo update-ca-certificates’ to get a new one?

I don’t know the specifics of how the file is managed - I suggest asking your distro people for help.

Ok, thank you very much for your help. At least, it is not a problem related to Anki.

Fingers crossed. If you manage to resolve the issue, please let us know.

I added the problem to the Ubuntu forum. But unfortunately, nobody answers…

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