{"record":{"id":"ad082e15e9f0ab62","repo":"mem0ai/mem0","slug":"databricks-vector-store-requires-accesstoken-or-cl","errorCode":null,"errorMessage":"Databricks vector store requires accessToken or clientId/clientSecret when httpClient is not provided.","messagePattern":"Databricks vector store requires accessToken or clientId/clientSecret when httpClient is not provided\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/databricks.ts","lineNumber":895,"sourceCode":"      ALTER TABLE ${this.fullTableName}\n      SET TBLPROPERTIES ('delta.enableChangeDataFeed' = 'true')\n    `);\n  }\n\n  private createHttpClient(): AxiosInstance {\n    const baseURL = `${this.workspaceUrl}/api/2.0/vector-search`;\n\n    if (this.accessToken) {\n      return axios.create({\n        baseURL,\n        headers: {\n          Authorization: `Bearer ${this.accessToken}`,\n        },\n      });\n    }\n\n    if (!this.clientId || !this.clientSecret) {\n      throw new Error(\n        \"Databricks vector store requires accessToken or clientId/clientSecret when httpClient is not provided.\",\n      );\n    }\n\n    const baseClient = axios.create({ baseURL });\n    return {\n      get: async (url: string, config?: Record<string, any>) =>\n        baseClient.get(url, await this.withOAuthHeaders(\"GET\", url, config)),\n      post: async (url: string, data?: any, config?: Record<string, any>) =>\n        baseClient.post(\n          url,\n          data,\n          await this.withOAuthHeaders(\"POST\", url, config),\n        ),\n      delete: async (url: string, config?: Record<string, any>) =>\n        baseClient.delete(\n          url,\n          await this.withOAuthHeaders(\"DELETE\", url, config),","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/databricks.ts#L877-L913","documentation":"createHttpClient() builds the axios client for the Databricks Vector Search API. Without a user-supplied httpClient it needs credentials: an accessToken for PAT auth, or clientId/clientSecret for OAuth (service principal) auth. If none are present there is no way to authenticate, so it throws.","triggerScenarios":"Constructing the store with only host/catalog/schema but no accessToken and no clientId+clientSecret, and no custom httpClient — typically because DATABRICKS_TOKEN was unset in the environment the config was built from.","commonSituations":"Secrets present locally but missing in CI/deployment; using clientSecret with a missing clientId (both are required together); expecting the store to pick up ambient Databricks CLI auth, which it does not.","solutions":["Add accessToken: '<personal-access-token>' (or DATABRICKS_TOKEN) to the config","Or provide both clientId and clientSecret for a service principal (M2M OAuth)","For tests or custom transport, inject an httpClient matching the expected get/post interface"],"exampleFix":"// before\nnew Databricks({ host, catalog: 'main', schema: 'default' });\n\n// after\nnew Databricks({ host, accessToken: process.env.DATABRICKS_TOKEN!, catalog: 'main', schema: 'default' });","handlingStrategy":"validation","validationCode":"if (!cfg.httpClient && !cfg.accessToken && !(cfg.clientId && cfg.clientSecret)) {\n  throw new Error('Databricks config requires accessToken, clientId/clientSecret, or httpClient');\n}","typeGuard":"const hasDatabricksAuth = (c: any): boolean =>\n  Boolean(c?.httpClient) || Boolean(c?.accessToken) || Boolean(c?.clientId && c?.clientSecret);","tryCatchPattern":null,"preventionTips":["Check required secrets at boot (fail fast) with a config schema","Keep clientId and clientSecret paired — one without the other is never valid"],"tags":["databricks","authentication","configuration","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}