"invalid Zip archive: Invalid zip header" error when using a self hosted sync server

I am trying to use a self hosted version of anki for syncing. I tried following the instructions for the python installation on the Anki Manual Page

I can log in using user:pass successfully from ankidroid as well as anki desktop. For the desktop, I have tried using both the flatpak version as well as installing the latest from install.sh as instructed in the Installation Page

When there are no cards on the local system, it says the sync completed successfully. When I use anki web to get my cards, then log in to the old version to upload it there, I get “AnkiWeb encountered a problem. Please try again in a few minutes.” on the desktop.

When I see the logs on the server, I see

2025-04-20T05:39:14.498174Z  INFO request{uri="/sync/upload" ip="192.168.0.109" uid="user" client="25.02.1,fa1d6eae,linux" session="dr2Kep"}: finished elap_ms=26 httpstatus=200
2025-04-20T05:39:15.075050Z  INFO request{uri="/msync/uploadChanges" ip="192.168.0.109" uid="user" client="25.02.1,fa1d6eae,linux" session="dseSg"}: context="unzip files" source=Some(SyncError { source: SyncError { info: "invalid Zip archive: Invalid zip header", kind: Other } }) httpstatus=400
2025-04-20T05:39:15.075120Z  INFO request{uri="/msync/uploadChanges" ip="192.168.0.109" uid="user" client="25.02.1,fa1d6eae,linux" session="dseSg"}: finished elap_ms=0 httpstatus=400
2025-04-20T05:43:08.907842Z  INFO request{uri="/sync/meta" ip="192.168.0.109" uid="user" client="25.02.1,fa1d6eae,linux" session="MJSnA"}: finished elap_ms=1 httpstatus=200

The issue persists when I use older versions of the anki python package. I have tried 25.2.1, 25.2, 24.11, 24.6.3
The main issue seems to be with the zip archive on this log line:

2025-04-20T05:39:15.075050Z INFO request{uri=“/msync/uploadChanges” ip=“192.168.0.109” uid=“user” client=“25.02.1,fa1d6eae,linux” session=“dseSg”}: context=“unzip files” source=Some(SyncError { source: SyncError { info: “invalid Zip archive: Invalid zip header”, kind: Other } }) httpstatus=400

I have looked through everywhere on github issues, as well as on this forum and have found no mentions of this bug. What is happening here and how do I fix it?

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