{"record":{"id":"486a671521dac7cf","repo":"slackhq/nebula","slug":"error-starting-session-w","errorCode":null,"errorMessage":"Error starting session: %w","messagePattern":"Error starting session: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wintun/tun.go","lineNumber":85,"sourceCode":"\n// CreateTUNWithRequestedGUID creates a Wintun interface with the given name and\n// a requested GUID. Should a Wintun interface with the same name exist, it is reused.\nfunc CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu int) (Device, error) {\n\twt, err := wintun.CreateAdapter(ifname, WintunTunnelType, requestedGUID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error creating interface: %w\", err)\n\t}\n\n\ttun := &NativeTun{\n\t\twt:     wt,\n\t\tname:   ifname,\n\t\thandle: windows.InvalidHandle,\n\t}\n\n\ttun.session, err = wt.StartSession(0x800000) // Ring capacity, 8 MiB\n\tif err != nil {\n\t\ttun.wt.Close()\n\t\treturn nil, fmt.Errorf(\"Error starting session: %w\", err)\n\t}\n\ttun.readWait = tun.session.ReadWaitEvent()\n\treturn tun, nil\n}\n\nfunc (tun *NativeTun) Name() (string, error) {\n\treturn tun.name, nil\n}\n\nfunc (tun *NativeTun) File() *os.File {\n\treturn nil\n}\n\nfunc (tun *NativeTun) Close() error {\n\tvar err error\n\ttun.closeOnce.Do(func() {\n\t\tatomic.StoreInt32(&tun.close, 1)\n\t\twindows.SetEvent(tun.readWait)","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/wintun/tun.go#L67-L103","documentation":"Wrapping error in CreateTUNWithRequestedGUID: wt.StartSession(8 MiB ring) failed after the Wintun adapter was successfully created. The ring buffer session with the driver could not be established — often memory pressure or a driver in a bad state; the underlying error is preserved with %w.","triggerScenarios":"Thrown at wintun/tun.go:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry creating the TUN device","Reinstall/update the Wintun driver if it persists","Free system memory (the 8 MiB ring allocation can fail under pressure)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}