owasp-amass/amass · error

unable to load the file in the alterations wordlist_file set

Error message

unable to load the file in the alterations wordlist_file setting: %s: %v

What it means

Once the absolute wordlist path is resolved, loadAlterationSettings loads its contents with GetListFromFile and wraps any failure as 'unable to load the file in the alterations wordlist_file setting: <path>: <reason>'. This means the file exists at the resolved path but could not be opened/read or parsed into a wordlist.

Source

Thrown at config/brute.go:104

		wordlistPaths, ok := wordlistPathRaw.([]interface{})
		if !ok {
			return fmt.Errorf("alterations wordlist_file is not an array")
		}

		for _, wordlistPathRaw := range wordlistPaths {
			wordlistPath, ok := wordlistPathRaw.(string)
			if !ok {
				return fmt.Errorf("alterations wordlist_file item is not a string")
			}

			absPath, err := c.AbsPathFromConfigDir(wordlistPath)
			if err != nil {
				return fmt.Errorf("failed to get absolute path for wordlist file: %w", err)
			}

			wordlist, err := GetListFromFile(absPath)
			if err != nil {
				return fmt.Errorf("unable to load the file in the alterations wordlist_file setting: %s: %v", absPath, err)
			}

			c.AltWordlist = append(c.AltWordlist, wordlist...)
		}
	}

	c.AltWordlist = stringset.Deduplicate(c.AltWordlist)
	return nil
}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Verify the path points to a regular readable file, not a directory: `file <absPath>` and `ls -l <absPath>`.
  2. Fix read permissions: `chmod +r <absPath>` (and check directory execute bits).
  3. Confirm the file is mounted/available in containers before starting the tool.
  4. If the file was moved, update wordlist_file in the config to the new location.

Example fix

// before (config.yaml)
alterations:
  wordlist_file:
    - "/usr/share/wordlists"  # a directory
// after
alterations:
  wordlist_file:
    - "/usr/share/wordlists/common.txt"
Defensive patterns

Strategy: validation

Validate before calling

info, err := os.Stat(absPath)
if err != nil { return err }
if info.IsDir() {
    return fmt.Errorf("%s is a directory, expected a wordlist file", absPath)
}
f, err := os.Open(absPath)
if err != nil { return fmt.Errorf("wordlist unreadable: %w", err) }
f.Close()

Try / catch

if err := cfg.LoadSettings(path); err != nil {
    if strings.Contains(err.Error(), "unable to load the file in the alterations wordlist_file setting") {
        // inspect the path embedded in the error, fix perms or point at a regular file
    }
    return err
}

Prevention

When it happens

Trigger: LoadSettings with an alterations.wordlist_file entry whose absPath exists per os.Stat but GetListFromFile fails: the file was deleted after stat (race), it is a directory, read permission is denied, or opening it returns an OS error.

Common situations: Wordlist file removed between validation and load; pointing the entry at a directory instead of a file; unreadable file due to restrictive permissions or running as a different user; mounted volume not yet available at startup.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/0b1cea93629e894b. Report an issue: GitHub.