Skip to content

Internal error caused by java.util.NoSuchElementException #999

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

Closed
dimipaun opened this issue Nov 23, 2019 · 7 comments
Closed

Internal error caused by java.util.NoSuchElementException #999

dimipaun opened this issue Nov 23, 2019 · 7 comments

Comments

@dimipaun
Copy link

We keep seeing this error in Crashlytics:

Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (19.2.0). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
       at com.google.firebase.database.android.AndroidPlatform$1$1.run(AndroidPlatform.java)
       at android.os.Handler.handleCallback + 751(Handler.java:751)
       at android.os.Handler.dispatchMessage + 95(Handler.java:95)
       at android.os.Looper.loop + 154(Looper.java:154)
       at android.app.ActivityThread.main + 6119(ActivityThread.java:6119)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run + 886(ZygoteInit.java:886)
       at com.android.internal.os.ZygoteInit.main + 776(ZygoteInit.java:776)

Caused by java.lang.RuntimeException: java.util.NoSuchElementException
       at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java)
       at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java)
       at com.google.firebase.database.core.SyncTree.removeAllEventRegistrations(SyncTree.java)
       at com.google.firebase.database.core.SyncTree$ListenContainer.onListenComplete(SyncTree.java)
       at com.google.firebase.database.core.Repo$4$1.onRequestResult(Repo.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onListenRevoked(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onDataPush(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onDataMessage(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.Connection.onDataMessage(Connection.java)
       at com.google.firebase.database.connection.Connection.onMessage(Connection.java)
       at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java)
       at java.util.concurrent.Executors$RunnableAdapter.call + 428(Executors.java:428)
       at java.util.concurrent.FutureTask.run + 237(FutureTask.java:237)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run + 272(ScheduledThreadPoolExecutor.java:272)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1133(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 607(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run + 761(Thread.java:761)

Caused by java.util.NoSuchElementException
       at java.util.AbstractList$Itr.next + 364(AbstractList.java:364)
       at java.util.AbstractList.hashCode + 540(AbstractList.java:540)
       at com.google.firebase.database.core.ValueEventRegistration.hashCode(ValueEventRegistration.java)
       at sun.misc.Hashing.singleWordWangJenkinsHash + 48(Hashing.java:48)
       at java.util.HashMap.getEntry + 393(HashMap.java:393)
       at java.util.HashMap.get + 348(HashMap.java:348)
       at com.google.firebase.database.core.ZombieEventManager.unRecordEventRegistration(ZombieEventManager.java)
       at com.google.firebase.database.core.ZombieEventManager.onZombied(ZombieEventManager.java)
       at com.google.firebase.database.core.EventRegistration.zombify(EventRegistration.java)
       at com.google.firebase.database.core.view.View.removeEventRegistration(View.java)
       at com.google.firebase.database.core.SyncPoint.removeEventRegistration(SyncPoint.java)
       at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java)
       at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java)
       at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java)
       at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java)
       at com.google.firebase.database.core.SyncTree.removeAllEventRegistrations(SyncTree.java)
       at com.google.firebase.database.core.SyncTree$ListenContainer.onListenComplete(SyncTree.java)
       at com.google.firebase.database.core.Repo$4$1.onRequestResult(Repo.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onListenRevoked(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onDataPush(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.PersistentConnectionImpl.onDataMessage(PersistentConnectionImpl.java)
       at com.google.firebase.database.connection.Connection.onDataMessage(Connection.java)
       at com.google.firebase.database.connection.Connection.onMessage(Connection.java)
       at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java)
       at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java)
       at java.util.concurrent.Executors$RunnableAdapter.call + 428(Executors.java:428)
       at java.util.concurrent.FutureTask.run + 237(FutureTask.java:237)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run + 272(ScheduledThreadPoolExecutor.java:272)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1133(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 607(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run + 761(Thread.java:761)


@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@aguatno
Copy link

aguatno commented Nov 25, 2019

Hi @dimipaun Thanks for filing this issue. The error logs is similar to issue#890.

To check whether if this is a implementation issue, could you try to remove all third-party APIs and follow this Quickstart guide and see if you'll still encounter the issue?

@google-oss-bot
Copy link
Contributor

Hey @dimipaun. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@dimipaun
Copy link
Author

dimipaun commented Dec 3, 2019

Hi @aguatno ,

I don't think this is similar to #890 -- there the default Firebase App was deleted and a new one was created, thus causing the issue.

No such thing in this case -- we just use the default app.

Plus, this issue happens sporadically in production only, so there's no way to "remove all third-party libraries" as that would mean there would be no app left to deploy!

What I did notice is that it happens on particular devices:

  • Motorola / Nexus 6 running Android 7.1.1 (72% of crashes)
  • Samsung / Galaxy J7 running Android 9 (14% of crashes)
  • Samsung / Galaxy S9+ running Android 9 (7% of crashes)
  • Huawai / P20 lite running Android 9 (7% of crashes)

The funny bit is that the Galaxy S9+ and the Nexus 6 we use internally for testing so we know that most of the time it is working fine.

It doesn't seem related to the underlying OS, seems to be a bug in the libs themselves.

@aguatno
Copy link

aguatno commented Dec 4, 2019

Thanks for the information. Can you also share your dependencies from the build.gradle file?

@google-oss-bot
Copy link
Contributor

Hey @dimipaun. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@dimipaun if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants