-
Notifications
You must be signed in to change notification settings - Fork 894
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
AsyncQueue is already failed: The transaction was aborted, so the request cannot be fulfilled. #1642
Comments
@larssn Thanks for the report and sorry you're running into issues. You said that clearing IndexedDB seems to postpone the problem and so you think it's size-related. Does that mean that just refreshing the browser (without clearing IndexedDB) does not help? Once the error happens, the problem continues to happen until you clear IndexedDB persistence? If so, that would definitely indicate this is a size issue. But I want to be clear. Thanks! |
@mikelehen Refreshing the browser does fix the problem, but it always seem to be fairly temporary and we can expect to see the error again some hours later (it happened exactly like that yesterday). Clearing IDB causes the problem to go away for weeks until we reach a certain size level again. I'm at a client right now, and they have 3 main devices, each of which has the following storage sizes: The 60+ MB theshold seems to be the danger zone. /Lars Ps. We use sentry for error logging, and I can share the crash reports with you if you want? I can't post them here since they contain user information. But there might be valuable information to be found there. PPs. We've set the garbage collection threshold to 5MB (we thought), so I'm suspecting that it's actually not turned on. It's hard to tell. We've enabled it as can be seen here: angular/angularfire#2030 but that's an entirely different issue that I don't want to pollute this issue with. So just ignore. edit - updated numbers to exclude app size |
@LanderBeeuwsaert I recall us having had that one as well, but less frequent. |
@larssn Thanks for the update. I don't really understand why refreshing would make the error go away for a while if it's quota-related. That seems suspicious. Though I know Chrome at one point had a heuristic-based IndexedDb quota that was based on the amount of free space on the device, so in theory the quota could change from one run to the next. If you want to verify that garbage collection is enabled, you can add And if you are willing to do some more digging, it might be illuminating to try to intentionally reproduce a quota issue. E.g. use a device similar to what your users have seen this on, set the cacheSizeBytes threshold very high, and then perform lots of large (non-overlapping) queries to fill up the cache with lots of documents... and see if you can get this error to happen. Else I'll see if I can do something like this in the next few days. |
Not sure if it's quota related, since inspecting the exact same Samsung model claims the storage quata is 727MB. Also the error thrown should be something like I've looked at the So I tried reproducing the problem by downloading about 20000 orders (which are pretty big objects in our system), but nothing out of the ordinary happened. I'd set the GC to 500x1024x1024 beforehand, so that should be enough. I did notice that Chrome's IndexedDB metric seemed off, where GC would claim that size X was below the threshold to be GC'ed, and the Chrome metric would indicate a different size X for IDB. Ps. Thanks for the GC tip, I've verified that GC is indeed running as expected. |
@larssn Thanks for the extra investigation! Bummer it didn't lead to a reproduction of the issue yet. :-/ Per your comments / question:
FWIW- This is the heuristic I was talking about that Chrome uses: https://chromium.googlesource.com/chromium/src/+/refs/heads/master/storage/browser/quota/quota_settings.cc#68 So I think maybe if you have 7GB free on the device, then the storage quota will be ~10% (700MB) but if you have much less space free, then the storage quota could get smaller. So it would be interesting to find out if users running into this are running out of space on their device in general. But then again, maybe it's not quota-related at all. :-/ |
@mikelehen No problem. I really hope we find this one, as it is a pretty big stress factor that orders are getting dropped. Regarding space, I know our users don't install much on the 3 devices I mentioned, as they are mounted to the wall - it's mainly meant for our app only. Let me know if you want/need access to those crash logs at some point. Thanks, |
Oh! You're welcome to send me any crash logs you have (michael@firebase.com) and I'll take a look. I'm assuming it's mostly just the exception message / stacktrace that you pasted in the initial bug, but more than happy to look through for additional clues. If we can somehow get the Thanks and sorry I don't have a better answer at this point! |
Is there any way to make debug mode a little less verbose? Just worried that have 100k+ lines in a debug console will make chrome unhappy. It crashed with out of memory errors a few times today when I did a big data pull with debug mode turned on. Ps. I've sent you a few mails regarding crash log access. |
Thanks. I've received the crash log access. There isn't a direct way to make the logging less verbose. One thing I've seen done in the past is hijack console.log and store a rolling in-memory buffer of the last 1000 lines or so, and then only actually log it if a problem occurs. Not sure if that would be an option for you. |
I'm kinda swamped with work atm, but your idea is pretty good. I'll see if I can find time to implement it. |
Sounds good. Alternatively if it's convenient to use a modified Firestore SDK, you could make the changes shown here: #1649 This will add more error-level logging (on by default) to the codepaths in question. In fact, this may be more helpful anyway, since the debug logging doesn't cover all of the abort cases. One thing I'm trying to determine for certain is if the SDK is internally aborting the transaction, or if Chrome is doing it on its own. |
Interested in learning the outcome to this. |
@sengoontoh We still don't have enough information to make headway on this issue. If you are experiencing it, please consider adding the logging I mention in #1642 (comment) and report back. Thanks! |
console.log's get optimized away in production release. Is there any way to pipe the debug logs into somewhere else? |
@sengoontoh I think that would depend on your environment / build configuration (browsers certainly don't strip out console.log by default), so I don't think I can answer that without knowing how you're building / deploying, etc. Sorry. |
I'm getting that error constantly, sadly never been able to reproduce it on my own, so far that storage limit might be the only logical explanation, so I guess the only way to fix it is disable offline persistence and handle updates via some timestamp... |
@mikelehen So an AsynQueue error just came in. Still not much to go by, as far as I can tell.
What strikes me as odd, is the 4 hour gap between heartbeats (2:58 - 7:14). They normally seem to happen every minute, towards the The terminals do get very slow, the bigger indexeddb gets. Doing transactions will take more and more time as it gets bigger, which might cross some kind of timeout threshold? Another weird thing is the first heartbeat in the list above seems to have returned 0 instead of 200, which is odd. |
@sr1dh4r Thanks for the report. I don't suppose you can provide a way to reproduce this issue, can you? That would be really helpful. Failing that, you could perhaps enable logging ( |
@mikelehen Will do. I also realised couple of things if it helps ...
|
@sr1dh4r Thanks. The most notable thing in the log is that there's a 20 minute gap directly prior to the error starting, which suggests that the app was in the background, and this may have triggered the issue. There's a known issue with this happening on iOS 12.2 devices (#1670) but you said this is Android, correct? Can you provide the Android version info? And do you know if this happens on other devices as well? Thanks. |
When this hits, firestore fails for the rest of the lift of the page and the page appears semi functional. Better to force reload and have an actual working page even though it's not a great user experience. See firebase/firebase-js-sdk#1642 for details.
@mikelehen Yes, Android 8.0.0 (it's a one plus 3 device) and mostly whenever I unlock a phone after a while so yes, must be sleep/background related. I may have noticed it in the chrome browser on mac os but I'm not so sure (I didn't pay attention to the issue initially). Will let you know in case I notice it in on any other device and/or if I can provide a simple way for you to reproduce the issue. |
I'm currently facing the same issue, or something very similar. Still trying to get some logs, bug custom logger seems to be not working.
My custom console log is never called. |
@kogratte Do you see the same stacktrace in your console? If you can, it would also help to know if it reproduces if you only use Firestore. |
@nVitius The error should be catchable. We basically have a try catch with a |
Another datapoint: [log] - trail-summary-card: going to trail page now! ⚡️ ------ STARTUP JS ERROR ------ ⚡️ Error: FIRESTORE (5.11.0) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: objectStore@[native code] ⚡️ See above for help with debugging blank-screen issues ⚡️ ------ STARTUP JS ERROR ------ ⚡️ InvalidStateError: Failed to execute 'objectStore' on 'IDBTransaction': The transaction finished. ⚡️ See above for help with debugging blank-screen issues ⚡️ ------ STARTUP JS ERROR ------ ⚡️ Error: FIRESTORE (5.11.0) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: objectStore@[native code] ⚡️ See above for help with debugging blank-screen issues Seen on iPhone iOS 12.3.1. |
I've had two users have this issue with Chrome on a MacBook Pro this past week. Unfortunately, the verbose logging hadn't been deployed to them yet. Will report back if I see it happen again. |
I currently have the following stacktrace: |
Any updates this issue? |
This issue is still unfortunately not really actionable since we have no way to reproduce it and no leads on what's causing it. It would help if people experiencing an issue could:
|
What about the trace provided by @VictorNorman is that sufficient data? |
@sengoontoh Not sure. It doesn't include anything leading up to the error which might have provided a clue as to what's triggering it (and verify that we're catching the root issue rather than a downstream issue). Since it's on iOS 12.3.1 it could be a manifestation of #1670 which will apparently be fixed in iOS 13. |
@mikelehen We deployed our app this week to about 90 users for acceptance testing. I had a hard time reproducing this issue myself, but I was able to capture a session of a user that saw this bug. |
@nVitius Sounds good. You can email it to me at michael@firebase.com. |
Here are some stack traces from my Chrome extension (Web SDK):
|
Happens for me from time to time in a web app we are working on. It is still in development and if I leave a tab with the app open overnight sometimes it throws the error in console (using Chrome if that's of any help). Uncaught (in promise) Error: FIRESTORE (5.11.0) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: Transaction timed out due to inactivity. |
@arthabus Is this a laptop or a computer that goes to "sleep" when idle? There's a known issue in Chrome (see #939 and https://bugs.chromium.org/p/chromium/issues/detail?id=855624) that is likely to blame. :-/ Consider commenting on the chromium issue, especially if you have a concrete way to reproduce this. Thanks! |
Any updates about this problem? |
I am also interested in |
There is no update on this issue since it does not actually track any specific, actionable issue (see my comment from April). So I am closing it. Going forward, if you are encountering:
Thanks! |
Describe your environment
Describe the problem
We're seeing the following error more and more lately (via our error reporting service):
This error is of a critical nature, as it entirely breaks the DB layer.
Data stops getting written to the database, and it can be somewhat difficult to detect when the DB gets into this state, as the error is only thrown once. You can then call all the DB functions, and everything appears to work as normal, except no data ends up in the cloud (nor the persistence layer).(This was incorrect. Our error collection service just aggregated the data)Steps to reproduce:
Apologies, but it's entirely periodic. It could be related to IndexedDB reaching a certain size, as clearing it out seems to postpone the problem for a few weeks. I have no theories as to what causes the "transaction to be aborted".
We were hoping the new garbage collection feature would take care of the problem, but so far it doesn't seem like it.
The devices running this are of the model "Samsung T580".
Any other info you need, let me know.
The text was updated successfully, but these errors were encountered: