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

Panic when logged out #18

Open
nogweii opened this issue Feb 21, 2022 · 3 comments
Open

Panic when logged out #18

nogweii opened this issue Feb 21, 2022 · 3 comments

Comments

@nogweii
Copy link

nogweii commented Feb 21, 2022

When running tailscale-systray when the daemon is not running it appears as normal. Clicking "Connect" in the menu prompts me to start the daemon, so I ran systemctl start tailscaled. Once the daemon starts the systray program crashes.

Running it in the terminal:

$ tailscale-systray 
panic: runtime error: index out of range [0] with length 0

goroutine 23 [running]:
main.onReady.func4()
github.com/mattn/tailscale-systray/main.go:155 +0x885
created by main.onReady
github.com/mattn/tailscale-systray/main.go:121 +0x43d

Running tailscale status in the terminal:

Text output
Logged out
JSON output
{
"Version": "1.20.4",
"BackendState": "NeedsLogin",
"AuthURL": "",
"TailscaleIPs": null,
"Self": {
"ID": "",
"PublicKey": "nodekey:0000000000000000000000000000000000000000000000000000000000000000",
"HostName": "local-machine",
"DNSName": "",
"OS": "linux",
"UserID": 0,
"TailscaleIPs": null,
"Addrs": [],
"CurAddr": "",
"Relay": "",
"RxBytes": 0,
"TxBytes": 0,
"Created": "0001-01-01T00:00:00Z",
"LastWrite": "0001-01-01T00:00:00Z",
"LastSeen": "0001-01-01T00:00:00Z",
"LastHandshake": "0001-01-01T00:00:00Z",
"Online": false,
"KeepAlive": false,
"ExitNode": false,
"ExitNodeOption": false,
"Active": false,
"PeerAPIURL": null,
"InNetworkMap": false,
"InMagicSock": false,
"InEngine": false
},
"Health": [
"state=NeedsLogin, wantRunning=false"
],
"MagicDNSSuffix": "",
"CertDomains": null,
"Peer": null,
"User": null
}

Seems like it doesn't handle when .TailscaleIPs is null.

Versions

  • Tailscale 1.20.4
  • tailscale-systray on git 6434789
  • KDE Plasma 5.24.1
  • Arch Linux (with kernel 5.16.10-zen)
@nogweii
Copy link
Author

nogweii commented Feb 21, 2022

After logging in using a terminal, the systray works just fine.

Not sure if it matters, but this is on a fresh machine, that had only just recently installed tailscale. Never logged in before.

@prabirshrestha
Copy link

Hit the same issue. Seems like it always expects there to be 1 ip address. When not signed it it will crash.

tailscale-systray/main.go

Lines 154 to 156 in 8e943de

mu.Lock()
myIP = status.Self.TailscaleIPs[0]
mu.Unlock()

@RahulSriram
Copy link
Contributor

I had the same issue as mentioned here, I have opened a PR with a fix for it now

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

3 participants