-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync error : database corrupted #47
Comments
exact same issue here. Also one desktop computer (Ubuntu 16.04) and one phone (Android app running in the Android runtime of Sailfish OS) |
@slohse: The Ubuntu repositories seem to be stuck at Anki version 2.0.32. Did you install Anki from the package repositories? If so, does the error occur if you manually download and install the current version (2.0.36) from http://ankisrs.net/? |
same issue, always be asked to make full sync even just studied several cards. |
@cdpm yes I used the version from the Ubuntu repositories, but installing version 2.0.36 from ankisrc sadly didn't change anything. |
same problem with two instances of Anki: "Anki 2.0.36 on Windows8.1" and "AnkiDroid 2.6.0 on Android 6" |
I experienced similar problems after installation and after some analysis looks like there are at least two different issues in the current code base that might result in this behavior:
Both of these issues should be solved with the attached patches (NOTE: the patches are both for anki-sync-server code and anki library that it depends on). However, it seems plausible there might be yet other issues there that I've not yet discovered. |
I have also found the usn difference between client and server at sanityCheck2 at anki/sync.py when conflict happens. The patch from @ndl works perfectly, thanks. |
ndl's patch doesn't seem to work on Windows (but seems to work on Linux,MacOS,Android) Before modifying my Raspi I decided to test ndl's patch of AnkiSyncServer (from pip, version 2.0.6) in a virtual machine running Debian8. -Sync from my Debian8 Host with Anki 2.0.31: works -Sync from another Linux virtual machine with Anki 2.0.36: works -Sync from macOS 10.11 with Anki 2.0.36: works -AnkiDroid 2.7: After starting the sync it synced for a couple of minutes. Then it stopped with an error message. I tried a couple of times and prevented my device from sleeping. Finally it went through in about 10 minutes (I have about 10 000 cards and 5000 media files/700mb). Now it seems to work. The regular sync runs quite quickly. -Sync from Windows 10 Pro "Anniversary Update" with Anki 2.0.36 fails: Before applying ndl's patch it worked as good/as bad as from other systems. I tested two different windows machines. Now on both machines I get the same error message:
I ran the AnkiSyncServer in debug mode: For the IP of Windows Machine I only found these entries:
I ran a test with another deck with half the cards/media one day later. On my Windows machine I get the same error message. The output of AnkiSyncServer looks like this:
I also tested with Vista and Anki 2.0.32 - in Windows I got the same error message. |
Hello, I'm sorry if this sounds like a dumb question, but how do I apply @ndl's patches? I'm running Ubuntu 16.04 and having the same problem requiring a full sync each time. Thanks! |
whelp, here's what I tried, I went into my AnkiServer directory and modified the sync_app.py and collection.py files. I also went into the anki-bundled/anki directory to change the collection.py and media.py files. I did this by adding lines where there was a '+' and removing lines where there was a '-' indicated in @ndl's txt files. I restarted the server and tried to sync Anki, but got the following error: Is there something else I need to do? |
What you did sounds right in principle, but you should probably have a look at the program |
Alright, I did the following
Then I downloaded the patches to my /home/ubuntu/ directory cd /usr/local/lib/python2.7/dist-packages/AnkiServer cd /usr/local/anki-bundled/anki
Same error: Reversing the patches allows Anki to sync, but leaving me where I started with the database corrupted problem. Anything else I can try? Thanks for the help, everyone |
Alright, I think I got it working, I left out one more directory: cd /usr/share/anki/anki Restarted the server and Anki, it's syncing now locally, and works with my Ankidroid. I'll do some further checks when I get back home. |
It looks like I was able to replicate kiuuik's error Using AnkiServer (with 2.0.36 anki-bundled) with the patch. Using Android Anki 2.8 everything works fine - downloading, uploading, syncing. Using desktop Anki 2.0.36, here is the error scenario: Clean server, start client, upload collection to server, it only uploads the cards, no media, but no error. Now, without stopping the server, one way downloads, and new profile downloads and syncing works fine for a while. The problem seems to happen only when stopping and restarting the server or waiting just a few minutes. Once that happens, syncing works fine, but on one way downloads and new profile downloads, I get the "DatabaseError: file is encrypted or is not a database" error on the client. Only if I do a one way upload again can I start one way downloading again - until the server is restarted. Error seems to happen when the client can't verify the integrity of the server's file - from line 689 in /anki/sync.py
|
Hi, first, thank you for your work.
I manage to get anki-sync-server to run on my personnal server, I use it with 2 devices (1 one computer, and one phone). But each time that I do make a change on a device or on the other I get this error telling me that my decks can't be merged !
![anki_screenshot_1](https://cloud.githubusercontent.com/assets/6316176/18234422/372b5614-7305-11e6-8900-4a6983c479ac.png)
This is a pain, can you do something ?
Thanks again
The text was updated successfully, but these errors were encountered: