vmiklos/plees-tracker

Export to File or Import File crashes when exporting to / import from nextcloud folder

Closed this issue · 8 comments

foss- commented

Android 13.1
Plees Tracker 7.6.0 (46)

Reproducer steps

  1. … > Export to File
  2. select nextcloud (not reproducible when exporting to internal storage)

Actual result
Plees Tracker closes and a zero bytes csv file or no file at all is created.

Expected behavior
Backup csv file with data should be created.

There is a similar issue when trying to import the csv file from nextcloud. Importing from internal storage works but importing from nextcloud crashes Plees Tracker.

logcat.txt
08-09 16:00:10.370  1254  1254 V StorageManagerService: Package hu.vmiklos.plees_tracker does not have legacy storage
08-09 16:02:24.530  1254  1667 D AppWidgetServiceImpl: Unable to load widget provider info from xml for ComponentInfo{hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.ToggleWidget}
08-09 16:02:24.530  1254  1667 D AppWidgetServiceImpl: Unable to load widget provider info from xml for ComponentInfo{hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.ToggleWidget}
08-09 16:02:31.120  1254  4306 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=hu.vmiklos.plees_tracker/.MainActivity bnds=[56,1828][188,1960]} from uid 10216
08-09 16:02:31.210  1254  4306 D CoreBackPreview: Window{193fe13 u0 Splash Screen hu.vmiklos.plees_tracker}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@7bdb205, mPriority=0}
08-09 16:02:31.248  1254  1800 I ActivityManager: Start proc 5558:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:02:31.248  1254  1800 I ActivityManager: Start proc 5558:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:02:31.248  1254  1800 I ActivityManager: Start proc 5558:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:02:31.653  1254  1267 D CoreBackPreview: Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@ded89f2, mPriority=0}
08-09 16:02:31.653  1254  1267 D CoreBackPreview: Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@ded89f2, mPriority=0}
08-09 16:02:32.160  1254  2827 D CoreBackPreview: Window{193fe13 u0 Splash Screen hu.vmiklos.plees_tracker EXITING}: Setting back callback null
08-09 16:02:41.997  1254  4691 W NotificationService: Toast already killed. pkg=hu.vmiklos.plees_tracker token=android.os.BinderProxy@13cb5e8
08-09 16:11:33.999  1254  2424 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=hu.vmiklos.plees_tracker/.MainActivity bnds=[56,1828][188,1960]} from uid 10216
08-09 16:11:35.921  1254  2430 I ActivityTaskManager: START u0 {flg=0x10000000 cmp=hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity (has extras)} from uid 10281
08-09 16:11:35.980  1254  2430 D CoreBackPreview: Window{d8075bd u0 hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@ffa1303, mPriority=0}
08-09 16:11:38.872  1254  2426 D CoreBackPreview: Window{d8075bd u0 hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity}: Setting back callback null
08-09 16:11:43.065  1254  2430 I ActivityTaskManager: START u0 {flg=0x10000000 cmp=hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity (has extras)} from uid 10281
08-09 16:11:43.119  1254  2418 D CoreBackPreview: Window{5d47dbe u0 hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@9e3f56c, mPriority=0}
08-09 16:15:02.898  3132  3132 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1902 onStartInput(EditorInfo{EditorInfo{packageName=hu.vmiklos.plees_tracker, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, f
08-09 16:15:03.362  1254 10253 D CoreBackPreview: Window{5d47dbe u0 hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity}: Setting back callback null
08-09 16:15:03.362  1254 10253 W InputManager-JNI: Input channel object '5d47dbe hu.vmiklos.plees_tracker/com.mikepenz.aboutlibraries.ui.LibsActivity (client)' was disposed without first being removed with the input manager!
08-09 16:15:04.650  1254 10253 I InputDispatcher: Channel [Gesture Monitor] swipe-up (server) is stealing touch from [64c619a hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (server), [Gesture Monitor] edge-swipe (server)]
08-09 16:15:04.650  1254 10253 I InputDispatcher: Channel [Gesture Monitor] swipe-up (server) is stealing touch from [64c619a hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (server), [Gesture Monitor] edge-swipe (server)]
08-09 16:15:31.009  1254  2418 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=hu.vmiklos.plees_tracker/.MainActivity bnds=[56,1828][188,1960]} from uid 10216
08-09 16:15:31.099  3132  3132 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1902 onStartInput(EditorInfo{EditorInfo{packageName=hu.vmiklos.plees_tracker, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, f
08-09 16:16:13.689  5997  6158 D OwnCloudClient #0: REQUEST PUT /remote.php/dav/files/stof/plees-tracker.csv
08-09 16:16:15.413  5558  5558 E AndroidRuntime: Process: hu.vmiklos.plees_tracker, PID: 5558
08-09 16:16:15.413  5558  5558 E AndroidRuntime: java.io.FileNotFoundException: Failed to open document for writing plees-tracker.csv
08-09 16:16:15.413  5558  5558 E AndroidRuntime: 	at hu.vmiklos.plees_tracker.DataModel.exportDataToFile(DataModel.kt:290)
08-09 16:16:15.413  5558  5558 E AndroidRuntime: 	at hu.vmiklos.plees_tracker.DataModel$exportDataToFile$1.invokeSuspend(Unknown Source:18)
08-09 16:16:15.418  1254 10253 W ActivityTaskManager:   Force finishing activity hu.vmiklos.plees_tracker/.MainActivity
08-09 16:16:15.456  1254  4316 I WindowManager: WIN DEATH: Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:16:15.456  1254  4316 I WindowManager: WIN DEATH: Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:16:15.457  1254  4316 W InputManager-JNI: Input channel object '64c619a hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (client)' was disposed without first being removed with the input manager!
08-09 16:16:15.457  1254  4316 W InputManager-JNI: Input channel object '64c619a hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (client)' was disposed without first being removed with the input manager!
08-09 16:16:15.459  1254  4438 I ActivityManager: Process hu.vmiklos.plees_tracker (pid 5558) has died: fg  TOP 
08-09 16:16:15.490  1254  1671 W WindowManager: Failed to deliver inset state change to w=Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:16:15.490  1254  1671 W WindowManager: Failed to deliver inset state change to w=Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:16:15.889  1254  1671 W WindowManager: Exception thrown during dispatchAppVisibility Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:16:15.889  1254  1671 W WindowManager: Exception thrown during dispatchAppVisibility Window{64c619a u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:16:15.920  1254  1670 W ActivityTaskManager: Activity top resumed state loss timeout for ActivityRecord{b0c217f u0 hu.vmiklos.plees_tracker/.MainActivity} t-1 f}}
08-09 16:20:53.830  1254  5167 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=hu.vmiklos.plees_tracker/.MainActivity bnds=[56,1653][188,1785]} from uid 10216
08-09 16:20:53.866  1254  5167 D CoreBackPreview: Window{79e4743 u0 Splash Screen hu.vmiklos.plees_tracker}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@90b9ef9, mPriority=0}
08-09 16:20:53.868  1254  1800 I ActivityManager: Start proc 11254:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:20:53.868  1254  1800 I ActivityManager: Start proc 11254:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:20:53.868  1254  1800 I ActivityManager: Start proc 11254:hu.vmiklos.plees_tracker/u0a281 for next-top-activity {hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:20:53.885 11254 11254 E s.plees_tracker: Not starting debugger since process cannot load the jdwp agent.
08-09 16:20:53.915 11254 11254 V GraphicsEnvironment: ANGLE Developer option for 'hu.vmiklos.plees_tracker' set to: 'default'
08-09 16:20:53.915 11254 11254 V GraphicsEnvironment: ANGLE GameManagerService for hu.vmiklos.plees_tracker: false
08-09 16:20:54.020  1254  3375 D CoreBackPreview: Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@d228ba1, mPriority=0}
08-09 16:20:54.020  1254  3375 D CoreBackPreview: Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@d228ba1, mPriority=0}
08-09 16:20:54.092  1254  1667 I ActivityTaskManager: Displayed hu.vmiklos.plees_tracker/.MainActivity: +255ms
08-09 16:20:54.148  3132  3132 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1902 onStartInput(EditorInfo{EditorInfo{packageName=hu.vmiklos.plees_tracker, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, f
08-09 16:20:54.455  1254  3375 D CoreBackPreview: Window{79e4743 u0 Splash Screen hu.vmiklos.plees_tracker EXITING}: Setting back callback null
08-09 16:20:54.456  1254  3375 W InputManager-JNI: Input channel object '79e4743 Splash Screen hu.vmiklos.plees_tracker (client)' was disposed without first being removed with the input manager!
08-09 16:20:56.907  3132  3132 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1902 onStartInput(EditorInfo{EditorInfo{packageName=hu.vmiklos.plees_tracker, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, f
08-09 16:20:58.627  5997  6158 D OwnCloudClient #0: REQUEST PUT /remote.php/dav/files/stof/plees-tracker.csv
08-09 16:20:59.822 11254 11316 D ProfileInstaller: Skipping profile installation for hu.vmiklos.plees_tracker
08-09 16:20:59.889 11254 11254 E AndroidRuntime: Process: hu.vmiklos.plees_tracker, PID: 11254
08-09 16:20:59.889 11254 11254 E AndroidRuntime: java.io.FileNotFoundException: Failed to open document for writing plees-tracker.csv
08-09 16:20:59.889 11254 11254 E AndroidRuntime: 	at hu.vmiklos.plees_tracker.DataModel.exportDataToFile(DataModel.kt:290)
08-09 16:20:59.889 11254 11254 E AndroidRuntime: 	at hu.vmiklos.plees_tracker.DataModel$exportDataToFile$1.invokeSuspend(Unknown Source:18)
08-09 16:20:59.893  1254  4314 W ActivityTaskManager:   Force finishing activity hu.vmiklos.plees_tracker/.MainActivity
08-09 16:20:59.935  1254 10196 I WindowManager: WIN DEATH: Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:20:59.935  1254 10196 I WindowManager: WIN DEATH: Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity}
08-09 16:20:59.935  1254 10196 W InputManager-JNI: Input channel object '11f8ffa hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (client)' was disposed without first being removed with the input manager!
08-09 16:20:59.935  1254 10196 W InputManager-JNI: Input channel object '11f8ffa hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity (client)' was disposed without first being removed with the input manager!
08-09 16:20:59.941  1254  3375 I ActivityManager: Process hu.vmiklos.plees_tracker (pid 11254) has died: prcp TOP 
08-09 16:20:59.972  1254  1671 W WindowManager: Failed to deliver inset state change to w=Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:20:59.972  1254  1671 W WindowManager: Failed to deliver inset state change to w=Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:21:00.370  1254  1671 W WindowManager: Exception thrown during dispatchAppVisibility Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:21:00.370  1254  1671 W WindowManager: Exception thrown during dispatchAppVisibility Window{11f8ffa u0 hu.vmiklos.plees_tracker/hu.vmiklos.plees_tracker.MainActivity EXITING}
08-09 16:21:00.395  1254  1670 W ActivityTaskManager: Activity top resumed state loss timeout for ActivityRecord{bf5d7a7 u0 hu.vmiklos.plees_tracker/.MainActivity} t-1 f}}

Can you run 'adb logcat' to see what is the backtrace of the crash? The setup that is known to work is to export to a local folder and then let Nextcloud sync that folder up to your server, but ideally direct export to Nextcloud should work as well.

foss- commented

You've got mail.

I guess this is the interesting part of the logcat, which doesn't look sensitive at all:

FATAL EXCEPTION: main
Process: hu.vmiklos.plees_tracker, PID: 5558
java.io.FileNotFoundException: Failed to open document for writing plees-tracker.csv
        at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
        at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:705)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1860)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:1562)
        at android.content.ContentResolver.openOutputStream(ContentResolver.java:1537)
        at hu.vmiklos.plees_tracker.DataModel.exportDataToFile(DataModel.kt:290)
        at hu.vmiklos.plees_tracker.DataModel$exportDataToFile$1.invokeSuspend(Unknown Source:18)

Note how openOutputStream() normally either returns a null or an output stream, but here is it throws an exception.

Export to nextcloud works for me (and also import back), so there are two problems here:

  1. The storage access framework (SAF) fails for you when this app talks to nextcloud, but it's unclear why. Apart from "failed to open", no details are given.

Some ideas:

  • if there is an other open source app that does work for you to write on nextcloud, that would be interesting, we could compare how plees tracker uses SAF vs the working app. Perhaps there is some new requirement (these are growing like mushrooms as you update Android) that we're missing on our side.

  • do you have something custom like a manually installed ROM or something? I'm trying to reproduce with a vendor-provided ROM on a Pixel device, though this really should just work everywhere.

  1. If there is a failure, then that failure is not reported. This is something I can reproduce by an artificially injected exception.

I suggest let's focus on 2) here and let's have a separate, follow-up issue for 1). I hope that makes sense, to not have half-fixed issues lingering around.

Labeling as confirmed for the "toast reports success even on failure" part.

foss- commented

Indeed custom ROM, this is ArrowOS on importing side and PixelOS on exporting side.

K9-Mail export to Nextcloud worked fine. Logcat sent via email.

foss- commented

plees-tracker 7.6.1 (47)
ArrowOS 13.1
Export to Nextcloud worked fine. Thanks so much for addressing export to Nextcloud.

Oh, glad to hear. Could you please re-test if #407 is still a problem? Thanks.

foss- commented

Follow-up: there still is a problem, when a file already exists: #414
Otherwise export to Nextcloud works fine now.