netbirdio/netbird · error

failed to parse line

Error message

failed to parse line: %s

What it means

A line containing ': flags' in ifconfig output had fewer than 4 whitespace-separated fields, so the FreeBSD interface parser cannot extract the interface name. Malformed or unexpected ifconfig output format.

Solutions

  1. Check the host's ifconfig version and output format
  2. Log the raw line to identify the divergence
  3. Skip unparseable lines when they are not the target interface
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/iface/freebsd/iface.go:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at client/iface/freebsd/iface.go:44

}

func parseIfconfigOutput(output []byte) (*iface, error) {
	// TODO: implement without allocations
	lines := string(output)

	scanner := bufio.NewScanner(strings.NewReader(lines))

	var name, mtu, group string
	var ips []string

	for scanner.Scan() {
		line := scanner.Text()

		// If line contains ": flags", it's a line with interface information
		if strings.Contains(line, ": flags") {
			parts := strings.Fields(line)
			if len(parts) < 4 {
				return nil, fmt.Errorf("failed to parse line: %s", line)
			}
			name = strings.TrimSuffix(parts[0], ":")
			if strings.Contains(line, "mtu") {
				mtuIndex := 0
				for i, part := range parts {
					if part == "mtu" {
						mtuIndex = i
						break
					}
				}
				mtu = parts[mtuIndex+1]
			}
		}

		// If line contains "groups:", it's a line with interface group
		if strings.Contains(line, "groups:") {
			parts := strings.Fields(line)
			if len(parts) < 2 {

View on GitHub (pinned to 93e97f4bf1)