{"record":{"id":"27168e2abdd229e1","repo":"mem0ai/mem0","slug":"databricks-vector-store-requires-either-workspaceu","errorCode":null,"errorMessage":"Databricks vector store requires either workspaceUrl or host.","messagePattern":"Databricks vector store requires either workspaceUrl or host\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/databricks.ts","lineNumber":116,"sourceCode":"  host: string;\n  workspaceUrl: string;\n} {\n  if (config.workspaceUrl) {\n    const url = new URL(config.workspaceUrl);\n    return {\n      host: url.host,\n      workspaceUrl: `${url.protocol}//${url.host}`,\n    };\n  }\n\n  if (config.host) {\n    return {\n      host: config.host,\n      workspaceUrl: `https://${config.host}`,\n    };\n  }\n\n  throw new Error(\n    \"Databricks vector store requires either workspaceUrl or host.\",\n  );\n}\n\n// `Memory.search()` hands keywordSearch() an already-lemmatized query, so BM25 has to score\n// against lemmatized text. Same contract as baidu.ts / pgvector.ts.\nfunction lemmatizedText(payload: Record<string, any>): string {\n  const data = typeof payload.data === \"string\" ? payload.data : \"\";\n  return typeof payload.textLemmatized === \"string\" &&\n    payload.textLemmatized.length > 0\n    ? payload.textLemmatized\n    : data;\n}\n\nfunction formatSqlValue(value: any): string {\n  if (value === null || value === undefined) {\n    return \"NULL\";\n  }","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/databricks.ts#L98-L134","documentation":"extractHostAndWorkspaceUrl() derives the workspace URL used for every Management/Vector Search API call. It first tries config.workspaceUrl, then config.host, and throws if neither is set — the store has no endpoint to talk to.","triggerScenarios":"Constructing the Databricks vector store with neither workspaceUrl nor host in the config, e.g. both left undefined because the env vars were not read (DATABRICKS_HOST unset).","commonSituations":"Missing DATABRICKS_HOST / DATABRICKS_URL in the deployment environment; passing the host inside an auth sub-object or wrong key ('serverUrl', 'workspace'); config built from a partial env where the key is optional and skipped.","solutions":["Set host: 'adb-1234567890123456.7.azuredatabricks.net' (or your cloud's equivalent) in the vector store config","Or set workspaceUrl: 'https://adb-....azuredatabricks.net' — both forms are accepted","If config comes from env, ensure the variable is present and fail config loading early when it is missing"],"exampleFix":"// before\nnew Databricks({ accessToken, catalog: 'main', schema: 'default' });\n\n// after\nnew Databricks({\n  host: 'adb-1234567890123456.7.azuredatabricks.net',\n  accessToken,\n  catalog: 'main',\n  schema: 'default',\n});","handlingStrategy":"validation","validationCode":"if (!cfg.workspaceUrl && !cfg.host) {\n  throw new Error('Databricks config requires workspaceUrl or host');\n}","typeGuard":"const hasDatabricksHost = (c: any): boolean => Boolean(c?.workspaceUrl || c?.host);","tryCatchPattern":null,"preventionTips":["Make host a required field in a zod schema for the config object","Fail startup when DATABRICKS_HOST is unset rather than passing undefined"],"tags":["databricks","configuration","vector-store","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}