shadowsocks/shadowsocks-windows · warning · ArgumentException
Timeout is invalid, it should not exceed {0}
Error message
Timeout is invalid, it should not exceed {0} What it means
ArgumentException thrown by CheckTimeout when timeout <= 0 or timeout > maxTimeout. The timeout governs socket I/O idle limits; an invalid value either disables timeouts (<=0) or exceeds the configured ceiling (maxTimeout). The {0} placeholder is filled with maxTimeout at throw time via I18N.GetString.
Source
Thrown at shadowsocks-csharp/Model/Configuration.cs:380
throw new ArgumentException(I18N.GetString("Port can't be 8123"));
}
private static void CheckPassword(string password)
{
if (string.IsNullOrEmpty(password))
throw new ArgumentException(I18N.GetString("Password can not be blank"));
}
public static void CheckServer(string server)
{
if (string.IsNullOrEmpty(server))
throw new ArgumentException(I18N.GetString("Server IP can not be blank"));
}
public static void CheckTimeout(int timeout, int maxTimeout)
{
if (timeout <= 0 || timeout > maxTimeout)
throw new ArgumentException(
I18N.GetString("Timeout is invalid, it should not exceed {0}", maxTimeout));
}
}
}
View on GitHub (pinned to 891d971682)
Solutions
- Set the timeout to a positive value within maxTimeout (commonly a few hundred seconds).
- If a larger timeout is required, confirm maxTimeout allows it or raise the cap in your build.
- Use the GUI spinner which clamps the input to the valid range.
Example fix
// before Configuration.CheckTimeout(0, maxTimeout: 600); // after Configuration.CheckTimeout(120, maxTimeout: 600);
Defensive patterns
Strategy: validation
Validate before calling
if (timeout <= 0 || timeout > maxTimeout) {
// surface error in UI before calling CheckTimeout
return;
} Try / catch
try { Configuration.CheckTimeout(timeout, maxTimeout); }
catch (ArgumentException ex) { /* show ex.Message, keep the dialog open */ } Prevention
- Use a numeric up-down clamped to 1..maxTimeout.
- Display maxTimeout in the field label so the ceiling is obvious.
When it happens
Trigger: Config timeout set to 0 or a negative value. Timeout larger than the maxTimeout passed in (often derived from the cipher's safe range). A hand-edited gui-config.json with an out-of-range timeout.
Common situations: Copying a server config that set a very large timeout. Resetting the timeout to 0 by accident. A build where maxTimeout was lowered but old configs exceed it.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Unknown forward proxy.
- Port out of range
- Port can't be 8123
- Password can not be blank
- Server IP can not be blank
AI-assisted analysis of shadowsocks/shadowsocks-windows@891d971682 (2026-08-13).
Data as JSON: /api/errors/577076e344fc86b0.
Report an issue: GitHub.