Skip to content
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

[Bug] delete deck crash with v16 schema #12007

Closed
4 tasks done
pavreh opened this issue Aug 12, 2022 · 13 comments · Fixed by #11849
Closed
4 tasks done

[Bug] delete deck crash with v16 schema #12007

pavreh opened this issue Aug 12, 2022 · 13 comments · Fixed by #11849
Milestone

Comments

@pavreh
Copy link

pavreh commented Aug 12, 2022

Reproduction Steps
  1. switch on v16 backend
  2. get a shared deck
  3. import
  4. wait if importing takes too long
  5. do a review, tap easy
  6. tap back
  7. delete the deck
Expected Result

The deck is deleted. It is possible to undo the deletion.

Actual Result

The deck is deleted but a crash occures. "Undo delete deck" is not available.

Tested with different shared decks. Crash report has been sent.

Debug info

AnkiDroid Version = 2.16alpha77

Android Version = 12

Manufacturer = samsung

Model = SM-A225F

Hardware = mt6769t

Webview User Agent = Mozilla/5.0 (Linux; Android 12; SM-A225F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/103.0.5060.129 Mobile Safari/537.36

ACRA UUID = 8811dfdf-46ff-4a51-bbea-195fe8c86a5f

Scheduler = std2

Crash Reports Enabled = true

DatabaseV2 Enabled = true

Research

Enter an [x] character to confirm the points below:

  • I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
  • I have checked the manual and the FAQ and could not find a solution to my issue
  • I have searched for similar existing issues here and on the user forum
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
@dae
Copy link
Contributor

dae commented Aug 12, 2022

I can't reproduce this. AD devs: can I get access to the crash reports?

@dae
Copy link
Contributor

dae commented Aug 12, 2022

Report says this is v2 scheduler, maybe you're using v3?

@dae
Copy link
Contributor

dae commented Aug 12, 2022

@BrayanDSO assuming it is a v3 issue, would it be easy to add a v3 toggle in advanced that is only visible when v16 is enabled, assuming no maintainers object?

@BrayanDSO
Copy link
Member

@BrayanDSO assuming it is a v3 issue, would it be easy to add a v3 toggle in advanced that is only visible when v16 is enabled, assuming no maintainers object?

Yes, the preferences part is somewhat simple. I'd have it disabled instead of invisible though.

Idk about what you may want to do with the logic of getting the sched version, so I'll just leave a patch of the preferences part:

Index: AnkiDroid/src/main/java/com/ichi2/anki/preferences/AdvancedSettingsFragment.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/AdvancedSettingsFragment.kt b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/AdvancedSettingsFragment.kt
--- a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/AdvancedSettingsFragment.kt	(revision 0cebb8acd1ca9a4404fe28fd2f2279ac0190c3a4)
+++ b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/AdvancedSettingsFragment.kt	(date 1660305411144)
@@ -112,6 +112,13 @@
             }
             requireActivity().packageManager.setComponentEnabledSetting(providerName, state, PackageManager.DONT_KILL_APP)
         }
+        // v3 scheduler
+        requirePreference<SwitchPreference>(R.string.enable_v3_sched_key).apply {
+            setOnPreferenceChangeListener { newValue ->
+                // TODO enable v3 sched
+            }
+        }
+
         // Use V16 backend
         requirePreference<SwitchPreference>(R.string.pref_rust_backend_key).apply {
             if (!BuildConfig.LEGACY_SCHEMA) {
Index: AnkiDroid/src/main/res/values/preferences.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values/preferences.xml b/AnkiDroid/src/main/res/values/preferences.xml
--- a/AnkiDroid/src/main/res/values/preferences.xml	(revision 0cebb8acd1ca9a4404fe28fd2f2279ac0190c3a4)
+++ b/AnkiDroid/src/main/res/values/preferences.xml	(date 1660305279142)
@@ -112,6 +112,7 @@
     <string name="anki_card_external_context_menu_key">anki_card_enable_external_context_menu</string>
     <string name="pref_reset_languages_key">resetLanguages</string>
     <string name="pref_backup_max_key">backupMax</string>
+    <string name="enable_v3_sched_key">v3sched</string>
     <!-- Advanced statistics -->
     <string name="pref_computation_precision_key">advanced_forecast_stats_compute_precision</string>
     <string name="pref_compute_n_days_key">advanced_forecast_stats_compute_n_days</string>
Index: AnkiDroid/src/main/res/values/10-preferences.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/values/10-preferences.xml b/AnkiDroid/src/main/res/values/10-preferences.xml
--- a/AnkiDroid/src/main/res/values/10-preferences.xml	(revision 0cebb8acd1ca9a4404fe28fd2f2279ac0190c3a4)
+++ b/AnkiDroid/src/main/res/values/10-preferences.xml	(date 1660305279134)
@@ -339,6 +339,7 @@
     <string name="use_rust_backend_title" maxLength="41">Use the new backend</string>
     <string name="use_rust_backend_summary">Enables newer Anki features, such as the v3 scheduler\nUNSTABLE. Do not use on a collection you care about. NOT reverted on app close</string>
     <string name="use_rust_backend_warning">There is a chance this could corrupt your installation completely, requiring app uninstall and deletion of the AnkiDroid folder, and has a chance of propagating corruption via sync to AnkiWeb.\n\nWe welcome the testing, but please make sure you have a valid non-AnkiWeb backup.</string>
+    <string name="enable_v3_sched_title" maxLength="41">Use the v3 scheduler</string>
 
     <!-- Developer options -->
     <string name="pref_cat_dev_options" maxLength="41">Developer options</string>
Index: AnkiDroid/src/main/res/xml/preferences_advanced.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/res/xml/preferences_advanced.xml b/AnkiDroid/src/main/res/xml/preferences_advanced.xml
--- a/AnkiDroid/src/main/res/xml/preferences_advanced.xml	(revision 0cebb8acd1ca9a4404fe28fd2f2279ac0190c3a4)
+++ b/AnkiDroid/src/main/res/xml/preferences_advanced.xml	(date 1660305257213)
@@ -154,5 +154,10 @@
                 android:title="@string/use_rust_backend_title"
                 android:summary="@string/use_rust_backend_summary"
                 android:defaultValue="false"/>
+            <SwitchPreference
+                android:key="@string/enable_v3_sched_key"
+                android:dependency="@string/pref_rust_backend_key"
+                android:title="@string/enable_v3_sched_title"
+                android:defaultValue="false"/>
         </PreferenceCategory>
 </PreferenceScreen>

@pavreh
Copy link
Author

pavreh commented Aug 12, 2022

It is the new backend but v2 Scheduler. I can see it in Anki after sync. I reinstalled the app and I am still able to reproduce.

@dae
Copy link
Contributor

dae commented Aug 12, 2022

Which shared deck are you downloading?

@pavreh
Copy link
Author

pavreh commented Aug 12, 2022

I downloaded e.g. "Fyzika 1 - Mechanika (Pomi)" and "Czech Sentences".

@mikehardy
Copy link
Member

mikehardy commented Aug 12, 2022

I got a request for the stack trace on this one, I fetched it, along with the device info key/value pairs and the logcat

device URL https://ankidroid.org/acra/app/1/installation/8811dfdf-46ff-4a51-bbea-195fe8c86a5f/report

Looking at the questions above, it appears we may want to extend the device info to report what scheduler is in use, and what schema is in use?

Version
5.7.0
Date
2 hours ago
Installation
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
Email
Comment
Delete a shared deck
Stacktrace (No mapping found)
java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$4.done(AsyncTask.java:415)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:920)
Caused by: com.ichi2.libanki.WrongId:  No card with id 1407318489198
	at com.ichi2.libanki.Card.load(Card.kt:25)
	at com.ichi2.libanki.Card.<init>(Card.kt:25)
	at com.ichi2.libanki.Collection.getCard(Unknown Source:2)
	at com.ichi2.libanki.Card$Cache.getCard(Card.kt:2)
	at com.ichi2.libanki.sched.CardQueue.removeFirstCard(Unknown Source:11)
	at com.ichi2.libanki.sched.SchedV2._getNewCard(SchedV2.java:2)
	at com.ichi2.libanki.sched.SchedV2._getCard(SchedV2.java:3)
	at com.ichi2.libanki.sched.SchedV2.getCard(SchedV2.java:4)
	at com.ichi2.anki.servicelayer.SchedulerService$GetCard$Companion.getCard(SchedulerService.kt:3)
	at com.ichi2.anki.servicelayer.SchedulerService$GetCard.execute(SchedulerService.kt:2)
	at com.ichi2.anki.servicelayer.SchedulerService$GetCard.execute(SchedulerService.kt:1)
	at com.ichi2.anki.servicelayer.AnkiTask.execute(AsyncLayer.kt:2)
	at com.ichi2.anki.servicelayer.AsyncLayerAdapterKt$asDelegate$1.task(AsyncLayerAdapter.kt:2)
	at com.ichi2.async.TaskDelegate.execTask(Unknown Source:10)
	at com.ichi2.async.CollectionTask.actualDoInBackground(CollectionTask.kt:14)
	at com.ichi2.async.CollectionTask.doInBackground(CollectionTask.kt:2)
	at com.ichi2.async.CollectionTask.doInBackground(CollectionTask.kt:1)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	... 4 more
Attachments
Details
ANDROID_VERSION
12
APP_VERSION_CODE
21600177
APP_VERSION_NAME
2.16alpha77
AVAILABLE_MEM_SIZE
89849516032
BRAND
samsung
BUILD
BOARD
a22
BOOTLOADER
A225FXXS3BVF6
BRAND
samsung
CPU_ABI
arm64-v8a
CPU_ABI2
DEVICE
a22
DISPLAY
SP1A.210812.016.A225FXXS3BVF6
FINGERPRINT
samsung/a22nseea/a22:12/SP1A.210812.016/A225FXXS3BVF6:user/release-keys
HARDWARE
mt6769t
HOST
VPDJR210
ID
SP1A.210812.016
IS_DEBUGGABLE
false
IS_EMULATOR
false
MANUFACTURER
samsung
MODEL
SM-A225F
ODM_SKU
hcesim
PERMISSIONS_REVIEW_REQUIRED
true
PRODUCT
a22nseea
RADIO
unknown
SERIAL
unknown
SKU
hcesim
SOC_MANUFACTURER
Mediatek
SOC_MODEL
MT6769V/CT
SUPPORTED_32_BIT_ABIS
0
armeabi-v7a
1
armeabi
SUPPORTED_64_BIT_ABIS
0
arm64-v8a
SUPPORTED_ABIS
0
arm64-v8a
1
armeabi-v7a
2
armeabi
TAGS
release-keys
TIME
1657526560000
TYPE
user
UNKNOWN
unknown
USER
dpi
VERSION
ACTIVE_CODENAMES
BASE_OS
samsung/a22nseea/a22:12/SP1A.210812.016/A225FXXU3BVF1:user/release-keys
CODENAME
REL
INCREMENTAL
A225FXXS3BVF6
MEDIA_PERFORMANCE_CLASS
0
PREVIEW_SDK_FINGERPRINT
REL
PREVIEW_SDK_INT
0
RELEASE
12
RELEASE_OR_CODENAME
12
SDK
31
SDK_INT
31
SECURITY_PATCH
2022-06-01
SEM_FIRST_SDK_INT
30
SEM_INT
3101
SEM_PLATFORM_INT
130100
BUILD_CONFIG
BUILD_TYPE
release
DEBUG
false
LIBRARY_PACKAGE_NAME
org.acra.dialog
VERSION_CODE
-1
VERSION_NAME
5.7.0
CRASH_CONFIGURATION
assetsSeq
4
colorMode
5
densityDpi
300
fontScale
1
fontWeightAdjustment
0
hardKeyboardHidden
HARDKEYBOARDHIDDEN_YES
keyboard
KEYBOARD_NOKEYS
keyboardHidden
KEYBOARDHIDDEN_NO
locale
en
mcc
230
mnc
3
navigation
NAVIGATION_NONAV
navigationHidden
NAVIGATIONHIDDEN_YES
orientation
ORIENTATION_PORTRAIT
screenHeightDp
774
screenLayout
SCREENLAYOUT_SIZE_NORMAL+SCREENLAYOUT_LONG_YES+SCREENLAYOUT_LAYOUTDIR_LTR+SCREENLAYOUT_ROUND_NO
screenWidthDp
384
semButtonShapeEnabled
0
semDesktopModeEnabled
-1
semDisplayDeviceType
-1
semMobileKeyboardCovered
-1
seq
26432
smallestScreenWidthDp
384
touchscreen
TOUCHSCREEN_FINGER
uiMode
UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_NO
userSetLocale
false
CUSTOM_DATA
WEBVIEW_VER_CODE
506012933
WEBVIEW_VER_NAME
103.0.5060.129
ENVIRONMENT
getDataDirectory
/data
getDataSystemDirectory
/data/system
getDownloadCacheDirectory
/data/cache
getExternalStorageDirectory
/storage/emulated/0
getExternalStorageState
mounted
getInternalMediaDirectories
[/system/media, /oem/media, /product/media, /omr/res, /data/overlays/media]
getLegacyExternalStorageDirectory
/sdcard
getLegacyExternalStorageObbDirectory
/sdcard/Android/obb
getOdmDirectory
/odm
getOemDirectory
/oem
getProductDirectory
/product
getProductServicesDirectory
/product_services
getRootDirectory
/system
getStorageDirectory
/storage
getSystemExtDirectory
/system_ext
getVendorDirectory
/vendor
isExternalStorageEmulated
true
isExternalStorageLegacy
true
isExternalStorageManager
false
isExternalStorageRemovable
false
FILE_PATH
/data/user/0/com.ichi2.anki.a/files
INSTALLATION_ID
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
IS_SILENT
false
LOGCAT
--------- beginning of main
08-12 13:08:00.162 I/AnkiDroid( 3936): Delete deck selected
08-12 13:08:00.238 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.updateSearchDecksIconVisibility(DeckPicker.kt:2)
08-12 13:08:00.239 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.240 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ select scm from col
08-12 13:08:00.240 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.240 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.241 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.241 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ select ls from col
08-12 13:08:00.241 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.241 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.242 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.onCreateOptionsMenu(DeckPicker.kt:18)
08-12 13:08:00.242 I/AnkiDroid( 3936): undo: UndoStatus(undo=Delete Deck, redo=null, lastStep=11), true
08-12 13:08:00.242 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.onCreateOptionsMenu(DeckPicker.kt:21)
08-12 13:08:00.277 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.AbstractFlashcardViewer$NextCardHandler.dealWithTimeBox(AbstractFlashcardViewer.kt:2)
08-12 13:08:00.294 I/AnkiDroid( 3936): Obtaining card
08-12 13:08:00.299 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.updateSearchDecksIconVisibility(DeckPicker.kt:2)
08-12 13:08:00.300 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.301 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ select scm from col
08-12 13:08:00.301 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.302 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.302 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.303 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ select ls from col
08-12 13:08:00.303 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.304 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.utils.SyncStatus$Companion.getSyncStatus(SyncStatus.kt:9)
08-12 13:08:00.305 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.onCreateOptionsMenu(DeckPicker.kt:18)
08-12 13:08:00.305 I/AnkiDroid( 3936): undo: UndoStatus(undo=Delete Deck, redo=null, lastStep=11), false
08-12 13:08:00.305 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.onCreateOptionsMenu(DeckPicker.kt:21)
08-12 13:08:00.309 I/AnkiDroid( 3936): Updating deck list UI
08-12 13:08:00.310 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.buildDeckList(DeckAdapter.kt:9)
08-12 13:08:00.311 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.buildDeckList(DeckAdapter.kt:9)
08-12 13:08:00.312 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.buildDeckList(DeckAdapter.kt:9)
08-12 13:08:00.314 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-12 13:08:00.315 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ select avg(case when type = 0 then case when ease > 1 then 1.0 else 0.0 end else null end) as newRate, avg(case when type = 0 then time else null end) as newTime, avg(case when type in (1, 3) then case when ease > 1 then 1.0 else 0.0 end else null end) as revRate, avg(case when type in (1, 3) then time else null end) as revTime, avg(case when type = 2 then case when ease > 1 then 1.0 else 0.0 end else null end) as relrnRate, avg(case when type = 2 then time else null end) as relrnTime from revlog where id > ?
08-12 13:08:00.316 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-12 13:08:00.318 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-12 13:08:00.318 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: kotlin.io.CloseableKt.closeFinally(Closeable.kt:1)
08-12 13:08:00.319 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-12 13:08:00.319 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ SELECT count() FROM cards
08-12 13:08:00.320 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-12 13:08:00.320 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-12 13:08:00.321 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:35)
08-12 13:08:00.322 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:35)
08-12 13:08:00.324 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:35)
08-12 13:08:00.327 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.findDeckPosition(DeckAdapter.kt:3)
08-12 13:08:00.328 W/AnkiDroid( 3936): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.updateSearchDecksIconVisibility(DeckPicker.kt:2)

@mikehardy
Copy link
Member

There were two crashes and they were slightly different, here is the one 1 day ago, previous was a couple hours ago

Version
5.7.0
Date
1 day ago
Installation
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
Email
Comment
Import apkg
Stacktrace (No mapping found)
java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$4.done(AsyncTask.java:415)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
	at java.util.concurrent.FutureTask.run(FutureTask.java:271)
	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:920)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'long com.ichi2.utils.JSONObject.getLong(java.lang.String)' on a null object reference
	at com.ichi2.libanki.Decks.childMap(Decks.java:10)
	at com.ichi2.libanki.sched.SchedV2.unburyCardsForDeck(SchedV2.java:3)
	at com.ichi2.libanki.sched.BaseSched.unburyCardsForDeck$default(BaseSched.kt:1)
	at com.ichi2.libanki.sched.BaseSched.unburyCards(BaseSched.kt:2)
	at com.ichi2.libanki.sched.i.run(Unknown Source:2)
	at com.ichi2.utils.SyncStatus$Companion.ignoreDatabaseModification(SyncStatus.kt:2)
	at com.ichi2.utils.SyncStatus.ignoreDatabaseModification(Unknown Source:2)
	at com.ichi2.libanki.sched.SchedV2._updateCutoff(SchedV2.java:11)
	at com.ichi2.libanki.sched.SchedV2.<init>(SchedV2.java:16)
	at com.ichi2.libanki.Collection._loadScheduler(Collection.kt:4)
	at com.ichi2.libanki.Collection.<init>(Collection.kt:18)
	at com.ichi2.libanki.Storage.collection(Storage.kt:3)
	at com.ichi2.libanki.Storage.collection$default(Unknown Source:16)
	at com.ichi2.libanki.importer.AnkiPackageImporter.run(AnkiPackageImporter.kt:27)
	at com.ichi2.async.CollectionTask$ImportAdd.task(CollectionTask.kt:8)
	at com.ichi2.async.CollectionTask$ImportAdd.task(CollectionTask.kt:1)
	at com.ichi2.async.TaskDelegate.execTask(Unknown Source:10)
	at com.ichi2.async.CollectionTask.actualDoInBackground(CollectionTask.kt:14)
	at com.ichi2.async.CollectionTask.doInBackground(CollectionTask.kt:2)
	at com.ichi2.async.CollectionTask.doInBackground(CollectionTask.kt:1)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	... 4 more
Attachments
Details
ANDROID_VERSION
12
APP_VERSION_CODE
21600176
APP_VERSION_NAME
2.16alpha76
AVAILABLE_MEM_SIZE
90765307904
BRAND
samsung
BUILD
BOARD
a22
BOOTLOADER
A225FXXS3BVF6
BRAND
samsung
CPU_ABI
arm64-v8a
CPU_ABI2
DEVICE
a22
DISPLAY
SP1A.210812.016.A225FXXS3BVF6
FINGERPRINT
samsung/a22nseea/a22:12/SP1A.210812.016/A225FXXS3BVF6:user/release-keys
HARDWARE
mt6769t
HOST
VPDJR210
ID
SP1A.210812.016
IS_DEBUGGABLE
false
IS_EMULATOR
false
MANUFACTURER
samsung
MODEL
SM-A225F
ODM_SKU
hcesim
PERMISSIONS_REVIEW_REQUIRED
true
PRODUCT
a22nseea
RADIO
unknown
SERIAL
unknown
SKU
hcesim
SOC_MANUFACTURER
Mediatek
SOC_MODEL
MT6769V/CT
SUPPORTED_32_BIT_ABIS
0
armeabi-v7a
1
armeabi
SUPPORTED_64_BIT_ABIS
0
arm64-v8a
SUPPORTED_ABIS
0
arm64-v8a
1
armeabi-v7a
2
armeabi
TAGS
release-keys
TIME
1657526560000
TYPE
user
UNKNOWN
unknown
USER
dpi
VERSION
ACTIVE_CODENAMES
BASE_OS
samsung/a22nseea/a22:12/SP1A.210812.016/A225FXXU3BVF1:user/release-keys
CODENAME
REL
INCREMENTAL
A225FXXS3BVF6
MEDIA_PERFORMANCE_CLASS
0
PREVIEW_SDK_FINGERPRINT
REL
PREVIEW_SDK_INT
0
RELEASE
12
RELEASE_OR_CODENAME
12
SDK
31
SDK_INT
31
SECURITY_PATCH
2022-06-01
SEM_FIRST_SDK_INT
30
SEM_INT
3101
SEM_PLATFORM_INT
130100
BUILD_CONFIG
BUILD_TYPE
release
DEBUG
false
LIBRARY_PACKAGE_NAME
org.acra.dialog
VERSION_CODE
-1
VERSION_NAME
5.7.0
CRASH_CONFIGURATION
assetsSeq
4
colorMode
5
densityDpi
300
fontScale
1
fontWeightAdjustment
0
hardKeyboardHidden
HARDKEYBOARDHIDDEN_YES
keyboard
KEYBOARD_NOKEYS
keyboardHidden
KEYBOARDHIDDEN_NO
locale
en
mcc
230
mnc
3
navigation
NAVIGATION_NONAV
navigationHidden
NAVIGATIONHIDDEN_YES
orientation
ORIENTATION_PORTRAIT
screenHeightDp
774
screenLayout
SCREENLAYOUT_SIZE_NORMAL+SCREENLAYOUT_LONG_YES+SCREENLAYOUT_LAYOUTDIR_LTR+SCREENLAYOUT_ROUND_NO
screenWidthDp
384
semButtonShapeEnabled
0
semDesktopModeEnabled
-1
semDisplayDeviceType
-1
semMobileKeyboardCovered
-1
seq
22027
smallestScreenWidthDp
384
touchscreen
TOUCHSCREEN_FINGER
uiMode
UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_NO
userSetLocale
false
CUSTOM_DATA
WEBVIEW_VER_CODE
506012933
WEBVIEW_VER_NAME
103.0.5060.129
ENVIRONMENT
getDataDirectory
/data
getDataSystemDirectory
/data/system
getDownloadCacheDirectory
/data/cache
getExternalStorageDirectory
/storage/emulated/0
getExternalStorageState
mounted
getInternalMediaDirectories
[/system/media, /oem/media, /product/media, /omr/res, /data/overlays/media]
getLegacyExternalStorageDirectory
/sdcard
getLegacyExternalStorageObbDirectory
/sdcard/Android/obb
getOdmDirectory
/odm
getOemDirectory
/oem
getProductDirectory
/product
getProductServicesDirectory
/product_services
getRootDirectory
/system
getStorageDirectory
/storage
getSystemExtDirectory
/system_ext
getVendorDirectory
/vendor
isExternalStorageEmulated
true
isExternalStorageLegacy
true
isExternalStorageManager
false
isExternalStorageRemovable
false
FILE_PATH
/data/user/0/com.ichi2.anki.a/files
INSTALLATION_ID
8811dfdf-46ff-4a51-bbea-195fe8c86a5f
IS_SILENT
false
LOGCAT
--------- beginning of main
08-10 16:06:53.095 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.servicelayer.DeckService.defaultDeckHasCards(Unknown Source:14)
08-10 16:06:53.095 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.servicelayer.DeckService.defaultDeckHasCards(Unknown Source:14)
08-10 16:06:53.096 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-10 16:06:53.096 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ select avg(case when type = 0 then case when ease > 1 then 1.0 else 0.0 end else null end) as newRate, avg(case when type = 0 then time else null end) as newTime, avg(case when type in (1, 3) then case when ease > 1 then 1.0 else 0.0 end else null end) as revRate, avg(case when type in (1, 3) then time else null end) as revTime, avg(case when type = 2 then case when ease > 1 then 1.0 else 0.0 end else null end) as relrnRate, avg(case when type = 2 then time else null end) as relrnTime from revlog where id > ?
08-10 16:06:53.097 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-10 16:06:53.097 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.widgets.DeckAdapter.getEta(DeckAdapter.kt:2)
08-10 16:06:53.097 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: kotlin.io.CloseableKt.closeFinally(Closeable.kt:1)
08-10 16:06:53.098 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-10 16:06:53.098 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ SELECT count() FROM cards
08-10 16:06:53.098 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-10 16:06:53.099 W/AnkiDroid( 4659): Backend$checkMainThreadOp/ Op on UI thread: com.ichi2.anki.DeckPicker.renderPage(DeckPicker.kt:24)
08-10 16:06:54.020 I/AnkiDroid( 4659): uncompress collection.anki2
08-10 16:06:54.177 I/AnkiDroid( 4659): uncompress media
08-10 16:06:54.213 I/AnkiDroid( 4659): (Re)opening Database: /storage/emulated/0/AnkiDroidA/tmpzip/collection.anki2
08-10 16:06:54.438 I/AnkiDroid( 4659): Opening Collection Log

@mikehardy
Copy link
Member

I'm about to be away from keyboard again but just a quick note that since this is a release build the line numbers don't match anything (they are shrunk during release build process). Apologies for that. It is probably possible to pull the release tag and re-run the release build and generate the de-obfuscation file if that's a barrier, but historically it's rare that the stack frame names aren't sufficient to reason out what happened

@pavreh
Copy link
Author

pavreh commented Aug 12, 2022

The first crash report commented "Delete a shared deck" is related to this issue. The second crash report commented "Import apkg" is related to #11845.

@dae
Copy link
Contributor

dae commented Aug 13, 2022

Thanks @pavreh, I've fixed the first issue, and can't seem to reproduce the second one - it perhaps could be something specific to your collection. Does 'check database' with the new schema enabled help?

@BrayanDSO thanks for that. I gave it a try and noticed a couple of problems:

  • it doesn't reflect the actual value in the collection, so it may appear to be off even if it was enabled via a different client and then synced. Might be worth returning to this later when prefs are migrated to col.config?
  • it can't be toggled when the schema is changed via local.properties

@Arthur-Milchior I left those comments open above in case you wanted to confirm they've been addressed - feel free to close them when you're ready.

dae added a commit to ankitects/Anki-Android that referenced this issue Aug 13, 2022
dae added a commit to ankitects/Anki-Android that referenced this issue Aug 13, 2022
@BrayanDSO
Copy link
Member

BrayanDSO commented Aug 13, 2022

BrayanDSO@b56f00b should fix those, but it has the issue of always re-enabling the v3 scheduler pref, either here on desktop (BrayanDSO@b56f00b#diff-476d84626da0890329ad2b072200ad9c053710d55539ab3bdd95187ef8c2a6adR126-R127).

Please take a look

dae added a commit to ankitects/Anki-Android that referenced this issue Aug 13, 2022
dae added a commit to ankitects/Anki-Android that referenced this issue Aug 15, 2022
@github-actions github-actions bot added this to the 2.16 release milestone Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants