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]: Commons app does not keep in internal log crash-related messages #5722

Open
mnalis opened this issue May 11, 2024 · 0 comments
Open

Comments

@mnalis
Copy link
Contributor

mnalis commented May 11, 2024

Summary

When app crashes, information about the crash is not available in Settings / Send log file but it looks like nothing bad happened at all. Instead, crash log should be present in log file kept by the Commons app, so it can be accesses at later time.

Steps to reproduce

  1. provoke an app crash (e.g. using [Bug]: Crash when adding and then removing media details #5721)
  2. dismiss Oops. Something went wrong dialog (for example, because you cannot attend to it at the time)
  3. start app again and go to Settings / Send log file

Expected behaviour

The internal app log (i.e. Settings / Send log file) should contain errors that caused app to crash (crash trace log).

Actual behaviour

The crash errors are not available in the in-app log viewer/sender.

I had to use external LogCat app LogFox (with complex setup involving USB cable and adb to give it permissions) in order to extract the crash log.

Device name

Samsung Galaxy S23+

Android version

Android 14 (OneUI 6.1)

Commons app version

5.0.1~af028cbdd (latest F-droid)

Device logs

This is present in in-app log viewer, after restarting Commons app and going to Settings / Send log file, with no information about error/crash:

2024-05-11 22:11:53,763     [DEBUG] [file-logging-thread-1] [ContributionsFragment] : Number of notifications is 1
2024-05-11 22:12:14,685     [DEBUG] [file-logging-thread-1] [MainActivity] : Intent { dat=content://com.android.providers.media.documents/... flg=0x43 }
2024-05-11 22:12:14,758     [DEBUG] [file-logging-thread-1] [NearbyController] : Loading attractions near lat/lng: (45.7941583,15.91794643)
2024-05-11 22:12:14,759     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.3
2024-05-11 22:12:14,760     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:14,767     [DEBUG] [file-logging-thread-1] [NearbyPlaces] : 0 results at radius: 0.300000
2024-05-11 22:12:14,770     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.6
2024-05-11 22:12:14,770     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:14,778     [DEBUG] [file-logging-thread-1] [NearbyPlaces] : 3 results at radius: 0.600000
2024-05-11 22:12:14,779     [DEBUG] [file-logging-thread-1] [NearbyController] : Sorting places by distance...
2024-05-11 22:12:14,790     [DEBUG] [file-logging-thread-1] [NearbyNotificationCardView] : Update nearby card notification content
2024-05-11 22:12:14,810     [DEBUG] [file-logging-thread-1] [UploadActivity] : Received intent Intent { act=internalImageUploads cmp=fr.free.nrw.commons/.upload.UploadActivity (has extras) } with action internalImageUploads
2024-05-11 22:12:14,810     [INFO ] [file-logging-thread-1] [UploadActivity] : Received multiple upload 1
2024-05-11 22:12:14,840     [DEBUG] [file-logging-thread-1] [UploadModel] : File created date is 1715283554308
2024-05-11 22:12:14,841     [DEBUG] [file-logging-thread-1] [FileMetadataUtils] : Retuning tags for pref:Serial Numbers
2024-05-11 22:12:14,841     [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: BodySerialNumber
2024-05-11 22:12:14,841     [DEBUG] [file-logging-thread-1] [FileProcessor] : Checking for tag: LensSerialNumber
2024-05-11 22:12:14,857     [DEBUG] [file-logging-thread-1] [FileProcessor] : Calling GPSExtractor
2024-05-11 22:12:14,861     [DEBUG] [file-logging-thread-1] [ImageCoordinates] : EXIF data has location info
2024-05-11 22:12:14,862     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.1
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [CategoryApi] : URL: https://commons.wikimedia.org/w/api.php?action=query&prop=categories%7Ccoordinates%7Cpageprops&format=json&clshow=%21hidden&coprop=type%7Cname%7Cdim%7Ccountry%7Cregion%7Cglobe&codistancefrompoint=45.80105195833333%7C15.989942808333332&generator=geosearch&ggscoord=45.80105195833333%7C15.989942808333332&ggsradius=10000&ggslimit=10&ggsnamespace=6&ggsprop=type%7Cname%7Cdim%7Ccountry%7Cregion%7Cglobe&ggsprimary=all&formatversion=2
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Current image quality is -2
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Checking the validity of image
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Checking for duplicate image /data/user/0/fr.free.nrw.commons/cache/CommonsContributions/20356eb4-5e39-4804-b8d8-aa80a92e68c6.jpg
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Checking for image geolocation /data/user/0/fr.free.nrw.commons/cache/CommonsContributions/20356eb4-5e39-4804-b8d8-aa80a92e68c6.jpg
2024-05-11 22:12:14,863     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Checking for dark image /data/user/0/fr.free.nrw.commons/cache/CommonsContributions/20356eb4-5e39-4804-b8d8-aa80a92e68c6.jpg
2024-05-11 22:12:14,872     [INFO ] [file-logging-thread-1] [FileUtils] : File SHA1: 4cf98f3c70ac2e572db6ef344a8c771512e0b5b6
2024-05-11 22:12:14,888     [DEBUG] [file-logging-thread-1] [MediaLicenseFragment] : Position: 4 Attribution-ShareAlike 4.0
2024-05-11 22:12:15,027     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.2
2024-05-11 22:12:15,029     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:15,085     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.1
2024-05-11 22:12:15,087     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:15,094     [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:null
2024-05-11 22:12:15,094     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:15,135     [DEBUG] [file-logging-thread-1] [ImageUtils] : Checking image darkness took 270 ms.
2024-05-11 22:12:15,137     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : Result for duplicate image false
2024-05-11 22:12:15,137     [DEBUG] [file-logging-thread-1] [ImageProcessingService] : duplicate: 0, geo: 0, dark: 0fbmd:0exif:0
2024-05-11 22:12:15,160     [DEBUG] [file-logging-thread-1] [ContributionsFragment] : Number of notifications is 1
2024-05-11 22:12:15,261     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.3
2024-05-11 22:12:15,261     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,406     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,407     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,407     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,407     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,407     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,407     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,408     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,408     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,408     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,408     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,409     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,413     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:15,443     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.4
2024-05-11 22:12:15,444     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:15,671     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.5
2024-05-11 22:12:15,672     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:16,199     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,200     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,200     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,201     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,201     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,201     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,202     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,202     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,202     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,203     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,203     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,204     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,204     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,205     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,205     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,205     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,206     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,206     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,206     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,207     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,207     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,207     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,207     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,208     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,208     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,208     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,208     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,209     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,209     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,209     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,209     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,209     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:16,210     [DEBUG] [file-logging-thread-1] [CategoriesModel] : Previous year: 2023
2024-05-11 22:12:18,586     [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:null
2024-05-11 22:12:18,586     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:20,135     [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:null
2024-05-11 22:12:20,135     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:20,905     [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:null
2024-05-11 22:12:20,905     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:21,729     [INFO ] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : descItemEditText:null
2024-05-11 22:12:21,729     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:22,492     [DEBUG] [file-logging-thread-1] [UploadMediaDetailAdapter$ViewHolder] : UploadMediaDetail is UploadMediaDetail(languageCode=null, descriptionText=, captionText=)
2024-05-11 22:12:43,537     [DEBUG] [file-logging-thread-1] [MainActivity] : Resuming 0 uploads...
2024-05-11 22:12:43,571     [DEBUG] [file-logging-thread-1] [NearbyController] : Loading attractions near lat/lng: (45.7941583,15.91794643)
2024-05-11 22:12:43,581     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.3
2024-05-11 22:12:43,581     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:43,612     [DEBUG] [file-logging-thread-1] [NearbyPlaces] : 0 results at radius: 0.300000
2024-05-11 22:12:43,613     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : Fetching nearby items at radius 0.6
2024-05-11 22:12:43,613     [DEBUG] [file-logging-thread-1] [OkHttpJsonApiClient] : CUSTOM_SPARQLfalse
2024-05-11 22:12:43,623     [DEBUG] [file-logging-thread-1] [NearbyPlaces] : 3 results at radius: 0.600000
2024-05-11 22:12:43,624     [DEBUG] [file-logging-thread-1] [NearbyController] : Sorting places by distance...
2024-05-11 22:12:43,682     [DEBUG] [file-logging-thread-1] [NearbyNotificationCardView] : Update nearby card notification content
2024-05-11 22:12:44,034     [DEBUG] [file-logging-thread-1] [ContributionsFragment] : Number of notifications is 1

This was captured by Crash log in external LogCat app LogFox for Commons / Java * May 11, 2024 22:12:26 (note that nothing is present in the in-app log around that time 22:12:26!) :

FATAL EXCEPTION: main
Process: fr.free.nrw.commons, PID: 15984
java.lang.IndexOutOfBoundsException: Index 5 out of bounds for length 5
	at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.util.Objects.checkIndex(Objects.java:359)
	at java.util.ArrayList.get(ArrayList.java:434)
	at fr.free.nrw.commons.upload.UploadMediaDetailAdapter.removeDescription(UploadMediaDetailAdapter.java:195)
	at fr.free.nrw.commons.upload.UploadMediaDetailAdapter$ViewHolder.lambda$bind$5(UploadMediaDetailAdapter.java:300)
	at fr.free.nrw.commons.upload.UploadMediaDetailAdapter$ViewHolder.$r8$lambda$icSYp6LLQKJERqNSGIAA-LSzeUk(UploadMediaDetailAdapter.java:0)
	at fr.free.nrw.commons.upload.UploadMediaDetailAdapter$ViewHolder$$ExternalSyntheticLambda5.onClick(R8$$SyntheticClass:0)
	at android.view.View.performClick(View.java:8047)
	at android.view.View.performClickInternal(View.java:8024)
	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
	at android.view.View$PerformClick.run(View.java:31890)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:8919)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Screen-shots

No response

Would you like to work on the issue?

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@mnalis @sivaraam and others