{"record":{"id":"cabdd57b4e16ec4e","repo":"coder/code-server","slug":"idle-timeout-seconds-must-be-greater-than-60-sec","errorCode":null,"errorMessage":"--idle-timeout-seconds must be greater than 60 seconds.","messagePattern":"--idle-timeout-seconds must be greater than 60 seconds\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/node/cli.ts","lineNumber":419,"sourceCode":"\n      if (!key || !options[key]) {\n        throw error(`Unknown option ${arg}`)\n      }\n\n      if (key === \"password\" && !opts?.configFile) {\n        throw new Error(\"--password can only be set in the config file or passed in via $PASSWORD\")\n      }\n\n      if (key === \"hashed-password\" && !opts?.configFile) {\n        throw new Error(\"--hashed-password can only be set in the config file or passed in via $HASHED_PASSWORD\")\n      }\n\n      if (key === \"github-auth\" && !opts?.configFile) {\n        throw new Error(\"--github-auth can only be set in the config file or passed in via $GITHUB_TOKEN\")\n      }\n\n      if (key === \"idle-timeout-seconds\" && Number(value) <= 60) {\n        throw new Error(\"--idle-timeout-seconds must be greater than 60 seconds.\")\n      }\n\n      const option = options[key]\n      if (option.type === \"boolean\") {\n        ;(args[key] as boolean) = true\n        continue\n      }\n\n      // Might already have a value if it was the --long=value format.\n      if (typeof value === \"undefined\") {\n        // A value is only valid if it doesn't look like an option.\n        value = argv[i + 1] && !argv[i + 1].startsWith(\"-\") ? argv[++i] : undefined\n      }\n\n      if (!value && option.type === OptionalString) {\n        ;(args[key] as OptionalString) = new OptionalString(value)\n        continue\n      } else if (!value) {","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/coder/code-server/blob/51f90a376b42e217b38937410fe2855e0c1db87e/src/node/cli.ts#L401-L437","documentation":"The CLI enforces that --idle-timeout-seconds be strictly greater than 60 (cli.ts:419). A timeout of 60 seconds or fewer would disconnect idle sessions so aggressively that legitimate pauses (compiling, reading) would drop the connection, so it is rejected at parse time.","triggerScenarios":"Calling `code-server --idle-timeout-seconds=30` (or any numeric value <= 60), or `--idle-timeout-seconds=60` (the boundary, also rejected).","commonSituations":"Operators trying to tighten resource usage by setting a very short idle disconnect; typos dropping a digit (e.g. `600` -> `60`).","solutions":["Set a value greater than 60, e.g. `--idle-timeout-seconds=900` (15 minutes)","To disable idle disconnect entirely, omit the flag (the default is 0/disabled)","Double-check the intended value if you copied it from a runbook"],"exampleFix":"# before\ncode-server --idle-timeout-seconds=30\n\n# after\ncode-server --idle-timeout-seconds=900","handlingStrategy":"validation","validationCode":"function validateIdleTimeout(seconds: number): void {\n  if (!Number.isFinite(seconds)) throw new Error(\"idle-timeout-seconds must be a number\")\n  if (seconds !== 0 && seconds <= 60) {\n    throw new Error(`idle-timeout-seconds must be > 60 (got ${seconds}); use 0 or omit to disable`)\n  }\n}\n// call before passing args to code-server\nvalidateIdleTimeout(Number(args[\"idle-timeout-seconds\"] ?? 0))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat 0/omitted as 'disabled' and any positive value as needing > 60","Centralize timeout validation in a config helper so all entry points share it","Document the lower bound in your deployment runbook"],"tags":["cli","validation","configuration","session"],"backgroundTag":null,"analyzedSha":"51f90a376b42e217b38937410fe2855e0c1db87e","analyzedAt":"2026-08-12T11:27:34.273Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}