Runtime error: invalid memory address or nil pointer dereference #1552

Open
opened 2025-11-20 05:32:41 -05:00 by saavagebueno · 11 comments
Owner

Originally created by @coreyh503 on GitHub (Jan 14, 2025).

When starting docker-compose I check the logs to see if Netbird is running correctly and get this runtime error.

docker-compose logs -f
Attaching to netbird-management
netbird-management | panic: runtime error: invalid memory address or nil pointer dereference
netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x12d42f9]

Steps to reproduce the behavior:
docker-compose up -d
docker-compose logs -f

Also, when running netstat there is nothing listening on port 443.

I'm running Netbird using a Ubuntu server in the cloud.

NetBird version 0.24.3 and Docker-compose 1.29.2.

This is my correct management.json file that I have changed over and over.

{
"server": {
"proto": "https",
"port": 443,
"grpc_port": 33073,
"domain": "netbird.domain.com",
"log_level": "debug"
},
"store": {
"type": "sqlite",
"sqlite": {
"db_path": "/var/lib/netbird/netbird.db"
},
"encryption_key": "change-me-to-a-unique-strong-key",
"data_dir": "/var/lib/netbird"
},
"auth": {
"type": "none"
}
}

I will be glad to provide any additional information needed.

Originally created by @coreyh503 on GitHub (Jan 14, 2025). When starting docker-compose I check the logs to see if Netbird is running correctly and get this runtime error. docker-compose logs -f Attaching to netbird-management netbird-management | panic: runtime error: invalid memory address or nil pointer dereference netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x12d42f9] Steps to reproduce the behavior: docker-compose up -d docker-compose logs -f Also, when running netstat there is nothing listening on port 443. I'm running Netbird using a Ubuntu server in the cloud. NetBird version 0.24.3 and Docker-compose 1.29.2. This is my correct management.json file that I have changed over and over. { "server": { "proto": "https", "port": 443, "grpc_port": 33073, "domain": "netbird.domain.com", "log_level": "debug" }, "store": { "type": "sqlite", "sqlite": { "db_path": "/var/lib/netbird/netbird.db" }, "encryption_key": "change-me-to-a-unique-strong-key", "data_dir": "/var/lib/netbird" }, "auth": { "type": "none" } } I will be glad to provide any additional information needed.
saavagebueno added the self-hosting label 2025-11-20 05:32:41 -05:00
Author
Owner

@lixmal commented on GitHub (Jan 15, 2025):

Hi @coreyh503,

can you try running a more recent version? v0.24.3 is over a year old.

@lixmal commented on GitHub (Jan 15, 2025): Hi @coreyh503, can you try running a more recent version? `v0.24.3` is over a year old.
Author
Owner

@coreyh503 commented on GitHub (Jan 16, 2025):

Thank you. I'll try that. I though I was using the most recent version. I would keep retrieving it using the "latest" value but I guess it didn't work. I'm somewhat new to all this. I'll see if that produces a better result.

@coreyh503 commented on GitHub (Jan 16, 2025): Thank you. I'll try that. I though I was using the most recent version. I would keep retrieving it using the "latest" value but I guess it didn't work. I'm somewhat new to all this. I'll see if that produces a better result.
Author
Owner

@mlsmaycon commented on GitHub (Jan 16, 2025):

@coreyh503 you might need to follow some steps before upgrading since you might still be using a file store.

@mlsmaycon commented on GitHub (Jan 16, 2025): @coreyh503 you might need to follow some steps before upgrading since you might still be using a file store.
Author
Owner

@mlsmaycon commented on GitHub (Jan 16, 2025):

After backup, see docs:https://docs.netbird.io/selfhosted/selfhosted-guide#backup

You first need to update to the 0.28.0 version and then you can upgrade to the latest version.

@mlsmaycon commented on GitHub (Jan 16, 2025): After backup, see docs:https://docs.netbird.io/selfhosted/selfhosted-guide#backup You first need to update to the 0.28.0 version and then you can upgrade to the latest version.
Author
Owner

@coreyh503 commented on GitHub (Jan 16, 2025):

What is the latest version of the management service so I know what to look for?

@coreyh503 commented on GitHub (Jan 16, 2025): What is the latest version of the management service so I know what to look for?
Author
Owner

@coreyh503 commented on GitHub (Jan 17, 2025):

I installed the latest version and still the same error. This has been a nightmare. I've been screwing around with this stuff for 3 weeks. I'm going to look for another VPN product.

@coreyh503 commented on GitHub (Jan 17, 2025): I installed the latest version and still the same error. This has been a nightmare. I've been screwing around with this stuff for 3 weeks. I'm going to look for another VPN product.
Author
Owner

@lixmal commented on GitHub (Jan 17, 2025):

Can you share the whole log with the panic?

All right. Good luck

@lixmal commented on GitHub (Jan 17, 2025): Can you share the whole log with the panic? All right. Good luck
Author
Owner

@compumatter commented on GitHub (Feb 17, 2025):

same error here.

docker compose up
[+] Running 4/4
✔ Network netbird-net Created 0.2s
✔ Volume "netbird_netbird-data" Created 0.0s
✔ Container netbird-management Created 1.0s
✔ Container netbird-dashboard Created 0.7s
Attaching to netbird-dashboard, netbird-management
netbird-management | panic: runtime error: invalid memory address or nil pointer dereference
netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x15d63be]
netbird-management |
netbird-management | goroutine 1 [running]:
netbird-management | github.com/netbirdio/netbird/management/cmd.loadMgmtConfig({0x1dce8d0, 0xc0002d0ea0}, {0x1b95517, 0x1c})
netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:511 +0x17e
netbird-management | github.com/netbirdio/netbird/management/cmd.init.func2(0x2a520c0, {0x1b73875?, 0x4?, 0x1b73735?})
netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:104 +0x152
netbird-management | github.com/spf13/cobra.(*Command).execute(0x2a520c0, {0xc000554240, 0x2, 0x2})
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:925 +0x7d9
netbird-management | github.com/spf13/cobra.(*Command).ExecuteC(0x2a51b00)
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5
netbird-management | github.com/spf13/cobra.(*Command).Execute(...)
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
netbird-management | github.com/netbirdio/netbird/management/cmd.Execute(...)
netbird-management | /home/runner/work/netbird/netbird/management/cmd/root.go:51
netbird-management | main.main()
netbird-management | /home/runner/work/netbird/netbird/management/main.go:9 +0x1a
netbird-management exited with code 2
netbird-management | panic: runtime error: invalid memory address or nil pointer dereference
netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x15d63be]
netbird-management |
netbird-management | goroutine 1 [running]:
netbird-management | github.com/netbirdio/netbird/management/cmd.loadMgmtConfig({0x1dce8d0, 0xc00028cd50}, {0x1b95517, 0x1c})
netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:511 +0x17e
netbird-management | github.com/netbirdio/netbird/management/cmd.init.func2(0x2a520c0, {0x1b73875?, 0x4?, 0x1b73735?})
netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:104 +0x152
netbird-management | github.com/spf13/cobra.(*Command).execute(0x2a520c0, {0xc00050b1a0, 0x2, 0x2})
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:925 +0x7d9
netbird-management | github.com/spf13/cobra.(*Command).ExecuteC(0x2a51b00)
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5
netbird-management | github.com/spf13/cobra.(*Command).Execute(...)
netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
netbird-management | github.com/netbirdio/netbird/management/cmd.Execute(...)
netbird-management | /home/runner/work/netbird/netbird/management/cmd/root.go:51
netbird-management | main.main()
netbird-management | /home/runner/work/netbird/netbird/management/main.go:9 +0x1a
netbird-dashboard | AUTH_AUTHORITY or AUTH0_DOMAIN environment variable must be set
netbird-dashboard | + LETSENCRYPT_DOMAIN=none
netbird-dashboard | + LETSENCRYPT_EMAIL=example@local
netbird-dashboard | + NGINX_SSL_PORT=443
netbird-dashboard | + '[' none-x == none-x ']'
netbird-dashboard | + exit 0
netbird-dashboard | 2025/02/18 00:03:20 [emerg] 7#7: socket() [::]:80 failed (97: Address family not supported by protocol)
netbird-dashboard | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
netbird-management exited with code 0
netbird-management | panic: runtime error: invalid memory address or nil pointer dereference

