Skip to content

internal/tsutil: add support for new incremental notification system for peer changes - #290

Merged
DeedleFake merged 11 commits into
masterfrom
netmap-deprecation-fix
Sep 1, 2026
Merged

internal/tsutil: add support for new incremental notification system for peer changes#290
DeedleFake merged 11 commits into
masterfrom
netmap-deprecation-fix

Conversation

@DeedleFake

@DeedleFake DeedleFake commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Possible fix for #286.

ipn.Notify's NetMap field is deprecated, so this adds support for the new way to do it.

This works fine in a backwards-compatible mode currently, but needs to wait for a new version of tailscaled, probably 1.100, that supports disabling the NetMap to be tested properly.

@DeedleFake DeedleFake self-assigned this Jul 13, 2026
@DeedleFake DeedleFake changed the title internal/tsutil: add support for new incremental notification system internal/tsutil: add support for new incremental notification system for peer changes Jul 13, 2026
@DeedleFake
DeedleFake force-pushed the netmap-deprecation-fix branch from b313c03 to a3940a9 Compare July 13, 2026 21:08
@DeedleFake
DeedleFake force-pushed the netmap-deprecation-fix branch from b4d995a to 8e6605e Compare August 21, 2026 00:38
@gitzone83

gitzone83 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Ran into this from the other direction and it turns out the NetMap deprecation isn't just a status refresh issue anymore - against tailscaled 1.102.x, master segfaults on startup before the window even opens.

I was debugging what I assumed was my own bug on a feature branch, built unmodified master in a clean worktree to rule it out, and got the identical panic:

ERROR get next IPN bus notification err="json: cannot unmarshal object into Go struct
field Notify.NetMap.SSHPolicy.rules.0.action of type tailcfg.SSHAction: Go struct field
SessionDuration has unsupported `format` tag option"

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

tailscale.com/ipn.PrefsView.ExitNodeID(...)          ipn_view.go:251
tsutil.(*IPNStatus).ExitNodeActive(...)              internal/tsutil/poller.go:341
tray.exitToggleText(...)                             internal/tray/tray.go:216
tray.(*Tray).update(...)                             internal/tray/tray.go:156
tray.(*Tray).Start(...)                              internal/tray/tray.go:100
ui.(*App).initTray(...)                              internal/ui/app.go:451

1.102.x sends an SSHPolicy that v1.100.0 can't unmarshal, so the notification gets dropped and Prefs never gets set. Then initTray calls straight into exitToggleTextExitNodeActive(), which does s.Prefs.ExitNodeID() on a nil Prefs. Dead before any UI shows up. Happens every run - Ubuntu 26.04, GTK 4.22.4, Go 1.27, master at 071b447.

Also, re: this from the description -

needs to wait for a new version of tailscaled, probably 1.100, that supports disabling the NetMap to be tested properly

1.102.3 is out and shipping in apt and Flathub now, so whatever you were waiting on should be there.

For what it's worth I tried bumping just tailscale.com to v1.102.3 on top of master, nothing else, none of the poller.go work from this branch - and that alone fixes it. Clean startup, no unmarshal errors. Same bump this PR already has in go.mod.

Which makes me wonder if it's worth pulling the go.mod/go.sum bump out into its own commit and landing it separately? The poller rework here is the much bigger change and presumably wants proper testing, but meanwhile anyone on 1.102.x just can't run master at all.

Separately - might be worth a nil check on Prefs in ExitNodeActive and friends regardless. Right now a dropped notification turns into a startup segfault instead of just stale status, and that'll bite again the next time the schema shifts. I can test this branch against 1.102.3 if that's useful, just say so.

@DeedleFake

Copy link
Copy Markdown
Owner Author

Pulling out the dependencies could be a good idea, sure. I've got a few other things queued on master already, so it might be good to get a small update out while I continue to work on this.

@DeedleFake
DeedleFake force-pushed the netmap-deprecation-fix branch from 8e6605e to 2c42e88 Compare August 31, 2026 22:44
@DeedleFake
DeedleFake marked this pull request as ready for review September 1, 2026 02:05
@DeedleFake
DeedleFake merged commit 0d449eb into master Sep 1, 2026
3 checks passed
@DeedleFake
DeedleFake deleted the netmap-deprecation-fix branch September 1, 2026 02:10
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

Successfully merging this pull request may close these issues.

2 participants