firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.25k stars 571 forks source link

Bug: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA ... #2233

Open AndroidDeveloperLB opened 3 years ago

AndroidDeveloperLB commented 3 years ago

Got 9 crashes from a single user who uses the app, and all because of the same exception of the "firebase.installations.remote.FirebaseInstallationServiceClient" class. There is no trace of my classes in the logs, so it can't be from the app itself.

[READ] Step 1: Are you in the right place?

Was told by Firebase support to reach here, so I think I am:

...It looks like you’ve observed an exception from your Crashlytics report that’s pointing to "firebase.installations.remote.FirebaseInstallationServiceClient" class.

For SDK related issues and concerns, you could file it directly through the GitHub issues repository (firebase-android-sdk) by providing the detailed steps on how you reproduce this issue along with the necessary details of your application, so that our engineers would be able to assist you regarding this matter and you could have a public visibility on the progression of this issue. ...

[REQUIRED] Step 2: Describe your environment

It's a Crashlitics report of actual users.

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

No idea. The only clues are what I got on Crashlytics: https://console.firebase.google.com/u/0/project/app-manager-cdf2c/crashlytics/app/android:com.lb.app_manager/issues/d8fd2edef6b0b0ab333bd39b7ee1286d?time=last-seven-days&versions=5.27%20(427)&sessionEventKey=5FC66393004400010F73F908875BFCD1_1479758566450258935

The crash starts with:

Fatal Exception: java.lang.SecurityException: Permission denied (missing INTERNET permission?)

And of course the app does have Internet permission.

More information:

crash info.zip

What happened? How can we make the problem occur? Crash on user's side. No idea how he got it.

Relevant Code:

Since there is no log that contains even a single class of the app, I have no code to share. Compared to other users, this is the first time I got it, and only from a single user, so it's very rare. The app is this one: https://play.google.com/store/apps/details?id=com.lb.app_manager&hl=en

google-oss-bot commented 3 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

yccheok commented 2 years ago

I am getting 100+ crashes from 1 user with the following firebase libraries

//
// Use com.google.firebase:firebase-bom:28.0.1
//
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'

May I know, have you found a solution?

argzdev commented 2 years ago

Hi @yccheok, may I ask a few questions for us to narrow down the issue.

  1. Is it the same issue android.system.GaiException: android_getaddrinfo failed: EAI_NODATA?
  2. Did your users experience this issue after updating a version of Firebase? Could you share us the stable version before experiencing this issue?
  3. Are you able to reproduce the issue?
  4. Could you share any error logs (please remove any Personally identifiable information if present)?
  5. Do you have steps to reproduce the issue?

If you could provide us an MCVE, that'll greatly help us in our investigation. Also could you try using the latest version on our Firebase products to see if that resolves the issue. Thanks!

yccheok commented 2 years ago

Hi @argzdev

  1. Same android.system.GaiException: android_getaddrinfo failed: EAI_NODATA

  2. Yes. I have checked the passed 90 days. This is the 1st case, impacted 1 user with total 161 crash. Here is the information regarding the user

Brand:LGE
Model:LG-H930DS
Orientation: Portrait
RAM free: 1.39 GB
Disk free: 83.46 GB
Operating system Version:Android 12
Orientation: Portrait
Rooted:No

In this new release, here is the change I have done

Here's the Firebase related SDK before migration (Without this type crash experience)

implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.google.firebase:firebase-config:19.2.0'
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'

Here's the current version of Firebase related SDK (With this type crash experience) I am using

//
// Use com.google.firebase:firebase-bom:28.0.1
//
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
  1. Sorry. I can't reproduce the problem
  2. Here's the crash log
Fatal Exception: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
       at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:150)
       at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
       at java.net.InetAddress.getAllByName(InetAddress.java:1152)
       at com.android.okhttp.Dns$1.lookup(Dns.java:41)
       at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
       at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
       at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
       at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
       at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeRequestBodyToOutputStream(FirebaseInstallationServiceClient.java:239)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.h(FirebaseInstallationServiceClient.java:32)
       at com.google.firebase.installations.FirebaseInstallations.d(FirebaseInstallations.java:89)
       at com.google.firebase.installations.FirebaseInstallations.b(FirebaseInstallations.java:61)
       at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
       at com.google.firebase.installations.-$$Lambda$FirebaseInstallations$SC1awUtshakVcZWKWh8TCfIkd4g.run(-.java:4)
       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:920)
Caused by android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
       at libcore.io.Linux.android_getaddrinfo(Linux.java)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:136)
       at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:221)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:136)
       at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
       at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
       at java.net.InetAddress.getAllByName(InetAddress.java:1152)
       at com.android.okhttp.Dns$1.lookup(Dns.java:41)
       at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
       at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
       at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
       at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
       at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeRequestBodyToOutputStream(FirebaseInstallationServiceClient.java:239)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.h(FirebaseInstallationServiceClient.java:32)
       at com.google.firebase.installations.FirebaseInstallations.d(FirebaseInstallations.java:89)
       at com.google.firebase.installations.FirebaseInstallations.b(FirebaseInstallations.java:61)
       at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
       at com.google.firebase.installations.-$$Lambda$FirebaseInstallations$SC1awUtshakVcZWKWh8TCfIkd4g.run(-.java:4)
       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:920)
Caused by android.system.ErrnoException: android_getaddrinfo failed: EPERM (Operation not permitted)
       at libcore.io.Linux.android_getaddrinfo(Linux.java)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:136)
       at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:221)
       at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:136)
       at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
       at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
       at java.net.InetAddress.getAllByName(InetAddress.java:1152)
       at com.android.okhttp.Dns$1.lookup(Dns.java:41)
       at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
       at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
       at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
       at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
       at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
       at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
       at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
       at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
       at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
       at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
       at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.writeRequestBodyToOutputStream(FirebaseInstallationServiceClient.java:239)
       at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.h(FirebaseInstallationServiceClient.java:32)
       at com.google.firebase.installations.FirebaseInstallations.d(FirebaseInstallations.java:89)
       at com.google.firebase.installations.FirebaseInstallations.b(FirebaseInstallations.java:61)
       at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
       at com.google.firebase.installations.-$$Lambda$FirebaseInstallations$SC1awUtshakVcZWKWh8TCfIkd4g.run(-.java:4)
       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:920)

I hope I can export the entire log in zip file but I not not sure how. Here's the screenshot.

Screenshot 2022-03-09 at 7 46 00 PM

I think I will monitor for a while. Only if more users are impacted, only then I will try out migrate to latest version of Firebase. As, my current used version is proven quite stable except this high number crashes impacting single user. I think there is a more important reason why I am retaining to older Firebase - I need to continue to support min sdk 16.

Feel free to let me know if you need more info from my side.