cube-js/cube · critical
Could not extract warehouseId from httpPath
Error message
Could not extract warehouseId from httpPath
What it means
After finding httpPath, parseDatabricksJdbcUrl expects it to match /warehouses/<id> so it can obtain the warehouseId used by the REST health/test APIs. Cluster-style httpPaths (/sql/1.0/clusters/<id>) or malformed paths fail this regex and abort construction.
Source
Thrown at packages/cubejs-databricks-jdbc-driver/src/helpers.ts:79
const [hostPortAndPath, ...params] = urlWithoutPrefix.split(';');
const [host] = hostPortAndPath.split(':');
const paramMap = new Map<string, string>();
for (const param of params) {
const [key, value] = param.split('=');
if (key && value) {
paramMap.set(key, value);
}
}
const httpPath = paramMap.get('httpPath');
if (!httpPath) {
throw new Error('Missing httpPath in JDBC URL');
}
const warehouseMatch = httpPath.match(/\/warehouses\/([a-zA-Z0-9]+)/);
if (!warehouseMatch) {
throw new Error('Could not extract warehouseId from httpPath');
}
const warehouseId = warehouseMatch[1];
return { host, warehouseId };
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Use a SQL Warehouse httpPath of the form /sql/1.0/warehouses/<warehouseId> from the warehouse's Connection details tab
- If you must use a cluster, create a SQL warehouse instead — the driver's test/validation path assumes warehouses
- Inspect the httpPath string for truncation/whitespace and copy it verbatim from Databricks
Example fix
// before httpPath=/sql/1.0/clusters/0717-211111-abcdef // after httpPath=/sql/1.0/warehouses/0f1a2b3c4d5e6f78
Defensive patterns
Strategy: validation
Validate before calling
const httpPath = url.match(/httpPath=([^;]+)/)?.[1];
if (!/^\/sql\/1\.0\/warehouses\/[a-zA-Z0-9]+$/.test(httpPath || '')) {
throw new Error('httpPath must be a SQL warehouse path: /sql/1.0/warehouses/<id>');
} Try / catch
try {
const driver = new DatabricksDriver(config);
} catch (e) {
if (e.message === 'Could not extract warehouseId from httpPath') {
// replace cluster-style httpPath with a SQL warehouse httpPath
}
throw e;
} Prevention
- Always use a SQL Warehouse (not an all-purpose cluster) with this driver
- Copy httpPath verbatim, avoiding truncation/whitespace/escaping
- Add a startup assertion that httpPath matches the warehouse pattern
When it happens
Trigger: httpPath is present but does not contain /warehouses/<alphanumeric id> — e.g. it points to a cluster (/sql/1.0/clusters/...), is truncated, or contains unexpected characters.
Common situations: Using an all-purpose cluster httpPath instead of a SQL warehouse; copied httpPath missing the warehouse id suffix; extra whitespace or escaped characters breaking the regex.
Related errors
- Missing httpPath in JDBC URL
- Warehouse is being deleted (current state: ${data.state})
- drivername is required property
- url is required property
- A user-defined contextToApiScopes function returns an incons
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/fe699e76069ffc1a.
Report an issue: GitHub.