n8n-io/n8n · error · NodeOperationError
Database name must be provided either in credentials or in n
Error message
Database name must be provided either in credentials or in node parameters
What it means
Error "Database name must be provided either in credentials or in node parameters" thrown in n8n-io/n8n.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.ts:126
} else {
// Build connection string from individual fields
const host = credentials.host;
const port = credentials.port;
const user = credentials.user ? encodeURIComponent(credentials.user) : '';
const password = credentials.password ? encodeURIComponent(credentials.password) : '';
const authString = user && password ? `${user}:${password}@` : '';
const tls = credentials.tls;
connectionString = `mongodb://${authString}${host}:${port}/?appname=n8n`;
if (tls) {
connectionString += '&ssl=true';
}
dbName = databaseName || credentials.database;
}
if (!dbName) {
throw new NodeOperationError(
this.getNode(),
'Database name must be provided either in credentials or in node parameters',
);
}
const client = new MongoClient(connectionString, {
minPoolSize: 0,
maxPoolSize: 1,
maxIdleTimeMS: 30000,
});
try {
await client.connect();
const db = client.db(dbName);
const collection = db.collection(collectionName);
const mongoDBChatHistory = new MongoDBChatMessageHistory({View on GitHub (pinned to 5ac6606e81)
When it happens
Trigger: Thrown at packages/@n8n/nodes-langchain/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.ts:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/aec27c9e00faf771.
Report an issue: GitHub.