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.

Source

Thrown at src/node/cli.ts:419

      if (!key || !options[key]) {
        throw error(`Unknown option ${arg}`)
      }

      if (key === "password" && !opts?.configFile) {
        throw new Error("--password can only be set in the config file or passed in via $PASSWORD")
      }

      if (key === "hashed-password" && !opts?.configFile) {
        throw new Error("--hashed-password can only be set in the config file or passed in via $HASHED_PASSWORD")
      }

      if (key === "github-auth" && !opts?.configFile) {
        throw new Error("--github-auth can only be set in the config file or passed in via $GITHUB_TOKEN")
      }

      if (key === "idle-timeout-seconds" && Number(value) <= 60) {
        throw new Error("--idle-timeout-seconds must be greater than 60 seconds.")
      }

      const option = options[key]
      if (option.type === "boolean") {
        ;(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) {

View on GitHub (pinned to 51f90a376b)

Solutions

  1. Set a value greater than 60, e.g. `--idle-timeout-seconds=900` (15 minutes)
  2. To disable idle disconnect entirely, omit the flag (the default is 0/disabled)
  3. 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

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

Related errors


AI-assisted analysis of coder/code-server@51f90a376b (2026-08-12). Data as JSON: /api/errors/cabdd57b4e16ec4e. Report an issue: GitHub.