{"record":{"id":"5fc540e9317b4978","repo":"mem0ai/mem0","slug":"weaviatedb-clusterurl-is-required-when-client-and","errorCode":null,"errorMessage":"WeaviateDB: clusterUrl is required when client and apiKey are not provided","messagePattern":"WeaviateDB: clusterUrl is required when client and apiKey are not provided","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/weaviate.ts","lineNumber":77,"sourceCode":"    this._sdk = sdk;\n\n    const { client, clusterUrl, apiKey, additionalHeaders } = this._config;\n    const weaviate = sdk.default;\n\n    if (client) {\n      this._client = client;\n    } else if (clusterUrl?.includes(\"localhost\")) {\n      this._client = await weaviate.connectToLocal({\n        headers: additionalHeaders,\n      });\n    } else if (apiKey) {\n      this._client = await weaviate.connectToWeaviateCloud(clusterUrl!, {\n        authCredentials: new weaviate.ApiKey(apiKey),\n        headers: additionalHeaders,\n      });\n    } else {\n      if (!clusterUrl) {\n        throw new Error(\n          \"WeaviateDB: clusterUrl is required when client and apiKey are not provided\",\n        );\n      }\n      const parsed = new URL(clusterUrl);\n      const httpSecure = parsed.protocol === \"https:\";\n      this._client = await weaviate.connectToCustom({\n        httpHost: parsed.hostname,\n        httpPort: parsed.port\n          ? parseInt(parsed.port, 10)\n          : httpSecure\n            ? 443\n            : 8080,\n        httpSecure,\n        grpcHost: parsed.hostname,\n        grpcPort: 50051,\n        grpcSecure: false,\n        headers: additionalHeaders,\n      });","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/weaviate.ts#L59-L95","documentation":"Error \"WeaviateDB: clusterUrl is required when client and apiKey are not provided\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0-ts/src/oss/src/vector_stores/weaviate.ts:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide clusterUrl in the Weaviate config (e.g. http://localhost:8080 or your WCD cluster URL).","Alternatively pass a pre-configured Weaviate client via the client field together with apiKey if needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}