[GH-ISSUE #1521] Bug: Empty backup resolv.conf causes panic on daemon start #2553

Open
opened 2026-08-05 00:47:46 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @Thunderbottom on GitHub (Feb 2, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/1521

Describe the problem

Having an empty backup resolv.conf at /etc/resolv.conf.original.netbird and then starting (or restarting) the netbird daemon casues a goroutine panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xdcc625]

goroutine 153 [running]:
github.com/netbirdio/netbird/client/internal/dns.(*fileConfigurator).updateConfig(0xc00089d6f0, {0xc000a243f0?, 0xc0008d96a0?, 0x1?}, {0xc0005798a0, 0xe}, 0x0)
    /home/runner/work/netbird/netbird/client/internal/dns/file_linux.go:84 +0x45
github.com/netbirdio/netbird/client/internal/dns.(*fileConfigurator).applyDNSConfig(0xc00089d6f0, {{0xc000542c00, 0x9, 0x10}, 0x1, {0xc0005798a0, 0xe}, 0x35})
    /home/runner/work/netbird/netbird/client/internal/dns/file_linux.go:75 +0x319
github.com/netbirdio/netbird/client/internal/dns.(*DefaultServer).applyConfiguration(0xc00085c1e0, {0x1, {0xc000cb1300, 0x3, 0x4}, {0xc000556e40, 0x1, 0x1}})
    /home/runner/work/netbird/netbird/client/internal/dns/server.go:291 +0x452
github.com/netbirdio/netbird/client/internal/dns.(*DefaultServer).UpdateDNSServer(0xc00085c1e0, 0x2f1, {0x1, {0xc000cb1300, 0x3, 0x4}, {0xc000556e40, 0x1, 0x1}})
    /home/runner/work/netbird/netbird/client/internal/dns/server.go:227 +0x233
github.com/netbirdio/netbird/client/internal.(*Engine).updateNetworkMap(0xc000882820, 0xc00022ee70)
    /home/runner/work/netbird/netbird/client/internal/engine.go:680 +0x59b
github.com/netbirdio/netbird/client/internal.(*Engine).handleSync(0xc000882820, 0xc00020b920)
    /home/runner/work/netbird/netbird/client/internal/engine.go:471 +0x1c5
github.com/netbirdio/netbird/management/client.(*GrpcClient).receiveEvents(0xc000c9c310, {0x15a4960, 0xc00089db80}, {0x8d, 0x37, 0xb2, 0x92, 0xbc, 0x72, 0xba, ...}, ...)
    /home/runner/work/netbird/netbird/management/client/grpc.go:257 +0x183
github.com/netbirdio/netbird/management/client.(*GrpcClient).Sync.func1()
    /home/runner/work/netbird/netbird/management/client/grpc.go:146 +0x425
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc0008d9f48, {0x7f42a08b82f8, 0xc000cb0a20}, 0x0, {0x0?, 0x0?})
    /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:55 +0x118
github.com/cenkalti/backoff/v4.RetryNotify(...)
    /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:34
github.com/cenkalti/backoff/v4.Retry(...)
    /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:28
github.com/netbirdio/netbird/management/client.(*GrpcClient).Sync(0xc000c9c310, 0xc000cb7a90)
    /home/runner/work/netbird/netbird/management/client/grpc.go:166 +0x1a5
github.com/netbirdio/netbird/client/internal.(*Engine).receiveManagementEvents.func1()
    /home/runner/work/netbird/netbird/client/internal/engine.go:558 +0x67
created by github.com/netbirdio/netbird/client/internal.(*Engine).receiveManagementEvents in goroutine 38
    /home/runner/work/netbird/netbird/client/internal/engine.go:557 +0x4f

The solution is to delete the empty backup resolv.conf: rm /etc/resolv.conf.original.netbird and restart the daemon.

To Reproduce

Steps to reproduce the behavior:

  1. Create an empty backup resolv.conf at /etc/resolv.conf.original.netbird
  2. Restart (or start) the netbird daemon: netbird service start
  3. The daemon takes a lot of time to start, and says it has started, but the systemd service status shows as failed.
  4. (Manually): Run sudo /usr/bin/netbird service run --config /etc/netbird/config.json --log-level debug and see the goroutine panic

Expected behavior

The empty resolv.conf backup should be ignored and the service should start up normally.

Are you using NetBird Cloud?

Self-hosted Netbird

NetBird version

netbird version: 0.25.5

