{"record":{"id":"9e8908fccaf5544f","repo":"stamparm/maltrail","slug":"missing-user-whitelist-file","errorCode":null,"errorMessage":"missing 'USER_WHITELIST' file '{}'","messagePattern":"missing 'USER_WHITELIST' file '(.+?)'","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"sensor/src/config.rs","lineNumber":814,"sourceCode":"            bail!(\"invalid configuration value for 'REMOTE_SEVERITY_REGEX' ('{remote_severity_regex}')\");\n        }\n\n        let update_period = match get_u64(&raw, \"UPDATE_PERIOD\") {\n            Some(v) => v,\n            None => bail!(\"invalid configuration value for 'UPDATE_PERIOD' ('{}')\", get_str(&raw, \"UPDATE_PERIOD\")),\n        };\n\n        let user_whitelist = {\n            let v = get_str(&raw, \"USER_WHITELIST\");\n            if v.is_empty() {\n                None\n            } else if v.contains(',') {\n                crate::cprintln!(\"[x] configuration value 'USER_WHITELIST' has been changed. Please use it to set location of whitelist file\");\n                None\n            } else {\n                let p = normalize_path(&root, &v);\n                if !p.is_file() {\n                    bail!(\"missing 'USER_WHITELIST' file '{}'\", p.display());\n                }\n                Some(p)\n            }\n        };\n        let user_ignorelist = {\n            let v = get_str(&raw, \"USER_IGNORELIST\");\n            if v.is_empty() {\n                None\n            } else {\n                let p = normalize_path(&root, &v);\n                if !p.is_file() {\n                    bail!(\"missing 'USER_IGNORELIST' file '{}'\", p.display());\n                }\n                Some(p)\n            }\n        };\n\n        let trails_file = {","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/stamparm/maltrail/blob/77cfb06d7606506d101bbcec0786c77166c4255e/sensor/src/config.rs#L796-L832","documentation":"When USER_WHITELIST names a whitelist file (a non-empty, non-comma value), the loader normalizes it relative to the config root and requires it to exist as a regular file (p.is_file()). If it does not, the loader bails with this message showing the resolved path.","triggerScenarios":"USER_WHITELIST set to a path that does not exist or is a directory: typo in the filename, file deleted, wrong relative path given the config root resolution, or pointing at /etc/passwd-style directories instead of a file.","commonSituations":"Copying a config between hosts without copying the whitelist file; running the sensor from a different working directory so the relative path resolves elsewhere; provisioning scripts that create the whitelist only on first boot; SELinux/NFS mounts hiding the file.","solutions":["Create the whitelist file at the path shown in the error, or fix the USER_WHITELIST value to point at the real file.","Check how the path resolves: it is normalized against the config root (resolve_root), so use an absolute path or verify the config file's location.","Ensure the path is a regular file, not a directory.","If provisioning, guarantee the file exists before the sensor starts (touch it with correct ownership)."],"exampleFix":"// before (config.conf)\nUSER_WHITELIST=whitelist.txt   // file not present next to config\n\n// after (config.conf) + create file\nUSER_WHITELIST=/etc/sensor/user_whitelist.txt\n# $ touch /etc/sensor/user_whitelist.txt","handlingStrategy":"validation","validationCode":"let p = normalize_path(&root, &get_str(&raw, \"USER_WHITELIST\"));\nif !get_str(&raw, \"USER_WHITELIST\").is_empty() && !p.is_file() {\n    eprintln!(\"USER_WHITELIST file does not exist: {}\", p.display());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer absolute paths so the file resolves regardless of config root.","Ensure provisioning creates whitelist files before the sensor starts.","Copy data files along with configs when moving between hosts.","Check file permissions/visibility for the sensor's service user."],"tags":["rust","configuration","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"77cfb06d7606506d101bbcec0786c77166c4255e","analyzedAt":"2026-09-13T03:50:16.010Z","contentChangedAt":"2026-09-13T03:50:16.010Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}