{"record":{"id":"b376354173e6c3d5","repo":"actualbudget/actual","slug":"invalid-source-raw-expected-true-fal","errorCode":null,"errorMessage":"Invalid ${source}: \"${raw}\". Expected \"true\", \"false\", \"1\", or \"0\".","messagePattern":"Invalid (.+?): \"(.+?)\"\\. Expected \"true\", \"false\", \"1\", or \"0\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/utils.ts","lineNumber":43,"sourceCode":"): number {\n  const parsed = parseIntFlag(value, flagName);\n  if (parsed < 0) {\n    throw new Error(\n      `Invalid ${flagName}: \"${value}\". Expected a non-negative integer.`,\n    );\n  }\n  return parsed;\n}\n\nexport function parseBoolEnv(\n  raw: string | undefined,\n  source: string,\n): boolean | undefined {\n  if (raw === undefined) return undefined;\n  const lower = raw.toLowerCase();\n  if (raw === '1' || lower === 'true') return true;\n  if (raw === '0' || lower === 'false') return false;\n  throw new Error(\n    `Invalid ${source}: \"${raw}\". Expected \"true\", \"false\", \"1\", or \"0\".`,\n  );\n}\n","sourceCodeStart":25,"sourceCodeEnd":47,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/cli/src/utils.ts#L25-L47","documentation":"parseBoolEnv parses an environment variable into a boolean, accepting \"1\", \"0\", and case-insensitive \"true\"/\"false\". Any other non-undefined value throws this error listing the accepted forms.","triggerScenarios":"The noLock-related env variable is set to something like \"yes\", \"on\", \"enabled\", or \" TRUE \" (with whitespace); undefined returns undefined without error.","commonSituations":"Users exporting VARIABLE=yes in shell profiles; CI config using on/off; trailing whitespace or quotes from .env files (\"true\\r\" or '\"true\"').","solutions":["Set the variable to 1, 0, true, or false.","Unset the variable entirely if you want the default behavior.","Clean .env files of quotes, whitespace, and Windows line endings (\\r)."],"exampleFix":"// before\nexport ACTUAL_NO_LOCK=yes\n// after\nexport ACTUAL_NO_LOCK=1","handlingStrategy":"validation","validationCode":"function isValidBoolEnv(raw: string | undefined): boolean {\n  if (raw === undefined) return true;\n  const lower = raw.toLowerCase();\n  return raw === '1' || raw === '0' || lower === 'true' || lower === 'false';\n}","typeGuard":null,"tryCatchPattern":"let noLock: boolean | undefined;\ntry {\n  noLock = parseBoolEnv(process.env.ACTUAL_NO_LOCK, 'ACTUAL_NO_LOCK');\n} catch (err) {\n  console.error((err as Error).message);\n  process.exit(1);\n}","preventionTips":["Only set boolean env vars to 1, 0, true, or false.","Check .env files for stray quotes, whitespace, and CRLF line endings.","Prefer 1/0 in CI configs to avoid case issues.","Validate env vars at startup with a schema tool (e.g. zod) for early failure."],"tags":["cli","environment","validation"],"backgroundTag":"invalid-env-var-value","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}