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

  1. Add MONGO_EXTRA_ARGS=--notablescan in config/local.env and restart mongo with `internal$ bin/up mongo`
  2. Or run the wrapper `internal$ bin/e2e_test_setup`, which starts mongo with the right flags before running the setup
  3. 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

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


AI-assisted analysis of overleaf/overleaf@28ad3b03b7 (2026-09-03). Data as JSON: /api/errors/0cf740bd3c2e3fad. Report an issue: GitHub.