slackhq/nebula · error

Error starting session: %w

Error message

Error starting session: %w

What it means

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.

Source

Thrown at wintun/tun.go:85

// CreateTUNWithRequestedGUID creates a Wintun interface with the given name and
// a requested GUID. Should a Wintun interface with the same name exist, it is reused.
func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu int) (Device, error) {
	wt, err := wintun.CreateAdapter(ifname, WintunTunnelType, requestedGUID)
	if err != nil {
		return nil, fmt.Errorf("Error creating interface: %w", err)
	}

	tun := &NativeTun{
		wt:     wt,
		name:   ifname,
		handle: windows.InvalidHandle,
	}

	tun.session, err = wt.StartSession(0x800000) // Ring capacity, 8 MiB
	if err != nil {
		tun.wt.Close()
		return nil, fmt.Errorf("Error starting session: %w", err)
	}
	tun.readWait = tun.session.ReadWaitEvent()
	return tun, nil
}

func (tun *NativeTun) Name() (string, error) {
	return tun.name, nil
}

func (tun *NativeTun) File() *os.File {
	return nil
}

func (tun *NativeTun) Close() error {
	var err error
	tun.closeOnce.Do(func() {
		atomic.StoreInt32(&tun.close, 1)
		windows.SetEvent(tun.readWait)

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Retry creating the TUN device
  2. Reinstall/update the Wintun driver if it persists
  3. Free system memory (the 8 MiB ring allocation can fail under pressure)
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at wintun/tun.go:85 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/486a671521dac7cf. Report an issue: GitHub.