@compumatter commented on GitHub (Feb 17, 2025): same error here. docker compose up [+] Running 4/4 ✔ Network netbird-net Created 0.2s ✔ Volume "netbird_netbird-data" Created 0.0s ✔ Container netbird-management Created 1.0s ✔ Container netbird-dashboard Created 0.7s Attaching to netbird-dashboard, netbird-management netbird-management | panic: runtime error: invalid memory address or nil pointer dereference netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x15d63be] netbird-management | netbird-management | goroutine 1 [running]: netbird-management | github.com/netbirdio/netbird/management/cmd.loadMgmtConfig({0x1dce8d0, 0xc0002d0ea0}, {0x1b95517, 0x1c}) netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:511 +0x17e netbird-management | github.com/netbirdio/netbird/management/cmd.init.func2(0x2a520c0, {0x1b73875?, 0x4?, 0x1b73735?}) netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:104 +0x152 netbird-management | github.com/spf13/cobra.(*Command).execute(0x2a520c0, {0xc000554240, 0x2, 0x2}) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:925 +0x7d9 netbird-management | github.com/spf13/cobra.(*Command).ExecuteC(0x2a51b00) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5 netbird-management | github.com/spf13/cobra.(*Command).Execute(...) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 netbird-management | github.com/netbirdio/netbird/management/cmd.Execute(...) netbird-management | /home/runner/work/netbird/netbird/management/cmd/root.go:51 netbird-management | main.main() netbird-management | /home/runner/work/netbird/netbird/management/main.go:9 +0x1a netbird-management exited with code 2 netbird-management | panic: runtime error: invalid memory address or nil pointer dereference netbird-management | [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x15d63be] netbird-management | netbird-management | goroutine 1 [running]: netbird-management | github.com/netbirdio/netbird/management/cmd.loadMgmtConfig({0x1dce8d0, 0xc00028cd50}, {0x1b95517, 0x1c}) netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:511 +0x17e netbird-management | github.com/netbirdio/netbird/management/cmd.init.func2(0x2a520c0, {0x1b73875?, 0x4?, 0x1b73735?}) netbird-management | /home/runner/work/netbird/netbird/management/cmd/management.go:104 +0x152 netbird-management | github.com/spf13/cobra.(*Command).execute(0x2a520c0, {0xc00050b1a0, 0x2, 0x2}) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:925 +0x7d9 netbird-management | github.com/spf13/cobra.(*Command).ExecuteC(0x2a51b00) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5 netbird-management | github.com/spf13/cobra.(*Command).Execute(...) netbird-management | /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 netbird-management | github.com/netbirdio/netbird/management/cmd.Execute(...) netbird-management | /home/runner/work/netbird/netbird/management/cmd/root.go:51 netbird-management | main.main() netbird-management | /home/runner/work/netbird/netbird/management/main.go:9 +0x1a netbird-dashboard | AUTH_AUTHORITY or AUTH0_DOMAIN environment variable must be set netbird-dashboard | + LETSENCRYPT_DOMAIN=none netbird-dashboard | + LETSENCRYPT_EMAIL=example@local netbird-dashboard | + NGINX_SSL_PORT=443 netbird-dashboard | + '[' none-x == none-x ']' netbird-dashboard | + exit 0 netbird-dashboard | 2025/02/18 00:03:20 [emerg] 7#7: socket() [::]:80 failed (97: Address family not supported by protocol) netbird-dashboard | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) netbird-management exited with code 0 netbird-management | panic: runtime error: invalid memory address or nil pointer dereference
Author
Owner

@mlsmaycon commented on GitHub (Feb 17, 2025):

@compumatter can you confirm that your management.json has the HttpConfig block?

@mlsmaycon commented on GitHub (Feb 17, 2025): @compumatter can you confirm that your management.json has the HttpConfig block?
Author
Owner

@temarusanov commented on GitHub (Apr 3, 2025):

Same error here, running kubernetes-operator

@temarusanov commented on GitHub (Apr 3, 2025): Same error here, running kubernetes-operator
Author
Owner

@nbyloff commented on GitHub (Jul 17, 2025):

I solved the issue by adding the HttpConfig block in my management.json file. All demos on setting up netbird are based on configs that don't include that block. Here is mine:

"HttpConfig": {
        "LetsEncryptDomain": "",
        "CertFile": "/letsencrypt/fullchain.pem",
        "CertKey": "/letsencrypt/privkey.pem",
        "AuthAudience": "",
        "AuthIssuer": "https://auth.domain.test/application/o/netbird/",
        "AuthUserIDClaim": "",
        "AuthKeysLocation": "https://auth.domain.test/application/o/netbird/jwks/",
        "OIDCConfigEndpoint": "https://auth.domain.test/application/o/netbird/.well-known/openid-configuration",
        "IdpSignKeyRefreshEnabled": false,
        "ExtraAuthAudience": ""
    },

@nbyloff commented on GitHub (Jul 17, 2025): I solved the issue by adding the `HttpConfig` block in my management.json file. All demos on setting up netbird are based on configs that don't include that block. Here is mine: ```json "HttpConfig": { "LetsEncryptDomain": "", "CertFile": "/letsencrypt/fullchain.pem", "CertKey": "/letsencrypt/privkey.pem", "AuthAudience": "", "AuthIssuer": "https://auth.domain.test/application/o/netbird/", "AuthUserIDClaim": "", "AuthKeysLocation": "https://auth.domain.test/application/o/netbird/jwks/", "OIDCConfigEndpoint": "https://auth.domain.test/application/o/netbird/.well-known/openid-configuration", "IdpSignKeyRefreshEnabled": false, "ExtraAuthAudience": "" }, ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1552