stamparm/maltrail · error · ConfigError

invalid configuration value for 'UPDATE_PERIOD

Error message

invalid configuration value for 'UPDATE_PERIOD' ('{}')

What it means

UPDATE_PERIOD must parse as an unsigned 64-bit integer via get_u64. When it is absent or not a valid u64, the match falls to None and the loader bails, interpolating the raw string value that failed to parse.

Solutions

  1. Set UPDATE_PERIOD to a bare integer number of the expected unit, e.g. UPDATE_PERIOD=30.
  2. Convert duration strings to plain integers (5m -> 300, 1h -> 3600).
  3. Remove quotes, whitespace, units, or inline comments from the value.
  4. Check the sensor docs for which time unit the integer denotes.

Example fix

// before (config.conf)
UPDATE_PERIOD=30s

// after (config.conf)
UPDATE_PERIOD=30
Defensive patterns

Strategy: validation

Validate before calling

let v = get_str(&raw, "UPDATE_PERIOD");
if v.parse::<u64>().is_err() {
    eprintln!("UPDATE_PERIOD must be a plain integer, got '{v}'");
}

Prevention

When it happens

Trigger: Setting UPDATE_PERIOD to a non-numeric string (e.g. "30s", "1h"), a negative number, or a value with units/suffixes that get_u64 cannot parse; also an empty UPDATE_PERIOD= line.

Common situations: Admins writing duration strings like '5m' because other tools accept them; copying a value with a trailing space or comment; deleting the numeric part while editing, or using a float like 1.5.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of stamparm/maltrail@77cfb06d76 (2026-09-13). Data as JSON: /api/errors/ec1c13603a11054d. Report an issue: GitHub.

Appendix: source

Thrown at sensor/src/config.rs:801

        for endpoint in split_endpoints(&syslog_server) {
            if parse_host_port(endpoint).1.is_none() {
                bail!("invalid configuration value for 'SYSLOG_SERVER' ('{endpoint}')");
            }
        }
        let logstash_server = get_str(&raw, "LOGSTASH_SERVER");
        for endpoint in split_endpoints(&logstash_server) {
            if parse_host_port(endpoint).1.is_none() {
                bail!("invalid configuration value for 'LOGSTASH_SERVER' ('{endpoint}')");
            }
        }
        let remote_severity_regex = get_str(&raw, "REMOTE_SEVERITY_REGEX");
        if !remote_severity_regex.is_empty() && crate::pyre::build_fancy(&remote_severity_regex).is_err() {
            bail!("invalid configuration value for 'REMOTE_SEVERITY_REGEX' ('{remote_severity_regex}')");
        }

        let update_period = match get_u64(&raw, "UPDATE_PERIOD") {
            Some(v) => v,
            None => bail!("invalid configuration value for 'UPDATE_PERIOD' ('{}')", get_str(&raw, "UPDATE_PERIOD")),
        };

        let user_whitelist = {
            let v = get_str(&raw, "USER_WHITELIST");
            if v.is_empty() {
                None
            } else if v.contains(',') {
                crate::cprintln!("[x] configuration value 'USER_WHITELIST' has been changed. Please use it to set location of whitelist file");
                None
            } else {
                let p = normalize_path(&root, &v);
                if !p.is_file() {
                    bail!("missing 'USER_WHITELIST' file '{}'", p.display());
                }
                Some(p)
            }
        };
        let user_ignorelist = {

View on GitHub (pinned to 77cfb06d76)