dsnopek/anki-sync-server

Anki Droid request deleted files and fails with downloadFiles()

ninja33 opened this issue · 2 comments

@Akendo I saw the issue #45 you raised for media sync. also noticed @cdpm provided a fix #46 for it.
I got same problem as you mentioned in comment, deleted files from anki PC, then trying to sync by using ankidroid, the console says file missing.

seems it is still trying to download those media files which was already deleted.

any ideas? thanks.

INFO:root:CollectionThread[E:\ankiserver\collections\ninja33\collection.anki2]:Running downloadFiles(*[], **{})
ERROR:root:CollectionThread[E:\ankiserver\collections\ninja33\collection.anki2]: Unable to downloadFiles(*[], **{}): [Error 2] : u'E:\\ankiserver\\collections\\ninja33\\collection.media\\oxford-001700da-22a4a425-6ef26aaa-d6bad639-8f7b2b58.mp3'
Traceback (most recent call last):
  File "e:\python27\lib\site-packages\ankiserver-2.0.6-py2.7.egg\AnkiServer\threading.py", line 95, in _run
    ret = self.wrapper.execute(func, args, kw, return_queue)
  File "e:\python27\lib\site-packages\ankiserver-2.0.6-py2.7.egg\AnkiServer\collection.py", line 58, in execute
    ret = func(*args, **kw)
  File "e:\python27\lib\site-packages\ankiserver-2.0.6-py2.7.egg\AnkiServer\apps\sync_app.py", line 655, in run_func
    res = handler_method(**keyword_args)
  File "e:\python27\lib\site-packages\ankiserver-2.0.6-py2.7.egg\AnkiServer\apps\sync_app.py", line 248, in downloadFiles
    z.write(os.path.join(self.col.media.dir(), fname), str(cnt))
  File "e:\python27\lib\zipfile.py", line 1123, in write
    st = os.stat(filename)
WindowsError: [Error 2] : u'E:\\ankiserver\\collections\\ninja33\\collection.media\\oxford-001700da-22a4a425-6ef26aaa-d6bad639-8f7b2b58.mp3'

seems it's ankidroid problem listed in this issue: Bug report about media sync

This problem should be fixed by ankidroid/Anki-Android@082360c

for more detail, please check ankidroid/Anki-Android#4521