Repository navigation
Conversation
doQuery() assumed every response was a SQL result-set and crashed with
an uncaught TypeError ("Cannot read properties of undefined (reading
'docs')") whenever it wasn't - e.g. when the sql module/handler isn't
installed, which returns a 404 JSON body with no "result-set" key. The
UI was then left showing a blank grid with no explanation.
Wrapped the response handling (shared between the success and error
callbacks, since app.js's doNotIntercept interceptor quirk routes most
failures through the success callback too - same root cause as
SOLR-9759) to fall back to showing the raw message via the existing
sqlError display instead of crashing.
There's no v2 API to proactively check whether the sql module/handler is actually loadable (every core nominally registers /sql lazily regardless of whether the module jar is present, so only a real request reveals it's missing) - confirmed by checking for a modules- info or eager-plugin-load API, finding none. So instead: detect the specific ClassNotFoundException-for-SQLHandler shape in the error response and show "the sql module doesn't appear to be enabled" instead of the raw stack trace. Verified against a real build without the sql module (dev-slim) that this is the exact error shape produced. Also hoisted showResult() out of doQuery() so it's available as soon as the controller loads rather than only after the first query attempt - this also makes it directly testable (new testSqlModuleNotEnabledShowsFriendlyMessage calls it via the Angular scope with the captured error shape, since the webapp test classpath always has the sql module and can't reproduce the missing-module case through a real request).
epugh
commented
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-16640
Description
doQuery() assumed every response was a SQL result-set and crashed with an uncaught TypeError ("Cannot read properties of undefined (reading 'docs')") whenever it wasn't - e.g. when the sql module/handler isn't installed, which returns a 404 JSON body with no "result-set" key. The UI was then left showing a blank grid with no explanation.
Solution
Wrapped the response handling (shared between the success and error callbacks, since app.js's doNotIntercept interceptor quirk routes most failures through the success callback too - same root cause as SOLR-9759) to fall back to showing the raw message via the existing sqlError display instead of crashing.
Tests
manual
happy path:

sad path:
