Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 netbird service not starting (context deadline exceeded) #1685

Closed
xiya233 opened this issue Mar 10, 2024 · 6 comments
Closed

Windows 10 netbird service not starting (context deadline exceeded) #1685

xiya233 opened this issue Mar 10, 2024 · 6 comments

Comments

@xiya233
Copy link

xiya233 commented Mar 10, 2024

Describe the problem

Install the current latest version (v0.26.2) and check the running status: Error: failed to connect to daemon error: context deadline exceeded

Executing the following command tries to fix it, but it does not work:

netbird service uninstall
netbird service install --log-level debug
netbird service start

Suspected to be related to this issue: #1418

To Reproduce

Steps to reproduce the behavior:

1.Install the latest version
2.Error received

Are you using NetBird Cloud?

Self-host NetBird's control plane

Deploy according to this document: https://docs.netbird.io/selfhosted/selfhosted-quickstart

NetBird version

0.26.2

NetBird status -d output:

Error: failed to connect to daemon error: context deadline exceeded
If the daemon is not running please run:
netbird service install
netbird service start

Screenshots

2024-03-10_11-02-19
2024-03-10_11-03-14

@pappz
Copy link
Contributor

pappz commented Mar 11, 2024

Hello!

I saw you started the service in debug mode. Could you send me the log file?
You can see the steps about how you can collect the logs in this page.

@xiya233
Copy link
Author

xiya233 commented Mar 11, 2024

Hello!

I saw you started the service in debug mode. Could you send me the log file? You can see the steps about how you can collect the logs in this page.

Hello

There is nothing of value within the client.log file

2024-03-11T20:47:30+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:48:43+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:49:26+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:52:26+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:52:48+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:55:58+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service
2024-03-11T20:57:02+08:00 INFO client/cmd/service_controller.go:24: starting Netbird service

But if I run the command within powershell:

netbird service run --config C:\ProgramData\Netbird\config.json --log-level debug --log-file C:\ProgramData\Netbird\client.log

I will get an error message:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x28 pc=0x1723a9d]

goroutine 24 [running]:
net/url.(*URL).Hostname(...)
        /opt/hostedtoolcache/go/1.21.7/x64/src/net/url/url.go:1144
github.com/netbirdio/netbird/client/internal.UpdateOldManagementURL({0x1d1bd68, 0xc0003745f0}, 0xc0000b9130, {0xc00010e4b0, 0x22})
        /home/runner/work/netbird/netbird/client/internal/config.go:398 +0xfd
github.com/netbirdio/netbird/client/server.(*Server).Start(0xc0006c61a0)
        /home/runner/work/netbird/netbird/client/server/server.go:109 +0x533
github.com/netbirdio/netbird/client/cmd.(*program).Start.func1()
        /home/runner/work/netbird/netbird/client/cmd/service_controller.go:59 +0x513
created by github.com/netbirdio/netbird/client/cmd.(*program).Start in goroutine 1
        /home/runner/work/netbird/netbird/client/cmd/service_controller.go:47 +0x315

@xiya233
Copy link
Author

xiya233 commented Mar 11, 2024

Also I can't set the Management URL through the GUI, once I enter the self-hosted URL to save it, the content is reset

I check config.json and it shows:

"ManagementURL": null,

If I set inside config.json

"ManagementURL": "https://netbird.xxxxx.com",

then run

netbird service run --config C:\ProgramData\Netbird\config.json --log-level debug --log-file C:\ProgramData\Netbird\client.log

client.log will receive error message:

2024-03-11T21:35:05+08:00 WARN client/server/server.go:104: unable to create configuration file: json: cannot unmarshal string into Go struct field Config.ManagementURL of type url.URL
2024-03-11T21:35:05+08:00 FATL client/cmd/service_controller.go:60: failed to start daemon: json: cannot unmarshal string into Go struct field Config.ManagementURL of type url.URL

@pappz
Copy link
Contributor

pappz commented Mar 11, 2024

The correct syntax of the URL config looks like this:

    "ManagementURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "netbird.xxxxx.com:443",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },
    "AdminURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "app.netbird.xxxxx.com:443",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },

@xiya233
Copy link
Author

xiya233 commented Mar 12, 2024

The correct syntax of the URL config looks like this:

    "ManagementURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "netbird.xxxxx.com:443",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },
    "AdminURL": {
        "Scheme": "https",
        "Opaque": "",
        "User": null,
        "Host": "app.netbird.xxxxx.com:443",
        "Path": "",
        "RawPath": "",
        "OmitHost": false,
        "ForceQuery": false,
        "RawQuery": "",
        "Fragment": "",
        "RawFragment": ""
    },

Thanks for the sample configuration, I've fixed it!

@xiya233
Copy link
Author

xiya233 commented Mar 12, 2024

For the previous problem, it may have been caused by netbird copying an old wiretrustee config file that I used a few years ago

lmao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants