overleaf/overleaf · error
mongo is running without --notablescan
Error message
mongo is running without --notablescan
What it means
This setup script for e2e tests verifies that the local MongoDB instance is started with the --notablescan flag, which disables slow-query table-scan warnings/errors. If the running mongod was started without it, the checkNoTableScan helper logs fix instructions and throws so the developer reconfigures their dev MongoDB before provisioning e2e data.
Source
Thrown at services/web/scripts/e2e_test_setup.mjs:215
}
async function checkNoTableScan() {
const client = await connectionPromise
const { notablescan } = await client
.db()
.admin()
.command({ getParameter: 1, notablescan: 1 })
if (!notablescan) {
console.error()
console.error('!!! mongo is running without --notablescan')
console.error()
console.error('To fix this, either')
console.error('- run "internal$ bin/e2e_test_setup"')
console.error(
'- or add MONGO_EXTRA_ARGS=--notablescan in config/local.env and apply with "internal$ bin/up mongo"'
)
console.error()
throw new Error('mongo is running without --notablescan')
}
}
async function main() {
if (process.env.NODE_ENV !== 'development') {
throw new Error('only available in dev-env')
}
await checkNoTableScan()
await Promise.all([purgeNewUsers(), provisionUsers(), provisionSplitTests()])
}
if (import.meta.main) {
await main()
await GracefulShutdown.gracefulShutdown()
}
View on GitHub (pinned to 28ad3b03b7)
Solutions
- Add MONGO_EXTRA_ARGS=--notablescan in config/local.env and restart mongo with `internal$ bin/up mongo`
- Or run the wrapper `internal$ bin/e2e_test_setup`, which starts mongo with the right flags before running the setup
- Verify with `ps aux | grep mongod` (or docker inspect) that --notablescan is present before rerunning
Example fix
# before (config/local.env) # MONGO_EXTRA_ARGS not set # after MONGO_EXTRA_ARGS=--notablescan
Defensive patterns
Strategy: validation
Validate before calling
// check mongod flags before running the setup
const { execSync } = require('child_process')
const ps = execSync('ps aux | grep [m]ongod || docker inspect mongo').toString()
if (!ps.includes('--notablescan')) {
throw new Error('start mongo with --notablescan (MONGO_EXTRA_ARGS=--notablescan in config/local.env, then bin/up mongo)')
} Prevention
- Always start dev mongo via bin/up mongo with MONGO_EXTRA_ARGS=--notablescan in config/local.env
- Use the bin/e2e_test_setup wrapper instead of starting mongod manually
- Keep config/local.env committed to your team's onboarding doc so the flag is never lost
When it happens
Trigger: Running `node services/web/scripts/e2e_test_setup.mjs` (or bin/e2e_test_setup) while the local mongo container/process lacks --notablescan in its arguments (e.g. mongo started manually or via bin/up without MONGO_EXTRA_ARGS set).
Common situations: Fresh clone where the developer started mongo manually with docker run or mongod directly; resetting config/local.env and losing MONGO_EXTRA_ARGS; switching from a teammate's setup script to a plain mongo startup.
Related errors
- unknown default cipherLabel ${settings.cipherLabel}
- Unknown metric type: ${type}
- FS backend does not support storage classes
- Use default bucket class for GCS instead of settings.storage
- Unrecognised value for retryOptions.idempotencyStrategy
AI-assisted analysis of overleaf/overleaf@28ad3b03b7 (2026-09-03).
Data as JSON: /api/errors/0cf740bd3c2e3fad.
Report an issue: GitHub.