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

TooManyRequestsException #2170

Open
1 task done
BLTuckerDev opened this issue Aug 8, 2024 · 4 comments
Open
1 task done

TooManyRequestsException #2170

BLTuckerDev opened this issue Aug 8, 2024 · 4 comments

Comments

@BLTuckerDev
Copy link

How can we help?

The app I work on is seeing a number of crashes coming from a TooManyRequestsException
thrown by the android.net.ConnectivityManager. Further up the stack trace you can see
its something being done by the androidx work manager library.

Stack trace:

android.net.ConnectivityManager.convertServiceException (ConnectivityManager.java:4236)
android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:4437)
android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid (ConnectivityManager.java:4966)
android.net.ConnectivityManager.registerDefaultNetworkCallback (ConnectivityManager.java:4933)
android.net.ConnectivityManager.registerDefaultNetworkCallback (ConnectivityManager.java:4907)
androidx.work.impl.utils.NetworkApi24.registerDefaultNetworkCallbackCompat (NetworkApi24.kt:28)
androidx.work.impl.constraints.trackers.NetworkStateTracker24.startTracking (NetworkStateTracker.kt:139)
androidx.work.impl.constraints.trackers.ConstraintTracker.addListener (ConstraintTracker.kt:57)
androidx.work.impl.constraints.controllers.ConstraintController.replace (ConstraintController.kt:82)
androidx.work.impl.constraints.WorkConstraintsTrackerImpl.replace (WorkConstraintsTracker.kt:92)
androidx.work.impl.background.greedy.GreedyScheduler.schedule (GreedyScheduler.java:170)
androidx.work.impl.background.greedy.DelayedWorkTracker$1.run (DelayedWorkTracker.java:75)
android.os.Handler.handleCallback (Handler.java:958)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:230)
android.os.Looper.loop (Looper.java:319)
android.app.ActivityThread.main (ActivityThread.java:8919)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)

We do not have any direct dependency or interaction with the androidx work manager library.
When I print out the app's dependencies it seems that the OneSignal notifications SDK
does make use of the android work manager library transitively via the firebase-messaging dependency

Dependency chain:

+--- com.onesignal:notifications:5.1.15
|    |    +--- com.google.firebase:firebase-messaging:{require [21.0.0, 23.4.99]; prefer 23.4.0} -> 24.0.0
|    |    |    +--- com.google.firebase:firebase-common:21.0.0
|    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4 -> 1.8.1 (*)
|    |    |    |    +--- com.google.firebase:firebase-components:18.0.0
|    |    |    |    |    +--- com.google.firebase:firebase-annotations:16.2.0
|    |    |    |    |    |    \--- javax.inject:javax.inject:1
|    |    |    |    |    +--- androidx.annotation:annotation:1.5.0 -> 1.8.0 (*)
|    |    |    |    |    \--- com.google.errorprone:error_prone_annotations:2.26.0 -> 2.27.0
|    |    |    |    +--- com.google.firebase:firebase-annotations:16.2.0 (*)
|    |    |    |    +--- androidx.annotation:annotation:1.5.0 -> 1.8.0 (*)
|    |    |    |    +--- androidx.concurrent:concurrent-futures:1.1.0 (*)
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.24 (*)
|    |    |    |    +--- com.google.android.gms:play-services-basement:18.3.0 -> 18.4.0 (*)
|    |    |    |    \--- com.google.android.gms:play-services-tasks:18.1.0 -> 18.2.0 (*)
|    |    |    +--- com.google.firebase:firebase-common-ktx:21.0.0
|    |    |    |    +--- com.google.firebase:firebase-common:21.0.0 (*)
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 -> 1.9.20 (*)
|    |    |    |    +--- com.google.firebase:firebase-components:18.0.0 (*)
|    |    |    |    \--- com.google.firebase:firebase-annotations:16.2.0 (*)
|    |    |    +--- com.google.firebase:firebase-components:18.0.0 (*)
|    |    |    +--- com.google.firebase:firebase-datatransport:18.2.0 -> 19.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    +--- com.google.android.datatransport:transport-api:3.1.0 -> 3.2.0 (*)
|    |    |    |    +--- com.google.android.datatransport:transport-backend-cct:3.2.0 -> 3.3.0
|    |    |    |    |    +--- com.google.android.datatransport:transport-api:3.2.0 (*)
|    |    |    |    |    +--- com.google.android.datatransport:transport-runtime:3.3.0 (*)
|    |    |    |    |    +--- com.google.firebase:firebase-encoders:17.0.0 (*)
|    |    |    |    |    +--- com.google.firebase:firebase-encoders-json:18.0.0 -> 18.0.1
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 -> 1.9.20 (*)
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    |    |    \--- com.google.firebase:firebase-encoders:17.0.0 (*)
|    |    |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.8.0 (*)
|    |    |    |    +--- com.google.android.datatransport:transport-runtime:3.2.0 -> 3.3.0 (*)
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 -> 1.9.20 (*)
|    |    |    +--- com.google.firebase:firebase-encoders:17.0.0 (*)
|    |    |    +--- com.google.firebase:firebase-encoders-json:18.0.0 -> 18.0.1 (*)
|    |    |    +--- com.google.firebase:firebase-encoders-proto:16.0.0 (*)
|    |    |    +--- com.google.firebase:firebase-iid-interop:17.1.0
|    |    |    |    +--- com.google.android.gms:play-services-basement:17.0.0 -> 18.4.0 (*)
|    |    |    |    \--- com.google.android.gms:play-services-tasks:17.0.0 -> 18.2.0 (*)
|    |    |    +--- com.google.firebase:firebase-installations:17.2.0 -> 18.0.0
|    |    |    |    +--- com.google.android.gms:play-services-tasks:18.0.1 -> 18.2.0 (*)
|    |    |    |    +--- com.google.firebase:firebase-annotations:16.2.0 (*)
|    |    |    |    +--- com.google.firebase:firebase-common:21.0.0 (*)
|    |    |    |    +--- com.google.firebase:firebase-common-ktx:21.0.0 (*)
|    |    |    |    +--- com.google.firebase:firebase-components:18.0.0 (*)
|    |    |    |    +--- com.google.firebase:firebase-installations-interop:17.1.1 -> 17.2.0
|    |    |    |    |    +--- com.google.android.gms:play-services-tasks:18.0.1 -> 18.2.0 (*)
|    |    |    |    |    \--- com.google.firebase:firebase-annotations:16.2.0 (*)
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.24 (*)
|    |    |    +--- com.google.firebase:firebase-installations-interop:17.1.0 -> 17.2.0 (*)
|    |    |    +--- com.google.firebase:firebase-measurement-connector:19.0.0 -> 20.0.1
|    |    |    |    +--- com.google.android.gms:play-services-basement:18.0.0 -> 18.4.0 (*)
|    |    |    |    \--- com.google.firebase:firebase-annotations:16.0.0 -> 16.2.0 (*)
|    |    |    +--- androidx.annotation:annotation:1.2.0 -> 1.8.0 (*)
|    |    |    +--- com.google.android.datatransport:transport-api:3.1.0 -> 3.2.0 (*)
|    |    |    +--- com.google.android.datatransport:transport-backend-cct:3.1.8 -> 3.3.0 (*)
|    |    |    +--- com.google.android.datatransport:transport-runtime:3.1.8 -> 3.3.0 (*)
|    |    |    +--- com.google.android.gms:play-services-base:18.0.1 -> 18.5.0 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:18.1.0 -> 18.4.0 (*)
|    |    |    +--- com.google.android.gms:play-services-cloud-messaging:17.2.0
|    |    |    |    +--- com.google.android.gms:play-services-basement:18.3.0 -> 18.4.0 (*)
|    |    |    |    \--- com.google.android.gms:play-services-tasks:18.1.0 -> 18.2.0 (*)
|    |    |    +--- com.google.android.gms:play-services-stats:17.0.2
|    |    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    |    \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.4.0 (*)
|    |    |    +--- com.google.android.gms:play-services-tasks:18.0.1 -> 18.2.0 (*)
|    |    |    +--- com.google.errorprone:error_prone_annotations:2.9.0 -> 2.27.0
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.24 (*)
|    |    +--- androidx.work:work-runtime:{require [2.1.0, 2.8.99]; prefer 2.8.1} -> 2.8.1

