netbirdio/netbird · error

password must contain at least {missing}

Error message

password must contain at least {missing}

What it means

Returned by ValidatePassword (management/server/user.go:1941): the length rule passed but at least one required character class is missing. The message is built dynamically by joining the missing class descriptions, e.g. "password must contain at least one digit, one special character", so the exact text tells you precisely what to add.

Source

Thrown at management/server/user.go:1941

			hasUpper = true
		case !unicode.IsLetter(c) && !unicode.IsDigit(c):
			hasSpecial = true
		}
	}

	var missing []string
	if !hasDigit {
		missing = append(missing, "one digit")
	}
	if !hasUpper {
		missing = append(missing, "one uppercase letter")
	}
	if !hasSpecial {
		missing = append(missing, "one special character")
	}

	if len(missing) > 0 {
		return errors.New("password must contain at least " + strings.Join(missing, ", "))
	}

	return nil
}

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Read the message: it enumerates exactly the missing classes ("one digit", "one uppercase letter", "one special character")
  2. Add the missing class(es), e.g. append "1A!" or regenerate with all classes enabled

Example fix

// before: "longpassphrasewithoutclasses" -> missing digit, uppercase, special
password := "longpassphrase"

// after
password := "Longpassphrase1!"
Defensive patterns

Strategy: validation

Validate before calling

func passwordMeetsPolicy(pw string) error {
    if len(pw) < 8 { return errors.New("too short") }
    var digit, upper, special bool
    for _, c := range pw {
        switch {
        case unicode.IsDigit(c): digit = true
        case unicode.IsUpper(c): upper = true
        case !unicode.IsLetter(c) && !unicode.IsDigit(c): special = true
        }
    }
    if !digit || !upper || !special {
        return errors.New("password needs a digit, an uppercase letter, and a special character")
    }
    return nil
}

Try / catch

if err := management.ValidatePassword(pw); err != nil {
    // message already lists exactly which classes are missing; show it verbatim to the user
    return err
}

Prevention

When it happens

Trigger: Setting a password like "passwordpassword" (no digit/upper/special) or "PASSWORD123!" (no lowercase is NOT checked, but missing lowercase letter is not a rule; the classes are digit, uppercase, special only). Any 8+ char password lacking one of: digit, uppercase letter, non-alphanumeric character.

Common situations: Users choosing long passphrases without symbols; generators limited to lowercase; seeding scripts with simple constants.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/a714aae9a43a5779. Report an issue: GitHub.