It looks like when there are cards with a too high due value (I had stuff with due > 1.500.000.000, no idea how it came to be in the first place, despite the fact I've been using anki{,droid} for years and have maybe 100-200k cards total it's still several orders of magnitude more), ankidroid refuses to sync changes, and states that the database is corrupt.
It's been happening to me even after full syncs, as well as after a reinstall and removal of the AnkiDroid folder, with just the sync parameters set, so not related to configuration IÂ think.
The issue vanished at the time I used reposition on anki on all is:new cards that were not filtered, and then forced a full sync. As “Check Database” on anki had raised the “too big due values”, I assume that's likely the reason why ankidroid failed to sync.
I'm on the current f-droid version, which appears to be 2.9.1.
(Sorry for the tone as well as for not following the template, it's late and I have an exam tomorrow -- hopefully all the information needed is here, otherwise please feel free to close!)
Anyway, thank you as always for ankidroid, it's along with anki one of the best pieces of software I'm using, I think!
Cheers to you, and if someone is around paris someday, IÂ really have to buy y'all a drink or something!
Nevermind. Looks like there's something else.
I have just:
Well, I'm just going to review without rescheduling on ankidroid until tomorrow, and will attempt to work more with you to attempt to debug that issue later on. If there's anything I can do to help (eg. provide the full deck in private message to someone, as it contains vocabulary I don't own the copyright of), feel free to tell me what and how!
Hey @Ekleog this may be related to your previous PR, check this issue out https://github.com/ankidroid/Anki-Android/issues/5666 - but the triage there was inconclusive. There does appear to be something going on, but we're just not sure what yet?
Hey @mikehardy, thank you for your answer! I'm not sure about a relationship with the PR I sent through as, as far as I understood the code, it was supposed to touch only the displayed number -- but then, IÂ totally might have been wrong.
As an additional data point: if I try to upload from ankidroid when it's giving me the local|remote, it freezes for a while on “Checking file before upload...”, then eventually fails without further error message (though I've just left the phone unattended for 30 minutes, so maybe there was a transient error message I couldn't read).
Also, I've heard of a friend who also from time to time has an issue with similar symptoms, and after a few days it self-resolves -- not sure at all whether that's related, though, nor whether there may not have been another reason for that failure, for they're not particularly proficient with computers. The “it self-resolves” part of it would make me guess it might be linked with an error on the server side, but it can also be a red herring, and the fix can also come from doing additional reviews, maybe.
As I'm at a loss about how to debug this further, having done basically no android app development yet (apart from said PR, which I did “blindly”), maybe I could send you my .colpkg by email or similar, so that you could try to reproduce the issue in a proper android dev setup, and thus debug it more easily than through me? :)
Huh? I had re-attempted the “upload” choice while writing this message, and this time it did succeed in uploading, just after I clicked “send”. I have literally no idea what's happening, sorry…
So what happened is (all from ankidroid):
Oh by the way, having adb logcat while I press the sync button gives that output:
[...]
01-26 17:34:13.944 7283 7283 I AnkiDroid: DeckPicker:: Sync button pressed
01-26 17:34:13.983 7283 8561 I AnkiDroid: openCollection: /sdcard/AnkiDroid/collection.anki2
01-26 17:34:13.986 4062 4062 D SurfaceFlinger: duplicate layer name: changing com.ichi2.anki/com.ichi2.anki.DeckPicker to com.ichi2.anki/com.ichi2.anki.DeckPicker#1
01-26 17:34:13.996 7283 7311 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
01-26 17:34:14.008 7283 8561 I AnkiDroid: Sync - starting sync
01-26 17:34:14.254 7283 8561 I AnkiDroid: Sync: getting meta data from server
01-26 17:34:14.255 7283 8561 I AnkiDroid: Sync: building local meta data
01-26 17:34:14.255 7283 8561 I AnkiDroid: Sync: full sync necessary - returning
01-26 17:34:14.256 7283 8561 I AnkiDroid: Collection closed
[...]
So, as far as I can read, nothing of interest here, unfortunately.
Having succeeded in the full sync, I've just checked on anki that I could download from ankiweb and then sync properly, and it worked without a hitch, and “Check Database” returns nothing, so I guess the issue is not just in ankidroid's internal database -- though I guess removal of the ankidroid folder + reinstallation also had verified that issue, it's still a second confirmation that it appears to be dependent only on the state of the collection.
01-26 17:34:14.254 7283 8561 I AnkiDroid: Sync: getting meta data from server
01-26 17:34:14.255 7283 8561 I AnkiDroid: Sync: building local meta data
01-26 17:34:14.255 7283 8561 I AnkiDroid: Sync: full sync necessary - returning
Whatever is happening between line two and line three here, where AnkiDroid determines a full sync is necessary, is the vital information. Being a bit lazy and knowing that brute force does in the end solve things I would log statements all over the place in that code path, documenting the full logical journey and the internal state in place during it, to watch what's happening then it should :crossed_fingers: be obvious?
@mikehardy Do you know of a good crash course on how to compile ankidroid from source and load it onto the phone? Never having done any real android development, IÂ have no idea how to do it yet.
Should be this: https://github.com/ankidroid/Anki-Android/wiki/Development-Guide
Looks like these days the bug is blinking, sometimes happening and sometimes not, depending on how many cards I review.
Unfortunately, as you can see from the delay between my answers, I don't have much time right now, but I've saved a .colpkg from the time it was completely broken, and will try to investigate that when IÂ can find some time, if no one beats me to it and asks me for the .colpkg!
Hello đź‘‹, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like _still searching for solutions_ and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Oh, I forgot to close this: at some point a few months ago the changelog had a mention of a sync bug being fixed, and since then I haven't had the issue, so let's assume the issue is solved and close :)
Most helpful comment
Oh, I forgot to close this: at some point a few months ago the changelog had a mention of a sync bug being fixed, and since then I haven't had the issue, so let's assume the issue is solved and close :)