I've reported the issue directly to Google but I'm also wondering if there is an issue
in the notifications SDK that could cause it to send too many requests and cause the crash.

Do you have any other reports of this? or any known issues that are being worked on which may alleviate it?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@UgurGuner
Copy link

I have faced the same issue and I believe that is completely coming from Google side. What is your google map sdk version right now?

@prashantkumarzee
Copy link

I am also facing the same issue. and I am not using the google map sdk.

Caused by android.net.ConnectivityManager$TooManyRequestsException:
at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:3387)
at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:3573)
at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:3974)
at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:3951)
at com.google.firebase.firestore.remote.AndroidConnectivityMonitor.configureNetworkMonitoring(AndroidConnectivityMonitor.java:87)
at com.google.firebase.firestore.remote.AndroidConnectivityMonitor.(AndroidConnectivityMonitor.java:64)
at com.google.firebase.firestore.core.MemoryComponentProvider.createConnectivityMonitor(MemoryComponentProvider.java:68)
at com.google.firebase.firestore.core.MemoryComponentProvider.createConnectivityMonitor(MemoryComponentProvider.java:42)
at com.google.firebase.firestore.core.ComponentProvider.initialize(ComponentProvider.java:152)
at com.google.firebase.firestore.core.FirestoreClient.initialize(FirestoreClient.java:296)
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$0(FirestoreClient.java:114)
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$2(AsyncQueue.java:444)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:330)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:235)
at java.lang.Thread.run(Thread.java:919)
Screenshot 2024-08-30 at 2 54 57 PM
Screenshot 2024-08-30 at 2 55 03 PM

@BLTuckerDev
Copy link
Author

BLTuckerDev commented Sep 6, 2024

I am not using the google map SDK either and the only dependency I have using the work manager library is OneSignal.
I do believe it has something to do with how the SDK uses the work manager. I have found two related issues in the google issue tracker and both of those issues ended up being memory leaks caused by the client of the work manager library.

https://issuetracker.google.com/issues/270885484
https://issuetracker.google.com/issues/231499040

This is why I think it has something to do with the Onesignal SDK's use of workmanager APIs. I'd love to see an investigation and fix since this is the largest crash affecting my app by a wide margin.

@ontrackrahul
Copy link

We are facing this issue constantly in our app, need to address this asap

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

No branches or pull requests

4 participants