prestodb/presto · warning · Error
failed to get query details
Error message
failed to get query details
What it means
In the Presto web UI's Splits component, queryResult fetches /v1/query/{queryId} and throws a plain Error("failed to get query details") when the HTTP response is not ok. The rejection propagates to the fetch chain's catch, so the UI cannot render split details for that query.
Source
Thrown at presto-ui/src/components/Splits.tsx:140
if (timerid.current !== 0) {
clearTimeout(timerid.current);
timerid.current = 0;
}
const newQueryState = { query, ended: query.finalQueryInfo, failed: false };
if (newQueryState.ended === false && newQueryState.failed === false && timerid.current === 0) {
timerid.current = window.setTimeout(queryResult, 3000);
}
updateTimeline();
setQueryState(newQueryState);
}
function queryResult() {
const queryId = getFirstParameter(window.location.search);
fetch("/v1/query/" + queryId)
.then((response) => {
if (!response.ok) {
throw new Error("failed to get query details");
}
return response.json();
})
.then((query) => {
calculateItemsGroups(query);
})
.catch((err) => {
console.log(`query failed with error: ${err}`);
setQueryState({ failed: true });
});
}
useEffect(() => {
queryResult();
}, [containerRef]);
return (
<>View on GitHub (pinned to 55bb57d202)
Solutions
- Re-run the query and navigate to the splits page for the new query ID.
- Check the coordinator logs for the query ID and any /v1/query errors.
- Increase query.max-history / query.max-age if you need old query pages to keep working.
- Confirm the UI's requests reach the correct coordinator (reverse-proxy routing).
Example fix
// before
if (!response.ok) {
throw new Error("failed to get query details");
}
// after
if (!response.ok) {
throw new Error(`failed to get query details: HTTP ${response.status} for query ${queryId}`);
} Defensive patterns
Strategy: try-catch
Validate before calling
// TypeScript: check the query id exists in the URL before fetching
const queryId = getFirstParameter(window.location.search);
if (!queryId || !/^[\w-]+$/.test(queryId)) {
showStatus(Status.FAIL); return;
} Type guard
function isValidQueryId(v: string | null): v is string {
return v !== null && /^[A-Za-z0-9._-]+$/.test(v);
} Try / catch
fetch(`/v1/query/${queryId}`)
.then((r) => { if (!r.ok) throw new Error(`HTTP ${r.status} for query ${queryId}`); return r.json(); })
.catch((err) => {
console.error(err.message);
showStatus(Status.FAIL); // surface a friendly UI state
}); Prevention
- Handle 404/410 gracefully — old query IDs expire from coordinator memory.
- Raise query.max-history if users bookmark completed queries.
- Show a human-readable 'query expired' message instead of a blank page.
- Verify UI and coordinator are served by the same host/proxy.
When it happens
Trigger: Opening the splits page with a queryId that no longer exists (query expired/evicted from coordinator memory), the coordinator returning 404/500, or the UI being pointed at a coordinator that does not know the query.
Common situations: Bookmarking/refreshing a splits page after query completion and query.max-history expiry; coordinator restart; load balancer routing the UI request to the wrong coordinator.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Response does not contain a JSON value
- Illegal character ':' found in username
- Error fetching next (attempts: %s, duration: %s)
- Execution endpoint must use HTTP or HTTPS protocol:
- INVALID_ARGUMENTS
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/88674f54748865a0.
Report an issue: GitHub.