netbirdio/netbird · warning
%s is not a valid input for %s. it should be formatted as "S
Error message
%s is not a valid input for %s. it should be formatted as "String" or "String/String"
What it means
validateNATExternalIPs splits each --external-ip-map element on '/' and requires at most two sub-elements (an IP and optionally a mask-or-interface). More than one slash means three or more parts, which matches no accepted form, so it is rejected with this message stating the "String" or "String/String" shape.
Source
Thrown at client/cmd/up.go:745
loginRequest.BlockInbound = &blockInbound
}
if cmd.Flag(disableIPv6Flag).Changed {
loginRequest.DisableIpv6 = &disableIPv6
}
return &loginRequest, nil
}
func validateNATExternalIPs(list []string) error {
for _, element := range list {
if element == "" {
return fmt.Errorf("empty string is not a valid input for %s", externalIPMapFlag)
}
subElements := strings.Split(element, "/")
if len(subElements) > 2 {
return fmt.Errorf("%s is not a valid input for %s. it should be formatted as \"String\" or \"String/String\"", element, externalIPMapFlag)
}
if len(subElements) == 1 && !isValidIP(subElements[0]) {
return fmt.Errorf("%s is not a valid input for %s. it should be formatted as \"IP\" or \"IP/IP\", or \"IP/Interface Name\"", element, externalIPMapFlag)
}
last := 0
for _, singleElement := range subElements {
inputType, err := validateElement(singleElement)
if err != nil {
return fmt.Errorf("%s is not a valid input for %s. it should be an IP string or a network name", singleElement, externalIPMapFlag)
}
if last == interfaceInputType && inputType == interfaceInputType {
return fmt.Errorf("%s is not a valid input for %s. it should not contain two interface names", element, externalIPMapFlag)
}
last = inputType
}
}View on GitHub (pinned to 93e97f4bf1)
Solutions
- Use at most one '/': "IP" or "IP/secondary-IP" or "IP/interface-name"
- Split a doubled value into two comma-separated elements if two mappings were intended
Example fix
# before netbird up --external-ip-map "1.2.3.4/5.6.7.8/9" # after netbird up --external-ip-map "1.2.3.4/5.6.7.8"
Defensive patterns
Strategy: validation
Validate before calling
for _, e := range list {
if strings.Count(e, "/") > 1 {
return fmt.Errorf("%q has more than one '/'", e)
}
} Prevention
- Remember the accepted shapes: IP, IP/IP, or IP/interface — never deeper nesting
- Escape or quote values so shell parsing does not merge entries
When it happens
Trigger: Values like "1.2.3.4/24/eth0" or "1.2.3.4/5.6.7.8/9" — anything with two or more '/' characters in a single element.
Common situations: Attempting to pass CIDR notation plus an interface, or copy-paste artifacts gluing two entries together with a slash.
Related errors
- empty string is not a valid input for %s
- %s is not a valid input for %s. it should be formatted as "I
- %s is not a valid input for %s. it should be an IP string or
- %s is not a valid input for %s. it should not contain two in
- invalid IP or network interface name not found
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/f61d9152f675349a.
Report an issue: GitHub.