netbirdio/netbird · error

interface name not found in ifconfig output

Error message

interface name not found in ifconfig output

What it means

Guard in parseIfconfigOutput: after scanning the ifconfig output line by line, no interface name was extracted (the name field stayed empty), meaning the output did not have the expected '<name>: flags=...' header. LinkByName cannot build an iface record, so parsing fails.

Solutions

  1. Verify the interface exists with ifconfig -l
  2. Check the command actually ran against the expected interface
  3. Handle the not-found case before parsing
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.


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

Appendix: source

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

			parts := strings.Fields(line)
			if len(parts) < 2 {
				return nil, fmt.Errorf("failed to parse line: %s", line)
			}
			group = parts[1]
		}

		// If line contains "inet ", it's a line with IP address
		if strings.Contains(line, "inet ") {
			parts := strings.Fields(line)
			if len(parts) < 2 {
				return nil, fmt.Errorf("failed to parse line: %s", line)
			}
			ips = append(ips, parts[1])
		}
	}

	if name == "" {
		return nil, fmt.Errorf("interface name not found in ifconfig output")
	}

	mtuInt, err := strconv.Atoi(mtu)
	if err != nil {
		return nil, fmt.Errorf("failed to parse MTU: %w", err)
	}

	return &iface{
		Name:    name,
		MTU:     mtuInt,
		Group:   group,
		IPAddrs: ips,
	}, nil
}

func parseIFName(output []byte) (string, error) {
	// TODO: implement without allocations
	lines := strings.Split(string(output), "\n")

View on GitHub (pinned to 93e97f4bf1)