-
Notifications
You must be signed in to change notification settings - Fork 578
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
App crashing due to IllegalStateException #1339
Comments
I found a few problems with this issue:
|
Questions
BackgroundIf the initialization of Firebase (i.e. instance of The latest version of the Instance ID SDK depends on the new Firebase Installations SDK which is a change that might cause issues like this. (@ankitaj224 : for visibility) |
This stack trace is the one we got from Sentry
Also, if it helps we are using below mentioned firebase component with version: |
We have the exact same issue and it all started after we upgraded to:
from |
I have the same crash outburst. It started this week. I've updated:
Downgraded today, will see if this going to fix situation. I create custom Firebase instance with code that looks something like this:
But Firebase Performance uses default Firebase instance.
|
@asfdfdfd did downgrading solved this bug for you? |
We started to experience the same crash after updating the following dependencies:
|
First of all: A downgrade to the old version of the SDKs, particularly a version of We are trying to identify the problem. We believe that the underlying Is anybody able to reproduce this issue locally and can share with us steps to reproduce it? |
We are also not able to reproduce this locally but we have some extra information, 97% of crashes happen in background. So I am not even sure that users get any crash dialog at all. |
For us, also around 85%+ crashes are reported in background |
Thanks for the information, @kozaxinan , @sudsingh438 ! Q1) Are your applications actually crashing (or is there a background thread crashing, but the application continues to run)? Q2) How many crashes per app usage are there? If you write "97% of crashes" and "85%+ crashes" are you referring to 97%/85% of these IllegalStateException crashes or of all your app crashes? And (repeating Q1) by "crash" do you mean that the application is actually stopping? Q3) Are the crashes happening randomly for end-users or repeatedly happening for the same end-user (e.g. crash-looping)? Q4) If you are willing to share your Application ID or Project ID (which is non-secret information about your application), we would be able to look into our logs to see if the request patterns from your application to Firebase look healthy. |
@andirayo |
@andirayo thank you for looking into this. Hopefully this information is helpful: Q1) I can't tell for sure but just like @MattSkala said the thread that is crashing does seem like a background thread. The trace is identical to the one in the issue description. Based on our logs it appears that some of the crashes might be occurring right after a push notification is received, but not all of them display that. Furthermore, we see the number of crashes increase significantly around the time that our daily push notifications are sent. However, this usually correlates with a rise in traffic anyway, so it's hard to say for sure that pushes are the cause. Q2) For us the crash is affecting close to 1% of our total users. So while not super common, still high enough to cause serious concern (we'll be rolling back until there is a fix). Q3) So far we have seen 128 crashes across 108 users. So they seem to be mostly unique, with a little bit of overlap. Q4) I will follow up with my team and get back to you. |
@MattSkala, @ygnessin : @MattSkala : I looked into our server logs for the requests regarding Firebase identifiers from your application and can see exclusively successful requests. |
we had just released a new version of the app with these new versions when we started seeing this crash: we were already using we have decided to downgrade |
same exact stacktrace as what the author posted
|
@maxkohne : Thank you so much! |
internal: b/151480886 |
UpdateWe identified that the IllegalStateException is thrown in We currently believe that some form of race condition and/or deadlock causes this issue. We assume that the race condition occurs when multiple Firebase services require a client identifier (a.k.a. FID / Instance ID) at the same time, possibly in different threads or even different processes. BackgroundFirebaseInstanceId is an infrastructure service that is used by various Firebase services like Messaging (FCM), Google Analytics, and Performance Monitoring (FirePerf). Next stepsTo fix this issue, we need to be able to reproduce the issue locally. At this point, we believe that an incoming push notification wakes up, i.e. triggers processes in an application that is running in background. QuestionsGenerally: Any information to achieve reproducing this crash would be highly appreciated! Q5) Could you please share your Gradle Android dependency tree with us: Q6) Do you happen to have access to a full Android bugreport (including errors and logs from all threads)? |
@andirayo Thanks for the update Q5) Our dependency tree obtained from |
@andirayo Please find the dependency list and stacktrace of one of the issue |
@andirayo Q1) Not sure, we have crash report in firebase but not it looks like crash happens when notification received. FirebaseMessagingService is running at the moment of report. Q2) 387 crashes for 370 reports. This 50 times more than 2nd most occurring crash. 98% percent of 387 reports happened in background. I am not sure but probably firebase messaging service fails to continue after this report. Q3) Random users. 387 crashes for 370 reports Q4) AppId : 1:208472424340:android:a243f98a00873753 Q5) Firebase dependencies :
Q6) Stacktrace from firebase for all thread : https://0bin.net/paste/XYQs-BXx0WRDEe+g#F662Og7LOng22wN2W+Ob7UrBPg+5vOamqked4eRCex0 |
@MattSkala , @sudsingh438 : @kozaxinan : Thanks a lot for the information. This is very helpful as it confirms our current assumptions. I also checked all client-server requests for the given AppId. Except for 1 request all ended successfully and thus I don't think server communication is the cause for this. If possible, could you please resent the link to your stack trace as the link above does not seem to work for me. |
@andirayo I updated the link. |
@kozaxinan : Thank you for the updated link! @MattSkala , @sudsingh438, @kozaxinan, and @ALL : We would appreciate if you find the time to share more stack traces, given that the actual call stacks of the main thread seem to differ between cases, and also the call stacks of |
@emanashraf : If possible, can you please share context with us: |
--stack track ->https://0bin.net/paste/dCy-Q1r3exnQQk-z#LkY9TJO+11gfUbEI+96SWDmqvq8sQCAJWnFQcfUOLFm --it happened in 20.1.3 to 14 users, and 1 user to 20.1.4 --I don't know when it's happening but occurrence is 100% background -- implementation 'com.google.firebase:firebase-messaging:20.1.4' is there anything i should do differently with this information? |
@emanashraf :
The stacktrace seems to have been recorded by an instance running Where did you get the information from that the |
@andirayo |
@emanashraf : |
So, What was the problem and What's the solution? |
@dcampogiani , @MattSkala , @ahinchman1 : |
@andirayo |
@emanashraf : |
After using v20.1.4 it seems that problem is resolved in our end until now. We have 50k++ average users and we didn't get any issue reported after having this version. Also will update this thread if I get any. |
Not sure if my problem relates to this specific issue, but cross-posting my message to the Firebase-Talk group here: https://groups.google.com/forum/#!topic/firebase-talk/ShiZ2nLLVxU To summarize, I found that |
@pablobaxter : The exception for this issue happen when |
@bluetoothfx : Thank you for reporting that the change (#1355) has fixed the issue for you! @ALL: |
I've been working through any scenario as to why the |
@pablobaxter : |
@andirayo Hey. There isn't any crash on our app too; after upgrading to v20.1.4. |
@adiamartya : Thank you so much for confirming! :) |
We still see an issue with v20.1.5. Here is the stack trace:
|
@hetang is it the full stack trace? If not would you mind sharing full stack trace. Thanks :) |
This is what I see in firebase crash reporting. We are not able to produce this locally and not able to see a full stack trace. |
@hetang : I am not sure why Crashlytics shows the incorrect version of |
I am closing this issue as successfully fixed since we had reports of |
Hi @andirayo, I'm still seeing this in 20.1.5:
Are you certain it was fixed in that version? Are we hitting the same weird issue as @hetang where iid isn't resolving to a newer version (androidDependencies definitely shows 20.1.5)? |
@andirayo do you have any update here? This is currently by far the largest open crash cluster in our app and it sounds like we're not alone. I'm happy to provide any additional details that might help track this down. Thank you! |
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Crashes are being reported on play console with below stack trace:
java.lang.IllegalStateException:
at com.google.firebase.iid.FirebaseInstanceId.zzl (FirebaseInstanceId.java:75)
at com.google.firebase.iid.FirebaseInstanceId.getId (FirebaseInstanceId.java:49)
at com.google.firebase.perf.internal.zzf.zzbu (zzf.java:181)
at com.google.firebase.perf.internal.zzf.zzbt (zzf.java:44)
at com.google.firebase.perf.internal.zzf.zzc (zzf.java:195)
at com.google.firebase.perf.internal.zze.run (zze.java:2)
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:764)
Steps to reproduce:
We are not able to reproduce it locally.
The text was updated successfully, but these errors were encountered: