yggdrasil-network / yggdrasil-go

An experiment in scalable routing as an encrypted IPv6 overlay network
https://yggdrasil-network.github.io
Other
3.53k stars 242 forks source link

Error creating interface: Cannot create a file when that file already exists #955

Closed socram8888 closed 1 year ago

socram8888 commented 2 years ago

I'm having some issues when restarting the Yggdrasil 0.4.4 service under Windows 10, x64.

Sometimes it works and creates the interface right away after restarting. On other occasions, the interface is not created, and about 10 seconds later this error pops in the log:

2022/10/07 11:25:19 Build name: yggdrasil
2022/10/07 11:25:19 Build version: 0.4.4
2022/10/07 11:25:19 Starting up...
2022/10/07 11:25:19 Startup complete
2022/10/07 11:25:19 Starting multicast module
2022/10/07 11:25:19 TCP admin socket listening on 127.0.0.1:9001
2022/10/07 11:25:19 Listening for TLS on: [fe80::a1e6:1f6c:adf3:8de7%VirtualBox Host-Only Network]:64199
2022/10/07 11:25:19 Listening for TLS on: [fe80::ecf0:22ff:dd19:5cab%Wi-Fi]:64200
2022/10/07 11:25:19 Connected TLS: 200:58e2:b22:5a95:99a6:d8e0:2a9e:3464@143.47.178.115, source 172.16.21.84
2022/10/07 11:25:19 Connected TLS: 201:5bff:fc61:a4d7:e753:a40f:bdf7:8135@176.9.161.20, source 172.16.21.84
2022/10/07 11:25:34 An error occurred starting TUN/TAP: Error creating interface: No se puede crear un archivo que ya existe.
2022/10/07 11:25:34 Your public key is 8483ab3ae33278baf309d9612403d4ffb2559a7ea50025f85075b3433fb8d20c
2022/10/07 11:25:34 Your IPv6 address is 200:f6f8:a98a:399b:e8a:19ec:4d3d:b7f8
2022/10/07 11:25:34 Your IPv6 subnet is 300:f6f8:a98a:399b::/64

Apparently it has something to do with device creation/deletion, as I can see this error popping up on C:\Windows\INF\setupapi.dev.log:

[Device Install Log]
     OS Version = 10.0.19044
     Service Pack = 0.0
     Suite = 0x0100
     ProductType = 1
     Architecture = amd64

[BeginLog]

[Boot Session: 2022/10/07 06:15:24.500]

>>>  [Delete Device - SWD\WINTUN\{8F59971A-7872-4AA6-B2EB-061FC4E9D0A7}]
>>>  Section start 2022/10/07 11:31:45.928
      cmd: "C:\Program Files\Yggdrasil\yggdrasil.exe" -useconffile "C:\ProgramData\Yggdrasil\yggdrasil.conf" -logto "C:\ProgramData\Yggdrasil\yggdrasil.log"
!    dvi: Query-and-Remove failed: 0x05: CR_INVALID_DEVNODE.
<<<  Section end 2022/10/07 11:31:45.966
<<<  [Exit status: SUCCESS]
socram8888 commented 2 years ago

It seems that, if I manually remove the device and drivers using devmgmt.msc left after the tunnel is shut down, the service always starts reliably. Otherwise, it exhibits this seemingly random behaviour.

Vort commented 2 years ago

Looks like it's the same reason why I stopped updating my Yggdrasil installation: #891

socram8888 commented 2 years ago

I've just tried 0.4.5, which reading through the changelog has better cleanup, but still has the same issue.

vikulin commented 1 year ago

Fixed in RiV-mesh

neilalexander commented 1 year ago

Please reopen if this is still an issue on v0.5 release candidates.