python-tailscale icon indicating copy to clipboard operation
python-tailscale copied to clipboard

`devices()` raises `InvalidFieldValue` exception because `hair_pinning` is missing from `ClientSupports`

Open DouweM opened this issue 1 month ago • 2 comments

Exception:

mashumaro.exceptions.InvalidFieldValue: Field "devices" of type dict[str, Device] in Devices has invalid value {'...': {...,  'clientSupports': {'ipv6': False, 'pcp': False, 'pmp': False, 'udp': True, 'upnp': False}}, ... }

caused by:

mashumaro.exceptions.MissingField: Field "hair_pinning" of type Optional[bool] is missing in ClientSupports instance

This started happening today. I haven’t checked yet if this key is gone from the API entirely or if it’s just missing from some devices.

DouweM avatar Nov 11 '25 03:11 DouweM

Looks like this is because Home Assistant’s Tailscale integration expects the Admin API response shaped like:

{ "devices": [ { ...Device... }, { ... } ] }

But the v2 API response is now:

{ "<some_id>": { ... }, "<some_id>": { ... }, ... }

brandonscript avatar Nov 11 '25 18:11 brandonscript

Yeah, I think the API is "just" broken, doesn't follow the spec.

I've tried to create a ticket at https://tailscale.com/contact/support, but it is impossible to get through their AI bullshit generator, so filed a GH issue at https://github.com/tailscale/tailscale/issues/17853

They will process it within this decade, keep calm...

lmagyar avatar Nov 11 '25 22:11 lmagyar