shadow1ng/fscan · error

config_read_users_failed

config_read_users_failed

Error message

%s

What it means

Raised in parseUsernames when reading the -usersfile file fails (missing, unreadable, or I/O error); the localized message includes the file path and underlying error. Command-line usernames themselves cannot trigger it.

Source

Thrown at common/config_builder.go:112

func parseUsernames(fv *FlagVars) ([]string, error) {
	var usernames []string

	// 命令行用户名
	if fv.Username != "" {
		for _, u := range strings.Split(fv.Username, ",") {
			u = strings.TrimSpace(u)
			if u != "" {
				usernames = append(usernames, u)
			}
		}
	}

	// 从文件读取
	if fv.UsersFile != "" {
		if lines, err := parsers.ReadLinesFromFile(fv.UsersFile); err == nil {
			usernames = append(usernames, lines...)
		} else {
			return nil, fmt.Errorf("%s", i18n.Tr("config_read_users_failed", fv.UsersFile, err))
		}
	}

	// 额外用户名
	if fv.AddUsers != "" {
		for _, u := range strings.Split(fv.AddUsers, ",") {
			u = strings.TrimSpace(u)
			if u != "" {
				usernames = append(usernames, u)
			}
		}
	}

	return removeDuplicate(usernames), nil
}

func parsePasswords(fv *FlagVars) ([]string, error) {
	var passwords []string

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Verify the users file path exists and is readable
  2. Check file encoding — it must be line-separated plain text
  3. Pass users inline via -user if the file is unavailable
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at common/config_builder.go:112 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/9d9ce8e3d848dc36. Report an issue: GitHub.