{"record":{"id":"5bbb0520d9497695","repo":"mem0ai/mem0","slug":"cassandra-vector-store-requires-contactpoints-when","errorCode":null,"errorMessage":"Cassandra vector store requires contactPoints when secureConnectBundle is not provided.","messagePattern":"Cassandra vector store requires contactPoints when secureConnectBundle is not provided\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/cassandra.ts","lineNumber":341,"sourceCode":"        INSERT INTO ${this.keyspace}.memory_migrations (id, user_id)\n        VALUES (?, ?)\n      `,\n      [MIGRATION_ROW_ID, userId],\n      { prepare: true },\n    );\n  }\n\n  private async createClient(): Promise<CassandraClientLike> {\n    const driver = this.driver ?? (await this.loadDriver());\n    const clientConfig: Record<string, any> = {};\n\n    if (this.secureConnectBundle) {\n      clientConfig.cloud = {\n        secureConnectBundle: this.secureConnectBundle,\n      };\n    } else {\n      if (!this.contactPoints || this.contactPoints.length === 0) {\n        throw new Error(\n          \"Cassandra vector store requires contactPoints when secureConnectBundle is not provided.\",\n        );\n      }\n      if (!this.localDataCenter) {\n        throw new Error(\n          \"Cassandra vector store requires localDataCenter when secureConnectBundle is not provided.\",\n        );\n      }\n      clientConfig.contactPoints = this.contactPoints;\n      clientConfig.localDataCenter = this.localDataCenter;\n      clientConfig.protocolOptions = {\n        port: this.port,\n      };\n    }\n\n    if (this.protocolVersion !== undefined) {\n      clientConfig.protocolOptions = {\n        ...(clientConfig.protocolOptions || {}),","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/cassandra.ts#L323-L359","documentation":"The Cassandra vector store builds its client config in createClient(). When no secureConnectBundle is configured it must connect directly to a cluster, which requires an explicit list of contact points. If contactPoints is missing or an empty array at client creation time, this error is thrown before any network call happens.","triggerScenarios":"Constructing the Cassandra vector store (directly or via Memory with vectorStore.provider='cassandra') without config.contactPoints and without config.secureConnectBundle; or passing contactPoints: [] (e.g. contactPoints: process.env.CASSANDRA_CONTACT_POINTS?.split(',') which yields undefined/empty).","commonSituations":"Env var for contact points not set in the deployment environment; copying a config example that used Astra DB (secureConnectBundle) and switching to self-hosted Cassandra without adding contactPoints; typo in the config key (contactPoint vs contactPoints).","solutions":["Add contactPoints to the vector store config, e.g. contactPoints: ['127.0.0.1'] or ['cassandra-1','cassandra-2']","Or, if targeting DataStax Astra, provide secureConnectBundle instead of contactPoints","Check that the env var feeding contactPoints is set and splits into a non-empty array"],"exampleFix":"// before\nconst store = new Cassandra({ collectionName: 'mem', embeddingDimensions: 1536 });\n\n// after\nconst store = new Cassandra({\n  collectionName: 'mem',\n  embeddingDimensions: 1536,\n  contactPoints: ['127.0.0.1'],\n  localDataCenter: 'datacenter1',\n});","handlingStrategy":"validation","validationCode":"function assertCassandraConnect(config: any) {\n  const direct = !config.secureConnectBundle;\n  if (direct && (!Array.isArray(config.contactPoints) || config.contactPoints.length === 0)) {\n    throw new Error('Missing Cassandra contactPoints — set them or use secureConnectBundle');\n  }\n}","typeGuard":null,"tryCatchPattern":"try { const store = new Cassandra(cfg); } catch (e) { if (e instanceof Error && e.message.includes('contactPoints')) { /* fix config */ } throw e; }","preventionTips":["Validate config at startup with a schema (zod) requiring contactPoints when secureConnectBundle is absent","Fail fast on empty env-derived arrays before constructing the store"],"tags":["cassandra","configuration","vector-store","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}