netbird icon indicating copy to clipboard operation
netbird copied to clipboard

netbird service / connection is down when returning from sleep / hibernation

Open ez1976 opened this issue 1 year ago • 5 comments

Hi on windows it seems that when the computer is resumed from sleep or Hibernation, although the service is up and the netbird-gui display as connected, the user gets: "dial service - context deadline exceeded"

of course reboot / restart of the service / running "netbird down && nebird up" or "netbird service restart" will resume the connection just fine. attached one of the users client log at line 10980 the user restarted the computer (or the service) Uploading netbird-client.log…

ez1976 avatar May 18 '24 13:05 ez1976

Can you upgrade the client to 0.27.7 and enable the network monitor?

You can do that by:

netbird down
netbird up -N

mlsmaycon avatar May 18 '24 14:05 mlsmaycon

On it

On Sat, May 18, 2024, 15:34 Maycon Santos @.***> wrote:

Can you upgrade the client to 0.27.7 and enable the network monitor?

You can do that by:

netbird down netbird up -N

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2011#issuecomment-2118843013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDD2CEWIEVWPZLVSP6F3ZC5RI5AVCNFSM6AAAAABH5PO2ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJYHA2DGMBRGM . You are receiving this because you authored the thread.Message ID: @.***>

ez1976 avatar May 18 '24 14:05 ez1976

I can also create a PR to update the UI so that it is based on the full-status @mlsmaycon if you all want. The reason again is because of the internal state never gets updated when signal and management endpoints become unavailable.

Network-monitor does help though, from time to time tough in rare instances you will get a resource busy with the wireguard interface, restarting the service does solve that. Seems like when restarting the engine there is a race condition, or for some odd reason removing the interface fails.

2024-05-06T09:09:19-07:00 INFO client/internal/routemanager/manager.go:93: Routing setup complete
2024-05-06T09:09:19-07:00 ERRO client/internal/engine.go:284: failed creating tunnel interface utun100: [resource busy]
2024-05-06T09:09:19-07:00 INFO client/internal/routemanager/manager.go:117: Routing cleanup complete
2024-05-06T09:09:19-07:00 ERRO client/internal/connect.go:245: error while starting Netbird Connection Engine: create wg interface: resource busy

hurricanehrndz avatar May 20 '24 15:05 hurricanehrndz

2024-05-08T14:28:50+01:00 DEBG client/internal/engine.go:1135: removing Netbird interface utun100
2024-05-08T14:28:50+01:00 ERRO client/internal/connect.go:245: error while starting Netbird Connection Engine: create wg interface: resource busy

https://github.com/netbirdio/netbird/blob/main/client/internal/engine.go#L1168

hurricanehrndz avatar May 20 '24 15:05 hurricanehrndz

I believe issue #2006 is related

hurricanehrndz avatar May 21 '24 12:05 hurricanehrndz

I have the same issue. Returning from a sleeping Mac and it shows as disconnected and won't connect.

error while starting Netbird Connection Engine: create wg interface: resource busy

ghost avatar Jul 01 '24 22:07 ghost

Try netbird down netbird up -N

On Mon, Jul 1, 2024, 23:23 Fossil @.***> wrote:

I have the same issue. Returning from a sleeping Mac and it shows as disconnected and won't connect.

error while starting Netbird Connection Engine: create wg interface: resource busy

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2011#issuecomment-2201192759, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDDZDINBHXKENUOSYR7DZKHJHFAVCNFSM6AAAAABH5PO2ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBRGE4TENZVHE . You are receiving this because you authored the thread.Message ID: @.***>

ez1976 avatar Jul 01 '24 22:07 ez1976

Yeah that works. But this is a bug obviously :P

ghost avatar Jul 01 '24 22:07 ghost

No. The -N adds a network monitor that resets the connection if the network adapter status changes. It is disabled by default

On Mon, Jul 1, 2024, 23:28 Fossil @.***> wrote:

Yeah that works. But this is a bug obviously :P

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2011#issuecomment-2201203647, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDD24XNSW57B2JG4U3L3ZKHJZHAVCNFSM6AAAAABH5PO2ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBRGIYDGNRUG4 . You are receiving this because you authored the thread.Message ID: @.***>

ez1976 avatar Jul 01 '24 22:07 ez1976

So I looked at it some more, running netbird up -N comes back with Connected. But running netbird status returns Error: status failed: create wg interface: resource busy. The admin panel also says I am still offline.

What I meant before, was that the -N flag should probably become an option in the app itself, and an option the client automatically configures when told to do so in the admin panel.

ghost avatar Jul 02 '24 08:07 ghost

Or even better, enabled by default. After the laptop resumes from sleep give it a bit of time and it will restart the service. On windows laptops i actually pushed a task schedule to restart the service every time the laptop restarts or resumes from sleep

On Tue, Jul 2, 2024, 09:25 Fossil @.***> wrote:

So I looked at it some more, running netbird up -N comes back with Connected. But running netbird status returns Error: status failed: create wg interface: resource busy.

What I meant before, was that the -N flag should probably become an option in the app itself, and an option the client automatically configures when told to do so in the admin panel.

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2011#issuecomment-2202301247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDD7ZZOHN4PC5QYKUHC3ZKJPZHAVCNFSM6AAAAABH5PO2ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBSGMYDCMRUG4 . You are receiving this because you authored the thread.Message ID: @.***>

ez1976 avatar Jul 02 '24 08:07 ez1976

Agree. Tailscale seems to just always work, even right after waking from sleep.

ghost avatar Jul 02 '24 08:07 ghost

Try netbird down netbird up -N

This did not work for me. After running both commands I get

$ netbird status
Error: status failed: create wg interface: resource busy

clarkmcc avatar Nov 01 '24 22:11 clarkmcc

Do you have virtualbox or any other virtualization on your computer?

On Fri, Nov 1, 2024, 22:10 Clark McCauley @.***> wrote:

Try netbird down netbird up -N

This did not work for me. After running both commands I get

$ netbird status Error: status failed: create wg interface: resource busy

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2011#issuecomment-2452656559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDDZWS27GI6BYI3M2E5LZ6P35BAVCNFSM6AAAAABH5PO2ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJSGY2TMNJVHE . You are receiving this because you authored the thread.Message ID: @.***>

ez1976 avatar Nov 02 '24 10:11 ez1976

I have Parallels. I was able to resolve it by killing the NetBird service and restarting it.

clarkmcc avatar Nov 02 '24 14:11 clarkmcc

Hello folks, recently we released a new version with a new handler. Can you run a test with the latest version?

mlsmaycon avatar Nov 02 '24 14:11 mlsmaycon