appcenter-sdk-android
appcenter-sdk-android copied to clipboard
Appcenter does not save crash logs
Description
I have migrated my android app from HockeyApp to AppCenter. during my tests, I noticed that it is not saving the crash logs, once a crash occurs. There is an exception showing that the log file is not even being created:
E/AppCenterCrashes: Error writing error log to file
java.io.FileNotFoundException: error/16d493ff-05d9-4131-8d0e-36a0acff7dc9.json: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:452)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
at java.io.FileWriter.<init>(FileWriter.java:42)
at com.microsoft.appcenter.utils.storage.FileManager.write(FileManager.java:140)
at com.microsoft.appcenter.crashes.Crashes.saveErrorLogFiles(Crashes.java:1070)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1059)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1023)
at com.microsoft.appcenter.crashes.UncaughtExceptionHandler.uncaughtException(UncaughtExceptionHandler.java:20)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
Hi! I see, that you opened a conversation in Intercom, so I answered you there.
Hey @hprandi
It looks like the base part of the path is missing somehow. It's probably related to https://github.com/microsoft/appcenter-sdk-android/blob/aef71abd8164d769eba6408f2a53fcee45fa07cb/sdk/appcenter/src/main/java/com/microsoft/appcenter/Constants.java#L107-L108
Could you please share the full verbose log? It would be very helpful for our investigation. Thanks
Hi, we haven't heard from you in a while so I'm closing this issue. Please reopen/comment if it still the case for you.
@russelarms @MatkovIvan I'm actually seeing the same error happening.
2022-03-16 12:20:38.181 24397-24397/com.myapp E/AppCenterCrashes: Error writing error log to file
java.io.FileNotFoundException: /data/user/0/com.myapp/files/error/282ac6bd-2212-4508-bac2-355d1f55ba94.json: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:492)
at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
at java.io.FileWriter.<init>(FileWriter.java:90)
at com.microsoft.appcenter.utils.storage.FileManager.write(FileManager.java:140)
at com.microsoft.appcenter.crashes.Crashes.saveErrorLogFiles(Crashes.java:1160)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1147)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1110)
at com.microsoft.appcenter.crashes.UncaughtExceptionHandler.uncaughtException(UncaughtExceptionHandler.java:20)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542)
at libcore.io.IoBridge.open(IoBridge.java:478)
at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
at java.io.FileWriter.<init>(FileWriter.java:90)
at com.microsoft.appcenter.utils.storage.FileManager.write(FileManager.java:140)
at com.microsoft.appcenter.crashes.Crashes.saveErrorLogFiles(Crashes.java:1160)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1147)
at com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:1110)
at com.microsoft.appcenter.crashes.UncaughtExceptionHandler.uncaughtException(UncaughtExceptionHandler.java:20)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
This happened with 4.4.1, but updating to 4.4.2 didn't change anything.
Hi @Bombo , thank you for reaching out to us!
Please share verbose logs. You can enable it using AppCenter.setLogLevel(Log.VERBOSE) before your call to AppCenter.start(...).
@DmitriyKirakosyan Sure. Here you go: appcenter_logs.txt
Also note that we don't have this issue on all devices/users. There are the ones where crash logs still come through. Obviously it's hard to say what the ratio is, though. :)
@Bombo , thank you for the logs!
Can you also tell more about the devices the issue can be reproduced on? Android version, manufacturer, specs, etc? You also mentioned that it may depend on users. Does it mean that it may work for some users and fail for others while running on the same device? If so, do you find any suspicious difference between such users?
Yeah, that user comment might have been misplaced. Right now I don't see any change with different users on the same device, but I just don't have any idea about the possible cause, so I think that's why I added "users" above. ;)
Right now I can only say that I got this issue on a Google Pixel 2XL (Android 11), Google Pixel 6 Pro (Android 12), and Samsung Galaxy A51 (Android 11), but I do get valid crash reports on AppCenter for some of those devices.
The only device I know where this is not occuring is a Redmi Note 8 pro. But at this point I'm afraid we have a somewhat limited sample size, I'm afraid.
I'm also on my last day before 2 months time off, basically heading out the door. So I'm sorry for not being more helpful on this one.
@Bombo, Thank you for the details and have a good days off!
If anyone else faces this issue, please let us know. Any additional information would be appreciated. It would be extremely helpful if anyone would able to reproduce this issue on a demo application and share it with us.
As we do not have plans to fix this bug in the next year, I'm closing the issue. However, contributions are still welcome.