{"record":{"id":"5fa7314a24de2444","repo":"overleaf/overleaf","slug":"split-test-splittestname-not-found","errorCode":null,"errorMessage":"Split test '${splitTestName}' not found","messagePattern":"Split test '(.+?)' not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/web/scripts/insert_feature_flag_alpha_phase_0.mjs","lineNumber":69,"sourceCode":"      i--\n      j--\n    } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {\n      result.unshift(`${GREEN}+ ${bLines[j - 1]}${RESET}`)\n      j--\n    } else {\n      result.unshift(`${RED}- ${aLines[i - 1]}${RESET}`)\n      i--\n    }\n  }\n\n  return result.join('\\n')\n}\n\nasync function main() {\n  const splitTest = await db.splittests.findOne({ name: splitTestName })\n\n  if (!splitTest) {\n    throw new Error(`Split test '${splitTestName}' not found`)\n  }\n\n  if (!splitTest.versions || splitTest.versions.length === 0) {\n    throw new Error(`Split test '${splitTestName}' has no versions`)\n  }\n\n  const firstVersion = splitTest.versions[0]\n\n  const newVersion = {\n    ...firstVersion,\n    versionNumber: 1,\n    phase: 'alpha',\n    active: true,\n    variants: firstVersion.variants.map(v => ({\n      ...v,\n      rolloutPercent: 0,\n      rolloutStripes: [],\n    })),","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/web/scripts/insert_feature_flag_alpha_phase_0.mjs#L51-L87","documentation":"Precondition failure in the feature-flag migration script's main(): no document in the splittests Mongo collection matches the configured splitTestName, so the script cannot derive a version to convert into a feature flag. Check the script's splitTestName constant against the database.","triggerScenarios":"Thrown at services/web/scripts/insert_feature_flag_alpha_phase_0.mjs:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the splitTestName constant matches an existing entry in the splittests collection","Run against the correct database/environment","Fix the name typo and re-run the script"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}