{"record":{"id":"8bc3e3b9d19f2833","repo":"mem0ai/mem0","slug":"databricks-oauth-token-response-did-not-include-ac","errorCode":null,"errorMessage":"Databricks OAuth token response did not include access_token.","messagePattern":"Databricks OAuth token response did not include access_token\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/databricks.ts","lineNumber":1003,"sourceCode":"    }\n\n    const response = await axios.post(\n      `${this.workspaceUrl}/oidc/v1/token`,\n      formData,\n      {\n        auth: {\n          username: this.clientId,\n          password: this.clientSecret,\n        },\n        headers: {\n          \"Content-Type\": \"application/x-www-form-urlencoded\",\n        },\n      },\n    );\n\n    const token = response?.data?.access_token;\n    if (typeof token !== \"string\" || token.length === 0) {\n      throw new Error(\n        \"Databricks OAuth token response did not include access_token.\",\n      );\n    }\n\n    const expiresInSeconds = Number(response?.data?.expires_in ?? 3600);\n    this.oauthTokens.set(cacheKey, {\n      accessToken: token,\n      expiresAt: Date.now() + Math.max(1, expiresInSeconds) * 1000,\n    });\n    return token;\n  }\n\n  private async getSession(): Promise<DatabricksSqlSessionLike> {\n    if (this.session) {\n      return this.session;\n    }\n\n    if (!this._sessionPromise) {","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/databricks.ts#L985-L1021","documentation":"After a successful HTTP round-trip to the Databricks OAuth token endpoint, the response body must contain a non-empty string access_token. If the field is missing, not a string, or empty, the store refuses to cache or use it and throws.","triggerScenarios":"clientId/clientSecret are accepted by the proxy/network layer but the endpoint returns an unexpected body — e.g. an HTML error page from a corporate proxy, a 200 response with an error payload, or an API change in the token response shape.","commonSituations":"Corporate proxies or middleboxes intercepting the token request; a misconfigured auth URL; Databricks returning an error envelope with 200; clientId/secret valid enough to avoid a 4xx but scoped incorrectly.","solutions":["Verify clientId/clientSecret are correct service-principal credentials with access to the workspace","Check network path for proxies rewriting the response; capture response.data to inspect what actually came back","If the environment blocks OAuth, fall back to a personal access token via accessToken"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await store.search(q, 5); } catch (e) { if (e instanceof Error && e.message.includes('access_token')) { logTokenEndpointDiagnostics(); // inspect proxy/network path, verify SP credentials } throw e; }","preventionTips":["Verify service-principal credentials in a small isolated script before wiring into the app","Watch for proxies intercepting *.databricks.com token endpoints"],"tags":["databricks","oauth","authentication","network"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}