WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 303338
300868
Remote Inspector non-responding when IndexedDBAPIEnabled is disabled
https://bugs.webkit.org/show_bug.cgi?id=300868
Summary
Remote Inspector non-responding when IndexedDBAPIEnabled is disabled
Pablo Saavedra
Reported
2025-10-16 00:28:50 PDT
When using the remote Web Inspector in WPEWebKit with `IndexedDBAPIEnabled` disabled (by setting `enable-html5-database` to off), the NetworkProcess logs show the following error: ``` Oct 16 06:11:09 imx6qnwot WPENetworkProcess[1209]: Message NetworkStorageManager_GetAllDatabaseNamesAndVersions received by a disabled message endpoint Oct 16 06:11:09 imx6qnwot WPENetworkProcess[1209]: Received an invalid message 'NetworkStorageManager_GetAllDatabaseNamesAndVersions' from WebContent process 5, requesting for it to be terminated. ``` This causes the NetworkProcess to terminate the WebProcess related to the web content when the remote inspector attempts to access IndexedDB data. **Steps to Reproduce:** 1. Disable IndexedDB by setting `enable-html5-database` to off in WPEWebKit. 2. Launch a WebKit-based app and open the remote Web Inspector (WEBKIT_INSPECTOR_SERVER or WEBKIT_INSPECTOR_HTTP_SERVER )" . 3. Observe the NetworkProcess log output (using `WEBKIT_DEBUG`). **Expected Result:** The NetworkProcess should not terminate and the remote inspector should remain functional even when IndexedDB is disabled. **Actual Result:** The WebContent process is terminated due to an invalid message being sent to a disabled message endpoint. The Remote Inspector becomes unoperational. **Root Cause:** The `GetAllDatabaseNamesAndVersions` message in `NetworkStorageManager.messages.in` is fenced by the `[EnabledBy=IndexedDBAPIEnabled]` tag, disabling the endpoint when IndexedDB is off. However, the remote inspector still issues a request for database names. See:
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/Scripts/webkit/messages.py#L849
**Mitigations:** 1. Comment out or remove the line `target.IndexedDBAgent.requestDatabaseNames` in `Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js` to prevent the error. * However remote inspector will remain broken when you try to use a remote webkit engine still containing this call. ``` diff diff --git a/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js b/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js index b6a4bbcb..32810d6a 100644 --- a/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js +++ b/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js @@ -232,8 +232,6 @@ WI.IndexedDBManager = class IndexedDBManager extends WI.Object var keyPath = processKeyPath(objectStoreIndexPayload.keyPath); return new WI.IndexedDatabaseObjectStoreIndex(objectStoreIndexPayload.name, keyPath, objectStoreIndexPayload.unique, objectStoreIndexPayload.multiEntry); } - - target.IndexedDBAgent.requestDatabaseNames(securityOrigin, processDatabaseNames.bind(this)); } _mainResourceDidChange(event) ``` 2. Remove the `[EnabledBy=IndexedDBAPIEnabled]` tag from the `GetAllDatabaseNamesAndVersions` endpoint in `NetworkStorageManager.messages.in` * This guaranties the backward compatibility with older versions. ``` diff --git a/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in b/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in index 9f79017d..0782e974 100644 --- a/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in +++ b/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in @@ -85,7 +85,7 @@ [EnabledBy=IndexedDBAPIEnabled] DeleteRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range) [EnabledBy=IndexedDBAPIEnabled] OpenCursor(WebCore::IDBRequestData requestData, WebCore::IDBCursorInfo info) [EnabledBy=IndexedDBAPIEnabled] IterateCursor(WebCore::IDBRequestData requestData, struct WebCore::IDBIterateCursorData data) - [EnabledBy=IndexedDBAPIEnabled] GetAllDatabaseNamesAndVersions(WebCore::IDBResourceIdentifier requestIdentifier, struct WebCore::ClientOrigin origin) + GetAllDatabaseNamesAndVersions(WebCore::IDBResourceIdentifier requestIdentifier, struct WebCore::ClientOrigin origin) CacheStorageOpenCache(struct WebCore::ClientOrigin origin, String cacheName) -> (WebCore::DOMCacheEngine::CacheIdentifierOrError result) CacheStorageRemoveCache(WebCore::DOMCacheIdentifier cacheIdentifier) -> (WebCore::DOMCacheEngine::RemoveCacheIdentifierOrError result) ``` Anyhow these are just quick solutions for recovering the functionality.
Attachments
Add attachment
proposed patch, testcase, etc.
Pablo Saavedra
Comment 1
2025-10-16 01:02:51 PDT
In summary, the Web Inspector is attempting to use a call that is not enabled when `IndexedDBAPIEnabled` is turned off. As a result, the **WebProcess** sends back an invalid message that the **NetworkProcess** cannot decode. According to the current logic for the IPC connections, if the message can not be decoded, this situation triggers the termination of the associated **WebContent process**. At first glance, it is not clear to me if it is entirely correct for the returned message to be flagged as invalid even when the endpoint is disabled. This is what I found after a time reading the generated code: * In the autogenerated handler that processes these kind of messages, endpoints conditionally enabled are marked invalid when the decoder detects that the endpoint is inactive in `NetworkStorageManager.messages.in`, so if an endpoint is conditionally enabled and not active, the handler invokes `return decoder.markInvalid()`. * So, I understand this is the expected behavior : the message becomes invalid when the API is disabled. Nevertheless, the root issue remains in that the inspector performs a request to a disabled endpoint. Ideally, the inspector should detect that the feature is not enabled and avoid making such a call. However, the definitions of other APIs in the WebInspector are typically controlled by **compile-time flags**, not runtime flags so I can not identify a clear mechanism or method to apply for this case. An ideal solution should tackle these 2 things: 1. Prevent the inspector from calling the disabled API. The code responsible for sending this request should verify whether the feature is enabled before invoking it. 2. Gracefully handle the call by making the function a no-op (no operation) when the API is disabled. This approach could keep the backward compatibility with older versions of webkit for using the remote inspector.
Pablo Saavedra
Comment 2
2025-10-16 02:00:01 PDT
For the sake of completeness, it looks like this issue is originated by this change commit c6bfc7eaff74e1a3b7d0dfa78054fdb3a9f9f94a Author: Darryl Parkinson <
d_parkinson@apple.com
> Date: Fri Feb 28 23:06:27 2025 -0800 Annotate NetworkStorageManager endpoints with IndexedDBAPIEnabled
https://bugs.webkit.org/show_bug.cgi?id=288758
rdar://145787399
Reviewed by Ryosuke Niwa. Annotate some of the NetworkStorageManager endpoints with IndexedDBAPIEnabled * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in: Canonical link:
https://commits.webkit.org/291429@main
Radar WebKit Bug Importer
Comment 3
2025-10-23 00:29:11 PDT
<
rdar://problem/163246115
>
Razvan Caliman
Comment 4
2025-12-02 04:44:56 PST
I believe this was fixed by
https://commits.webkit.org/303729@main
*** This bug has been marked as a duplicate of
bug 303338
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug