coder/code-server · error · Error
--idle-timeout-seconds must be greater than 60 seconds.
Error message
--idle-timeout-seconds must be greater than 60 seconds.
What it means
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.
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
Example fix
# before code-server --idle-timeout-seconds=30 # after code-server --idle-timeout-seconds=900
Defensive patterns
Strategy: validation
Validate before calling
function validateIdleTimeout(seconds: number): void {
if (!Number.isFinite(seconds)) throw new Error("idle-timeout-seconds must be a number")
if (seconds !== 0 && seconds <= 60) {
throw new Error(`idle-timeout-seconds must be > 60 (got ${seconds}); use 0 or omit to disable`)
}
}
// call before passing args to code-server
validateIdleTimeout(Number(args["idle-timeout-seconds"] ?? 0)) Prevention
- 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
When it happens
Trigger: Calling `code-server --idle-timeout-seconds=30` (or any numeric value <= 60), or `--idle-timeout-seconds=60` (the boundary, also rejected).
Common situations: Operators trying to tighten resource usage by setting a very short idle disconnect; typos dropping a digit (e.g. `600` -> `60`).
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- --cert-key is missing
- --github-auth can only be set in the config file or passed…
- --hashed-password can only be set in the config file or…
- -- requires a value
- No opened code-server instances found to handle
AI-assisted analysis of coder/code-server@8a7bf87a4d (2026-09-22).
Data as JSON: /api/errors/cabdd57b4e16ec4e.
Report an issue: GitHub.
Appendix: source
Thrown at src/node/cli.ts:452
;(args[key] as boolean) = true
continue
}
// Might already have a value if it was the --long=value format.
if (typeof value === "undefined") {
// A value is only valid if it doesn't look like an option.
value = argv[i + 1] && !argv[i + 1].startsWith("-") ? argv[++i] : undefined
}
if (!value && option.type === OptionalString) {
;(args[key] as OptionalString) = new OptionalString(value)
continue
} else if (!value) {
throw error(`--${key} requires a value`)
}
if (key === "idle-timeout-seconds" && Number(value) <= 60) {
throw new Error("--idle-timeout-seconds must be greater than 60 seconds.")
}
if (option.type === OptionalString && value === "false") {
continue
}
if (option.path) {
value = path.resolve(value)
}
switch (option.type) {
case "string":
;(args[key] as string) = value
break
case "string[]":
if (!args[key]) {
;(args[key] as string[]) = []
}View on GitHub (pinned to 8a7bf87a4d)