Repository navigation
Bug #83023, keep the server cause in the XMLA Test Connection message - #9204
Conversation
Test Connection showed the generic connect-failed text for an unreachable server and for a reachable endpoint that answered with an error (wrong catalog). A connection-level failure (IOException in the cause chain) keeps that text; an answer from the endpoint now reports its cause, and an empty catalog result names the catalog. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round 1 of PR 9204, head 7200ae0. Verdict: clean (no blocker, no important); three nits recorded, none sent back to the fixer. Checked against the confirmed cause (testConnect dropped the server's text for every failure):
|
|
Live verification at head 7200ae0: built onto the shared instance and re-ran the Test Connection reproduction (REST and the Portal dialog) against an eMondrian-shaped stub. A wrong catalog now shows the endpoint-answered text with Unknown catalog 'NoSuchCatalog'; the control still passes; an unreachable port and an unknown host still show the connection-failure text. Targeted tests: 6 classes, 66 cases, all pass. |
NeverStopFMH
left a comment
There was a problem hiding this comment.
Verdict
Ready to merge. No blocking issues.
Open verdicts from the conversation
none. The only conversation entries are two comments from Nelson-cao (review round 1: clean, three nits; live verification at head 7200ae0). There are no CHANGES REQUESTED reviews and no inline comments.
Committed secrets
none (scanned the net patch and both commits, 315b1b6 and 7200ae0; only message strings, test XML and a loopback socket).
Tests run
no trigger fired. Community PR; the new test is tagged core, which CI's core-tests jobs run. The PR body's test list is a report, not a "must pass" demand (C2). I did not build the change.
Findings
Blocking: none.
Non-blocking:
XmlaDatasourceService.isConnectionFailuretreats any IOException in the cause chain as "unreachable". A server that answers but sends a truncated or malformed body also throws IOException (for example a SAX-over-stream read error), so it keeps the generic text. This is acceptable and matches the PR's stated intent.- In
XMLAHandler.testDataSource, the case of more than one catalog returned (server ignores the CATALOG_NAME restriction) still throwsfailedConnectDB.testConnectnow shows it as "endpoint answered with an error: ", which reads slightly redundant. Cosmetic. - The endpointError text embeds the raw server message (fault string or HTTP code). This goes to an admin-only Test Connection dialog and is rendered as text. Risk is low, but the message is not truncated. A very long or HTML body could produce a long status.
- New keys exist only in the base
srinter.propertiesand en_US. The fr_FR and zh_CN bundles fall back to English, as the PR states. - The test builds
CredentialServiceby reflection and uses a raw socket stub. It is a bit heavy but deterministic: it binds to loopback, uses daemon threads and closes the socket in@AfterEach. No test elsewhere asserts the oldconnectFailedorfailedConnectDBtext for XMLA, and the existingXMLAHandler*Testclasses do not touchtestDataSource.
Backward compatibility: testDataSource still throws RuntimeException in the same situations; only the message text differs. testConnect keeps connected=false and the same connectFailed text for connection-level failures. A blank message falls back to the old text.
Problem
XMLA data source Test Connection (
POST api/portal/data/datasource/xmla/test) showed the same "Failed to connect to datasource [x]! Please check the connection information." for a wrong catalog on a reachable endpoint and for an unreachable server. The server's cause was dropped.Root cause
XmlaDatasourceService.testConnectcaught everyExceptionand always setcommon.datasource.connectFailedwith only the data source name, discarding the exception message. In addition,XMLAHandler.testDataSourcereported an empty catalog result with the generic failedConnectDB text.Fix
testConnect: anIOExceptionanywhere in the cause chain (refused, unknown host, timeout, bad URL) keepsconnectFailed. Any other exception means the endpoint answered, so the status is the newcommon.datasource.xmla.endpointError("The XMLA endpoint of datasource [X] answered with an error: (check the catalog name, the URL path and the credentials)"). A blank message falls back toconnectFailed.connectedstays false.XMLAHandler.testDataSource: a named catalog with an empty Discover result throws the newcommon.datasource.xmla.catalogNotFound("Catalog [X] was not found on the XMLA server.").srinter.propertiesandcommunity-examples/localize/srinter_en_US.properties; other locales fall back to the base bundle.<detail><Error Description=...>is already thrown bySAXHandler.startElementon the Discover path, so the cause reachestestConnect(proved by the new test, which failed before the fix).Tests run
XmlaDatasourceServiceTestConnectTest(new, raw-socket stub): 5 run, 0 failed (3 failed on the unfixed code: eMondrian-shaped 200 fault, empty rowset, HTTP 500). Also run together:XMLAHandlerReasonPhraseTest3,XMLAHandlerRequestEscapingTest23,SrinterMessageFormatQuotesTest10,MDXHelperDrillThroughRequestTest3,DataSourceRegistryConnectionTestQueryTest22: all green (66 total).Known limits
DataSourceStatusService(167-220) matches "username"/"password" in the handler message, so surfacing server text can change which status text a data source shows (text only).stylebi-wiz-main-rebase) needs a separate port; not done here.HTTP 500prefix only); the null/empty-catalog multi-catalog case is a separate defect.🤖 Generated with Claude Code