🐞 Anki in sync server mode fails to perform full sync on Windows

Steps to reproduce:

  • Start Anki in sync server mode;
  • Connect AnkiDroid to it, do a full AnkiDroid → server sync;
  • Connect Anki to it, choose the full server → Anki sync.
  • Observe the error:
$ "C:\Program Files\Anki2.1.53\anki.exe" --syncserver
Anki starting...
Initial setup...
Sync server listening on http://0.0.0.0:8080/sync/
Replace 0.0.0.0 with your machine's IP address (perhaps 192.168.56.1)
For more info, see https://github.com/ankitects/anki/blob/master/docs/syncserver.md
1656378930 127.0.0.1 sync/meta
1656378932 127.0.0.1 sync/download
Exception while serving /sync/download
Traceback (most recent call last):
  File "waitress.channel", line 426, in service
  File "waitress.task", line 168, in service
  File "waitress.task", line 456, in execute
  File "werkzeug.wsgi", line 462, in __next__
  File "werkzeug.wrappers.response", line 50, in _iter_encoded
  File "anki.syncserver", line 97, in stream_reply
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\user\\AppData\\Local\\Temp\\.tmp9Jxfhm'

Anki ⁨2.1.53 (96bacf79)⁩, Python 3.9.7 Qt 6.3.0 PyQt 6.3.0, Windows 10 21H2

If you’re confident you’ve found a bug, you’re welcome to directly report it on the issue tracker. But I do not use Windows as a daily driver, so a PR with a fix would be even more appreciated. :slight_smile:

1 Like

Should I use the uh “Developer Tasks” issue type? I’m not sure if this is a Windows issue exactly, at the moment I can’t test with Linux. By the way, AnkiDroid also fails to fetch the database; it says 400 but this time there’s no error on the server side. I would look into the issue myself but at the moment I just can’t afford to build Anki :pensive:

1 Like