firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

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

Open AndroidDeveloperLB opened this issue 5 years ago • 7 comments

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.

  • Android Studio version: 4.1.1
  • Firebase Component: Written below
  • Component version: Written below
    implementation 'com.google.firebase:firebase-crashlytics-ktx:17.3.0'
    implementation 'com.google.firebase:firebase-analytics-ktx:18.0.0'

[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

AndroidDeveloperLB avatar Dec 05 '20 13:12 AndroidDeveloperLB

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

google-oss-bot avatar Dec 05 '20 13:12 google-oss-bot

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?

yccheok avatar Mar 09 '22 02:03 yccheok

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!

argzdev avatar Mar 09 '22 09:03 argzdev

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

  • Embed with Firebase analytics for the 1st time. Before this, I do not use any analytics SDK
  • Migrate from APK to ABB

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.

yccheok avatar Mar 09 '22 11:03 yccheok

We are still receiving many error reports via Crashlytics related to this issue in Firestore. Could you provide an update on the status of this issue?

pistolcaffe avatar Oct 15 '24 01:10 pistolcaffe

@daymxn, we've received another report of this issue in #6384. Since @vkryachko, is not on this project, I'm reassigning. Can you take a look?

MarkDuckworth avatar Oct 15 '24 16:10 MarkDuckworth

I'm not able to repro this, but if anyone experiencing this could double check some things:

  1. Double check that you have android.permission.INTERNET AND android.permission.ACCESS_NETWORK_STATE. A lot of folks forget the ACCESS_NETWORK_STATE, as it's not always needed- but it can cause issues when absent.
  2. Does the issue occur on non rooted devices? If it's rooted, then the end-user could be accidentally blocking it themselves with some custom firewall.
  3. Double check that your permission grants come BEFORE the application block in your AndroidManifest.xml. So it should end up like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="yourpackage">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application>
<!-- rest of the file

If the crash is still occurring under all those circumstances, please let us know the version of your firebase libraries, the device, and the Android flavor/sdk version. There's been a lot of changes over the years with Android versions- so understanding which is causing the issue helps a ton.

daymxn avatar Oct 15 '24 16:10 daymxn

The following permissions have already been applied and are declared before the tag in our AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

The issue started occurring in version v1.6.1.2 of our app and has been reproducible ever since this version was released. 스크린샷 2024-10-21 오전 11 02 42

The key changes made in this release are as follows:

firebase-bom update from version 32.7.1 to 33.0.0 targetSdkVersion update from 33 to 34

Please let us know if further details are required or if there are any recommended steps to resolve this issue.

pistolcaffe avatar Oct 21 '24 02:10 pistolcaffe