{"record":{"id":"fe699e76069ffc1a","repo":"cube-js/cube","slug":"could-not-extract-warehouseid-from-httppath","errorCode":null,"errorMessage":"Could not extract warehouseId from httpPath","messagePattern":"Could not extract warehouseId from httpPath","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/cubejs-databricks-jdbc-driver/src/helpers.ts","lineNumber":79,"sourceCode":"  const [hostPortAndPath, ...params] = urlWithoutPrefix.split(';');\n  const [host] = hostPortAndPath.split(':');\n\n  const paramMap = new Map<string, string>();\n  for (const param of params) {\n    const [key, value] = param.split('=');\n    if (key && value) {\n      paramMap.set(key, value);\n    }\n  }\n\n  const httpPath = paramMap.get('httpPath');\n  if (!httpPath) {\n    throw new Error('Missing httpPath in JDBC URL');\n  }\n\n  const warehouseMatch = httpPath.match(/\\/warehouses\\/([a-zA-Z0-9]+)/);\n  if (!warehouseMatch) {\n    throw new Error('Could not extract warehouseId from httpPath');\n  }\n\n  const warehouseId = warehouseMatch[1];\n\n  return { host, warehouseId };\n}\n","sourceCodeStart":61,"sourceCodeEnd":86,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-databricks-jdbc-driver/src/helpers.ts#L61-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nhttpPath=/sql/1.0/clusters/0717-211111-abcdef\n// after\nhttpPath=/sql/1.0/warehouses/0f1a2b3c4d5e6f78","handlingStrategy":"validation","validationCode":"const httpPath = url.match(/httpPath=([^;]+)/)?.[1];\nif (!/^\\/sql\\/1\\.0\\/warehouses\\/[a-zA-Z0-9]+$/.test(httpPath || '')) {\n  throw new Error('httpPath must be a SQL warehouse path: /sql/1.0/warehouses/<id>');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const driver = new DatabricksDriver(config);\n} catch (e) {\n  if (e.message === 'Could not extract warehouseId from httpPath') {\n    // replace cluster-style httpPath with a SQL warehouse httpPath\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["configuration","jdbc","url-parsing","warehouse"],"backgroundTag":"invalid-jdbc-http-path","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}