slackhq / nebula

A scalable overlay networking tool with a focus on performance, simplicity and security

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› BUG: Wintun interface cannot be created after Windows crash ("Cannot create a file when that file already exists.")

aghand0ur opened this issue Β· comments

What version of nebula are you using?

dnclient v0.2.1 (nebula v1.7.2)

What operating system are you using?

Windows 10

Describe the Bug

When Windows 10 crashes, DNClient does not shutdown properly.
Upon Windows reboot, the client doe snot show up in the adapter list although being running.
To run properly, I then have to manually restart the process

Warning,26-Sep-23 1:11:03 PM,dnclient,2,None,"time=""2023-09-26T13:11:03+03:00"" level=warning msg=""Failed to initialize Nebula"" error=""failed to start nebula: create Wintun interface failed, create TUN device failed: Error creating interface: Cannot create a file when that file already exists.""

@johnmaguire

Logs from affected hosts

Adapter list after reboot from crash:
image

Adapter list after manual client restart:
image

Logs after reboot from crash:
debug_windows.csv

Logs after manual client restart:
debug_restart.csv

I can't reproduce in a Windows 11 Pro VM. (Tested in Parallels on macOS. DNClient is in a steady state, "Actions > Stop" which immediately cuts power to the VM.)

Can you verify that you only have one DNClient service in services.msc? (Press Windows key, type services.msc and hit Enter.)

Screenshot 2023-09-26 at 3 08 18 PM

I see you're using Windows 10 so I'll try to repro there.

@aghand0ur I see some similar issues across the web that were fixed in more recent versions of wintun.

Would you try downloading the latest wintun from https://www.wintun.net/ and replacing the contents of C:\Program Files\Defined Networking\DNClient\dist\windows\wintun with the contents of the downloaded ZIP folder and seeing if the issue persists?

OK, I am able to reproduce this issue under Windows 10. I did try upgrading to the latest wintun drivers which did not appear to change anything. I suspect we'll need to do some extra cleanup here.

@johnmaguire the PR should solve this issue I guess..
With a new release, do I need to manually update all DNClients?

@aghand0ur Hey there, yes, you'll need to manually update all dnclients as there is no self-updating functionality today.

@johnmaguire when is the next planned release?

@aghand0ur I don't have a date for you. Nebula nightlies can be found here: https://github.com/NebulaOSS/nebula-nightly/releases

I DM'd you on the Nebula Slack with beta dnclient builds incorporating this change..