[PR #3683] [client] Set up signal to generate debug bundles #3866

Open
opened 2025-11-20 08:07:14 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/3683

State: closed
Merged: Yes


Describe your changes

This allows us to generate debug bundles when the process is stuck or local grpc is not available (containers).

Example usage:

$ docker exec -it  55725223f383 pkill -SIGUSR1 netbird

$ docker logs 3332a2a01acb 2>&1 | grep SIGUSR1
2025-04-15T13:15:29Z INFO client/cmd/debug_unix.go:34: Received SIGUSR1. Triggering debug bundle generation.
2025-04-15T13:15:34Z INFO client/cmd/debug.go:361: Generated debug bundle from SIGUSR1 at: /tmp/netbird.debug.3539742972.zip

$ docker cp 3332a2a01acb:/tmp/netbird.debug.3539742972.zip .

On Windows:

[Environment]::SetEnvironmentVariable("NB_LISTEN_DEBUG_EVENT", "true", "Machine")
netbird service restart
$evt = [System.Threading.EventWaitHandle]::OpenExisting("Global\NetbirdDebugTriggerEvent")
$evt.Set()
$evt.Close()

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/3683 **State:** closed **Merged:** Yes --- ## Describe your changes This allows us to generate debug bundles when the process is stuck or local grpc is not available (containers). Example usage: ``` $ docker exec -it 55725223f383 pkill -SIGUSR1 netbird $ docker logs 3332a2a01acb 2>&1 | grep SIGUSR1 2025-04-15T13:15:29Z INFO client/cmd/debug_unix.go:34: Received SIGUSR1. Triggering debug bundle generation. 2025-04-15T13:15:34Z INFO client/cmd/debug.go:361: Generated debug bundle from SIGUSR1 at: /tmp/netbird.debug.3539742972.zip $ docker cp 3332a2a01acb:/tmp/netbird.debug.3539742972.zip . ``` On Windows: ``` [Environment]::SetEnvironmentVariable("NB_LISTEN_DEBUG_EVENT", "true", "Machine") netbird service restart $evt = [System.Threading.EventWaitHandle]::OpenExisting("Global\NetbirdDebugTriggerEvent") $evt.Set() $evt.Close() ``` ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
saavagebueno added the pull-request label 2025-11-20 08:07:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#3866