mem0ai/mem0 · error · Error
Cassandra vector store requires contactPoints when secureCon
Error message
Cassandra vector store requires contactPoints when secureConnectBundle is not provided.
What it means
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.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/cassandra.ts:341
INSERT INTO ${this.keyspace}.memory_migrations (id, user_id)
VALUES (?, ?)
`,
[MIGRATION_ROW_ID, userId],
{ prepare: true },
);
}
private async createClient(): Promise<CassandraClientLike> {
const driver = this.driver ?? (await this.loadDriver());
const clientConfig: Record<string, any> = {};
if (this.secureConnectBundle) {
clientConfig.cloud = {
secureConnectBundle: this.secureConnectBundle,
};
} else {
if (!this.contactPoints || this.contactPoints.length === 0) {
throw new Error(
"Cassandra vector store requires contactPoints when secureConnectBundle is not provided.",
);
}
if (!this.localDataCenter) {
throw new Error(
"Cassandra vector store requires localDataCenter when secureConnectBundle is not provided.",
);
}
clientConfig.contactPoints = this.contactPoints;
clientConfig.localDataCenter = this.localDataCenter;
clientConfig.protocolOptions = {
port: this.port,
};
}
if (this.protocolVersion !== undefined) {
clientConfig.protocolOptions = {
...(clientConfig.protocolOptions || {}),View on GitHub (pinned to 001c235229)
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
Example fix
// before
const store = new Cassandra({ collectionName: 'mem', embeddingDimensions: 1536 });
// after
const store = new Cassandra({
collectionName: 'mem',
embeddingDimensions: 1536,
contactPoints: ['127.0.0.1'],
localDataCenter: 'datacenter1',
}); Defensive patterns
Strategy: validation
Validate before calling
function assertCassandraConnect(config: any) {
const direct = !config.secureConnectBundle;
if (direct && (!Array.isArray(config.contactPoints) || config.contactPoints.length === 0)) {
throw new Error('Missing Cassandra contactPoints — set them or use secureConnectBundle');
}
} Try / catch
try { const store = new Cassandra(cfg); } catch (e) { if (e instanceof Error && e.message.includes('contactPoints')) { /* fix config */ } throw e; } Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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).
Related errors
- Cassandra vector store requires localDataCenter when secureC
- Unsupported vector store provider: ${provider}
- Invalid ${label} '${name}': only letters, digits, and unders
- Databricks vector store requires either workspaceUrl or host
- Both 'username' and 'password' must be provided together for
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/5bbb0520d9497695.
Report an issue: GitHub.