apps-android-commons: Upload semi-failure for image without EXIF, reproducible 100%

Steps to reproduce

  1. Install Scrambled EXIF app
  2. Choose a picture worth uploading to Commons, share it to Scrambled EXIF, then share the result to Commons
  3. Enter a caption, press Next
  4. A popup No location found appears, press Skip
  5. A popup Problems found in image appears, press Upload
  6. Select a correct depiction, category, license, and send

Expected behaviour

Upload should succeed

Actual behaviour

There are two thumbnails, one uploaded and one failed, as seen below (I uploaded only once “Restaurant […]” picture):

adb

Android version

8

Commons app version

master

Would you like to work on the issue?

Prefer not

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Commits related to this issue

Most upvoted comments

According to the Logcat, a SecurityException is raised when the picture is not uploaded by a process whose uid=10100 (the UID of the preinstalled photo app). I think the issue arises because the common apps deny permission when uploading photos directly from apps other than the system photo app, such as ExifEarser and Scrambled EXIF.

2022-05-22 13:52:27.661 6035-6140/fr.free.nrw.commons E/UploadWorker: java.lang.SecurityException: Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ProcessRecord{2b135d1 6035:fr.free.nrw.commons/u0a136} (pid=6035, uid=10136) that is not exported from UID 10100
        at android.os.Parcel.createException(Parcel.java:1950)
        at android.os.Parcel.readException(Parcel.java:1918)
        at android.os.Parcel.readException(Parcel.java:1868)
        at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:4185)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:6019)
        at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2592)
        at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1829)
        at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1443)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1296)
        at android.content.ContentResolver.openInputStream(ContentResolver.java:1016)
        at fr.free.nrw.commons.upload.worker.UploadWorker.saveIntoUploadedStatus(UploadWorker.kt:421)
        at fr.free.nrw.commons.upload.worker.UploadWorker.saveCompletedContribution(UploadWorker.kt:413)
        at fr.free.nrw.commons.upload.worker.UploadWorker.uploadContribution(UploadWorker.kt:313)
        at fr.free.nrw.commons.upload.worker.UploadWorker.access$uploadContribution(UploadWorker.kt:48)
        at fr.free.nrw.commons.upload.worker.UploadWorker$doWork$2$invokeSuspend$$inlined$map$1$2.emit(Collect.kt:148)
        at kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$3.collect(SafeCollector.common.kt:115)
        at fr.free.nrw.commons.upload.worker.UploadWorker$doWork$2$invokeSuspend$$inlined$map$1.collect(SafeCollector.common.kt:114)
        at kotlinx.coroutines.flow.FlowKt__CollectKt.collect(Collect.kt:30)
        at kotlinx.coroutines.flow.FlowKt.collect(Unknown Source:1)
        at fr.free.nrw.commons.upload.worker.UploadWorker$doWork$2.invokeSuspend(UploadWorker.kt:218)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ActivityManagerService.getContentProviderImpl(ActivityManagerService.java:12276)
        at com.android.server.am.ActivityManagerService.getContentProvider(ActivityManagerService.java:12683)
        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:358)
        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3297)
        at android.os.Binder.execTransact(Binder.java:731)
2022-05-22 13:52:27.661 6035-6140/fr.free.nrw.commons E/UploadWorker: Upload from stash failed for contribution : mouse.jpg