netdata/netdata · error
invalid value for --timeout '%s'; expected seconds
Error message
invalid value for --timeout '%s'; expected seconds
What it means
First --timeout validation failure in the network-viewer.plugin test CLI: the value contains a character outside ASCII '0'-'9' — a sign, decimal point, unit suffix, or whitespace. Exit status 2 with usage.
Source
Thrown at src/collectors/network-viewer.plugin/network-viewer.c:7039
}
static int network_viewer_set_timeout_option_once(uint64_t *slot, bool *slot_set, const char *value)
{
if(*slot_set) {
fprintf(stderr, "duplicate --timeout\n");
network_viewer_test_usage(stderr);
return 2;
}
if(!value || !*value) {
fprintf(stderr, "missing value for --timeout\n");
network_viewer_test_usage(stderr);
return 2;
}
for(const char *s = value; *s; s++) {
if(*s < '0' || *s > '9') {
fprintf(stderr, "invalid value for --timeout '%s'; expected seconds\n", value);
network_viewer_test_usage(stderr);
return 2;
}
}
errno = 0;
unsigned long long parsed = strtoull(value, NULL, 10);
if(errno == ERANGE) {
fprintf(stderr, "invalid value for --timeout '%s'; expected seconds\n", value);
network_viewer_test_usage(stderr);
return 2;
}
#if ULLONG_MAX > UINT64_MAX
if(parsed > UINT64_MAX) {
fprintf(stderr, "invalid value for --timeout '%s'; expected seconds\n", value);
network_viewer_test_usage(stderr);
return 2;View on GitHub (pinned to 4864de85e2)
Solutions
- Use an integer seconds value: `--timeout=10`
- Convert unit strings to plain seconds in the calling script before passing them
Example fix
# before network-viewer.plugin --test=network-viewer --timeout=10s # after network-viewer.plugin --test=network-viewer --timeout=10
Defensive patterns
Strategy: validation
Validate before calling
is_uint() { case "$1" in ''|*[!0-9]*) return 1;; *) return 0;; esac; }
is_uint "$TIMEOUT" || { echo "timeout must be plain integer seconds" >&2; exit 2; } Prevention
- Never pass unit-suffixed durations ('10s') — this CLI wants bare seconds
- Strip units/convert to seconds in the calling script before building the command
When it happens
Trigger: Passing `--timeout=10s`, `--timeout=0.5`, `--timeout=-1`, or a value with an embedded space.
Common situations: Reusing durations written in netdata.conf unit syntax ('10s', '1m') where this CLI accepts bare integer seconds only.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- invalid value for --timeout '%s'; expected seconds
- duplicate --timeout
- missing value for --timeout
- duplicate --timeout
- missing value for --timeout
AI-assisted analysis of netdata/netdata@4864de85e2 (2026-08-15).
Data as JSON: /api/errors/263badba3e9e55e7.
Report an issue: GitHub.