Originally created by @Thunderbottom on GitHub (Feb 2, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/1521 **Describe the problem** Having an empty backup resolv.conf at `/etc/resolv.conf.original.netbird` and then starting (or restarting) the netbird daemon casues a goroutine panic: ```go panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xdcc625] goroutine 153 [running]: github.com/netbirdio/netbird/client/internal/dns.(*fileConfigurator).updateConfig(0xc00089d6f0, {0xc000a243f0?, 0xc0008d96a0?, 0x1?}, {0xc0005798a0, 0xe}, 0x0) /home/runner/work/netbird/netbird/client/internal/dns/file_linux.go:84 +0x45 github.com/netbirdio/netbird/client/internal/dns.(*fileConfigurator).applyDNSConfig(0xc00089d6f0, {{0xc000542c00, 0x9, 0x10}, 0x1, {0xc0005798a0, 0xe}, 0x35}) /home/runner/work/netbird/netbird/client/internal/dns/file_linux.go:75 +0x319 github.com/netbirdio/netbird/client/internal/dns.(*DefaultServer).applyConfiguration(0xc00085c1e0, {0x1, {0xc000cb1300, 0x3, 0x4}, {0xc000556e40, 0x1, 0x1}}) /home/runner/work/netbird/netbird/client/internal/dns/server.go:291 +0x452 github.com/netbirdio/netbird/client/internal/dns.(*DefaultServer).UpdateDNSServer(0xc00085c1e0, 0x2f1, {0x1, {0xc000cb1300, 0x3, 0x4}, {0xc000556e40, 0x1, 0x1}}) /home/runner/work/netbird/netbird/client/internal/dns/server.go:227 +0x233 github.com/netbirdio/netbird/client/internal.(*Engine).updateNetworkMap(0xc000882820, 0xc00022ee70) /home/runner/work/netbird/netbird/client/internal/engine.go:680 +0x59b github.com/netbirdio/netbird/client/internal.(*Engine).handleSync(0xc000882820, 0xc00020b920) /home/runner/work/netbird/netbird/client/internal/engine.go:471 +0x1c5 github.com/netbirdio/netbird/management/client.(*GrpcClient).receiveEvents(0xc000c9c310, {0x15a4960, 0xc00089db80}, {0x8d, 0x37, 0xb2, 0x92, 0xbc, 0x72, 0xba, ...}, ...) /home/runner/work/netbird/netbird/management/client/grpc.go:257 +0x183 github.com/netbirdio/netbird/management/client.(*GrpcClient).Sync.func1() /home/runner/work/netbird/netbird/management/client/grpc.go:146 +0x425 github.com/cenkalti/backoff/v4.RetryNotifyWithTimer(0xc0008d9f48, {0x7f42a08b82f8, 0xc000cb0a20}, 0x0, {0x0?, 0x0?}) /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:55 +0x118 github.com/cenkalti/backoff/v4.RetryNotify(...) /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:34 github.com/cenkalti/backoff/v4.Retry(...) /home/runner/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.1.3/retry.go:28 github.com/netbirdio/netbird/management/client.(*GrpcClient).Sync(0xc000c9c310, 0xc000cb7a90) /home/runner/work/netbird/netbird/management/client/grpc.go:166 +0x1a5 github.com/netbirdio/netbird/client/internal.(*Engine).receiveManagementEvents.func1() /home/runner/work/netbird/netbird/client/internal/engine.go:558 +0x67 created by github.com/netbirdio/netbird/client/internal.(*Engine).receiveManagementEvents in goroutine 38 /home/runner/work/netbird/netbird/client/internal/engine.go:557 +0x4f ``` The solution is to delete the empty backup resolv.conf: `rm /etc/resolv.conf.original.netbird` and restart the daemon. **To Reproduce** Steps to reproduce the behavior: 1. Create an empty backup resolv.conf at `/etc/resolv.conf.original.netbird` 2. Restart (or start) the netbird daemon: `netbird service start` 3. The daemon takes a lot of time to start, and says it has started, but the systemd service status shows as failed. 4. **(Manually):** Run `sudo /usr/bin/netbird service run --config /etc/netbird/config.json --log-level debug` and see the goroutine panic **Expected behavior** The empty resolv.conf backup should be ignored and the service should start up normally. **Are you using NetBird Cloud?** Self-hosted Netbird **NetBird version** `netbird version: 0.25.5`
saavagebueno added the bugclienttriage labels 2026-08-05 00:47:46 -04:00
Sign in to join this conversation.
No Label bug client triage
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#2553