stamparm/maltrail · error · ConfigError

missing 'USER_IGNORELIST' file

Error message

missing 'USER_IGNORELIST' file '{}'

What it means

Configuration validation in the sensor's config loader: the USER_IGNORELIST entry must resolve, after normalize_path(root, v), to an existing regular file, because the sensor reads the ignorelist from disk at startup to filter user activity. This fires when the ignorelist path is empty-resolved to a missing file, the filename is misspelled, the file was deleted/moved, or the path is relative to the wrong root. Using anyhow's bail!, it aborts configuration processing so the sensor never runs with a silently empty ignorelist. Fix by correcting the USER_IGNORELIST path in the config to point at an existing file (or removing the entry if the section legitimately resolves to None).

Solutions

  1. Create the ignore-list file at the path shown in the error or correct the USER_IGNORELIST value.
  2. Use an absolute path to avoid dependence on the config root resolution.
  3. Verify the path refers to a regular file and that the sensor user can stat/read it.
  4. Remove or empty the option if no ignore list is needed.

Example fix

// before (config.conf)
USER_IGNORELIST=ignorelist.txt   // missing file

// after (config.conf)
USER_IGNORELIST=/etc/sensor/user_ignorelist.txt
# ensure the file exists and is readable by the sensor
Defensive patterns

Strategy: validation

Validate before calling

let v = get_str(&raw, "USER_IGNORELIST");
if !v.is_empty() {
    let p = normalize_path(&root, &v);
    if !p.is_file() {
        eprintln!("USER_IGNORELIST file does not exist: {}", p.display());
    }
}

Prevention

When it happens

Trigger: USER_IGNORELIST pointing to a nonexistent or non-file path: filename typo, file removed after config was written, relative path resolving against the wrong root, or the value accidentally holding a directory path.

Common situations: Deployment pipelines that copy configs but not data files; hosts rebuilt without restoring ignore lists; path changed after a package update moved the sensor config; permissions making the file invisible to stat (is_file fails).

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at sensor/src/config.rs:826

            } 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 = {
            let v = get_str(&raw, "USER_IGNORELIST");
            if v.is_empty() {
                None
            } else {
                let p = normalize_path(&root, &v);
                if !p.is_file() {
                    bail!("missing 'USER_IGNORELIST' file '{}'", p.display());
                }
                Some(p)
            }
        };

        let trails_file = {
            let v = get_str(&raw, "TRAILS_FILE");
            if v.is_empty() {
                let home = std::env::var("HOME").unwrap_or_default();
                PathBuf::from(format!("{home}/.maltrail/trails.csv"))
            } else {
                normalize_path(&std::env::current_dir().unwrap_or_else(|_| root.clone()), &v)
            }
        };

        let process_count = get_u64(&raw, "PROCESS_COUNT").filter(|v| *v > 0).unwrap_or(cpu_count() as u64) as u32;

        let disabled_heuristics: Vec<String> = {

View on GitHub (pinned to 77cfb06d76)