application-services
application-services copied to clipboard
placesQueryHistoryMetadata(): LIKE or GLOB pattern too complex
mozilla.components.support.rustlog.RustErrorException: places::ffi - Unexpected error: SqlError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("LIKE or GLOB pattern too complex")))
at mozilla.components.support.rustlog.CrashReporterOnLog.invoke(RustLog.kt:9)
at mozilla.appservices.rustlog.RawLogCallbackImpl.invoke(RustLogAdapter.kt:3)
at java.lang.reflect.Method.invoke(Method.java)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:11)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:1)
at com.sun.jna.Native.invokeStructure(Native.java)
at com.sun.jna.Native.invokeStructure(Native.java:3)
at com.sun.jna.Function.invoke(Function.java:65)
at com.sun.jna.Function.invoke(Function.java:22)
at com.sun.jna.Library$Handler.invoke(Library.java:32)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy14.places_219d_places_query_history_metadata
at mozilla.appservices.places.uniffi.PlacesKt.placesQueryHistoryMetadata(places.kt:3)
at mozilla.appservices.places.PlacesReaderConnection.queryHistoryMetadata$suspendImpl(PlacesConnection.kt:4)
at mozilla.appservices.places.PlacesReaderConnection.queryHistoryMetadata
at mozilla.components.browser.storage.sync.PlacesHistoryStorage.queryHistoryMetadata$suspendImpl(PlacesHistoryStorage.kt:5)
at mozilla.components.browser.storage.sync.PlacesHistoryStorage.queryHistoryMetadata
at mozilla.components.feature.awesomebar.provider.CombinedHistorySuggestionProvider$onInputChanged$2$metadataSuggestionsAsync$1.invokeSuspend(CombinedHistorySuggestionProvider.kt:8)
Fenix: https://github.com/mozilla-mobile/fenix/issues/22416 Sentry: https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/14728348/
┆Issue is synchronized with this Jira Bug ┆epic: MR2 History Metadata Sync support ┆sprintEndDate: 2021-11-24
CC @grigoryk
Looking at https://www.sqlite.org/limits.html#max_like_pattern_length, I suspect the problem is that the query
param here is > 50k.
Wow, interesting. We definitely don't have safeguards against this in the metadata storage queries. I also wonder if there's some bug upstream of the queries, e.g. it's hard to imagine a legit scenario where that query param is so large...
It looks like HistoryMetadataSuggestionProvider takes the entire awesomebar contents and feeds it into this API. So isn't it possible that some extremely long URL is being edited? Places handles URLs up to 64k long (like desktop does)
Good old images in data:
URIs maybe?
A while ago on Desktop, we saw some massive "normal" URLs, with insanely long params - eg, you could something like a data: URL, but encoded as a http url with the data in a param.
The only reason I raise this is that for this API in particular, it's not clear to me that url params make sense?
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1866544
Change performed by the Move to Bugzilla add-on.