{"record":{"id":"898ed8c924064d88","repo":"slackhq/nebula","slug":"generate-guid-failed-w","errorCode":null,"errorMessage":"generate GUID failed: %w","messagePattern":"generate GUID failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/tun_windows.go","lineNumber":67,"sourceCode":"\nfunc (t *winTun) Read(b []byte) (int, error) {\n\treturn t.tun.Read(b, 0)\n}\n\nfunc newTunFromFd(_ *config.C, _ *slog.Logger, _ int, _ []netip.Prefix) (Device, error) {\n\treturn nil, fmt.Errorf(\"newTunFromFd not supported in Windows\")\n}\n\nfunc newTun(c *config.C, l *slog.Logger, vpnNetworks []netip.Prefix, _ bool) (*winTun, error) {\n\terr := checkWinTunExists()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"can not load the wintun driver: %w\", err)\n\t}\n\n\tdeviceName := c.GetString(\"tun.dev\", \"\")\n\tguid, err := generateGUIDByDeviceName(deviceName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"generate GUID failed: %w\", err)\n\t}\n\n\tcat, setCat, err := parseNetworkCategory(c.GetString(\"tun.network_category\", \"private\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt := &winTun{\n\t\tDevice:          deviceName,\n\t\tvpnNetworks:     vpnNetworks,\n\t\tMTU:             c.GetInt(\"tun.mtu\", DefaultMTU),\n\t\tguid:            *guid,\n\t\tnetworkCategory: cat,\n\t\tsetCategory:     setCat,\n\t\tbypassWDF:       c.GetBool(\"tun.windows_bypass_wdf\", true),\n\t\tl:               l,\n\t}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/tun_windows.go#L49-L85","documentation":"newTun derives a stable wintun adapter GUID from the device name via generateGUIDByDeviceName(deviceName). If that fails, the error is wrapped as 'generate GUID failed'. The GUID generation is hash-based on tun.dev, so failure usually means an invalid or unusable device name.","triggerScenarios":"generateGUIDByDeviceName returns an error for the name from c.GetString(\"tun.dev\", \"\") — e.g. a device name with characters wintun rejects, an empty name combined with a hashing constraint, or an internal conversion failure.","commonSituations":"tun.dev set to a name with illegal characters or excessive length for a Windows adapter; misconfigured or templated configs that produce empty/odd device names; non-ASCII device names.","solutions":["Set tun.dev to a simple ASCII alphanumeric name (e.g. 'nebula') in the config.","Remove control characters, spaces, or non-ASCII characters from tun.dev.","Keep the device name within Windows adapter-name length limits.","If you didn't set tun.dev, verify the config file parses as expected (c.GetString fallback producing an empty value) and fix the config key/format."],"exampleFix":"// before\ntun:\n  dev: \"Nebula VPN (corp)\"\n// after\ntun:\n  dev: \"Nebula\"","handlingStrategy":"validation","validationCode":"name := c.GetString(\"tun.dev\", \"nebula\")\nvalid := regexp.MustCompile(`^[A-Za-z0-9_-]{1,32}$`)\nif !valid.MatchString(name) {\n\treturn fmt.Errorf(\"tun.dev %q must be 1-32 ASCII letters, digits, _ or -\", name)\n}","typeGuard":null,"tryCatchPattern":"tun, err := overlay.NewTun(cfg, logger, prefixes, false)\nif err != nil && strings.Contains(err.Error(), \"generate GUID failed\") {\n\t// fix tun.dev and retry startup; non-transient config error\n}","preventionTips":["Use short, ASCII, alphanumeric tun.dev names.","Avoid spaces, parentheses and non-ASCII in adapter names.","Validate tun.dev at config-load time before starting the overlay.","Ensure the config file actually defines tun.dev if you depend on a specific adapter name."],"tags":["windows","tun","wintun","configuration"],"backgroundTag":"invalid-device-name","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}