Fix flashing 500 error when connecting to play.clickhouse.com#8742
Merged
lovincyrus merged 4 commits intomainfrom Feb 3, 2026
Merged
Fix flashing 500 error when connecting to play.clickhouse.com#8742lovincyrus merged 4 commits intomainfrom
lovincyrus merged 4 commits intomainfrom
Conversation
Contributor
|
@lovincyrus unsure from the video as the OLAP connector is closed. Can you confirm that the issue is not showing under the close connector? |
ericpgreen2
approved these changes
Feb 3, 2026
Contributor
ericpgreen2
left a comment
There was a problem hiding this comment.
Approving, however:
- Can you please run the CI checks?
- It seems the connector explorer should open once the connector is reconciled successfully.
Contributor
Author
This issue is about 500 error not surfacing when user adds their first connector. @royendo |
Contributor
Author
|
Latest demo CleanShot.2026-02-03.at.14.33.35.mp4 |
Prevent premature database_schemas API calls for connectors that are not yet configured. When a connector resource exists but has errors (e.g., unconfigured after runtimeServiceUnpackEmpty), the sidebar auto-expands it and triggers database_schemas, causing a 500 error. Now, useListDatabaseSchemas accepts an enabled parameter, and DatabaseExplorer skips the query when the connector has an errorMessage. The error is displayed in the UI instead, and the query will automatically fire once the connector is configured and errors clear.
When a managed connector is created without configuration, the database_schemas query would fire immediately and fail with a 500 error. This was caused by TanStack Query returning cached data even when the query is disabled, and the template rendering stale error state. Fix by: - Only enabling the database_schemas query when connector has valid config - Preventing template from rendering cached data when query is disabled - Showing helpful 'Configure connector' message for unconfigured managed connectors
d5678f1 to
ecb84cf
Compare
When adding a connector on an uninitialized project, runtimeServiceUnpackEmpty triggers a runtime reset. The SSE reconnection invalidates all queries, causing AnalyzeConnectors to fire while the runtime is still initializing. With retry: false globally, the transient 500 immediately surfaces in the UI. Add retry logic for server errors so these failures are retried transparently before displaying an error.
lovincyrus
added a commit
that referenced
this pull request
Feb 3, 2026
* fix: skip database_schemas query when connector has errors Prevent premature database_schemas API calls for connectors that are not yet configured. When a connector resource exists but has errors (e.g., unconfigured after runtimeServiceUnpackEmpty), the sidebar auto-expands it and triggers database_schemas, causing a 500 error. Now, useListDatabaseSchemas accepts an enabled parameter, and DatabaseExplorer skips the query when the connector has an errorMessage. The error is displayed in the UI instead, and the query will automatically fire once the connector is configured and errors clear. * fix: prevent querying unconfigured managed connectors When a managed connector is created without configuration, the database_schemas query would fire immediately and fail with a 500 error. This was caused by TanStack Query returning cached data even when the query is disabled, and the template rendering stale error state. Fix by: - Only enabling the database_schemas query when connector has valid config - Preventing template from rendering cached data when query is disabled - Showing helpful 'Configure connector' message for unconfigured managed connectors * prettier * fix: retry transient 500 errors on AnalyzeConnectors query When adding a connector on an uninitialized project, runtimeServiceUnpackEmpty triggers a runtime reset. The SSE reconnection invalidates all queries, causing AnalyzeConnectors to fire while the runtime is still initializing. With retry: false globally, the transient 500 immediately surfaces in the UI. Add retry logic for server errors so these failures are retried transparently before displaying an error.
lovincyrus
added a commit
that referenced
this pull request
Feb 4, 2026
* fix: skip database_schemas query when connector has errors Prevent premature database_schemas API calls for connectors that are not yet configured. When a connector resource exists but has errors (e.g., unconfigured after runtimeServiceUnpackEmpty), the sidebar auto-expands it and triggers database_schemas, causing a 500 error. Now, useListDatabaseSchemas accepts an enabled parameter, and DatabaseExplorer skips the query when the connector has an errorMessage. The error is displayed in the UI instead, and the query will automatically fire once the connector is configured and errors clear. * fix: prevent querying unconfigured managed connectors When a managed connector is created without configuration, the database_schemas query would fire immediately and fail with a 500 error. This was caused by TanStack Query returning cached data even when the query is disabled, and the template rendering stale error state. Fix by: - Only enabling the database_schemas query when connector has valid config - Preventing template from rendering cached data when query is disabled - Showing helpful 'Configure connector' message for unconfigured managed connectors * prettier * fix: retry transient 500 errors on AnalyzeConnectors query When adding a connector on an uninitialized project, runtimeServiceUnpackEmpty triggers a runtime reset. The SSE reconnection invalidates all queries, causing AnalyzeConnectors to fire while the runtime is still initializing. With retry: false globally, the transient 500 immediately surfaces in the UI. Add retry logic for server errors so these failures are retried transparently before displaying an error.
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.
This PR skips
database_schemasquery when connector has errors. When adding a ClickHouse connector to an uninitialized project,runtimeServiceUnpackEmptycreates the connector resource before the YAML config with credentials is written.The sidebar auto-expands the new connector and DatabaseExplorer fires
/v1/connectors/database_schemas,causing a 500 error since the connector isn't configured yet.Closes https://linear.app/rilldata/issue/APP-703/flashing-500-error-when-connecting-to-playclickhousecom
CleanShot.2026-02-02.at.14.11.31.mp4
Checklist: