core: Error while setting up tailscale integration

The problem

When setting up the integration, I get ‘unknown error occurred’ I set up with my mail address as tailnet, and a newly generated API Key

This is the log output:

Logger: aiohttp.server
Source: components/tailscale/config_flow.py:26
First occurred: 7:11:03 PM (2 occurrences)
Last logged: 7:25:18 PM

Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/auth.py", line 181, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/config/config_entries.py", line 157, in post
    return await super().post(request, flow_id)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 252, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/tailscale/config_flow.py", line 44, in async_step_user
    await validate_input(
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/tailscale/config_flow.py", line 26, in validate_input
    await tailscale.devices()
  File "/srv/homeassistant/lib/python3.9/site-packages/tailscale/tailscale.py", line 115, in devices
    return Devices.parse_obj(data).devices
  File "pydantic/main.py", line 578, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Devices
devices -> 50052 -> created
  invalid datetime format (type=value_error.datetime)

What version of Home Assistant Core has the issue?

core-2021.12.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Tailscale

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tailscale/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 19 (10 by maintainers)

Most upvoted comments

@frenck Just tested with 2021.12.4: works like a charm, even with the ‘hello’ device Thank you! It looks like a great integration!

Removing the “hello” device from my tailscale account fixes/workaround the issue.

Extract from my list of devices. The issue is with the “hello” service, which has a blank “created” date. All the reports have the same “50052” id.

    "devices": [{
            "addresses": [
                "100.101.102.103",
                "fd7a:115c:a1e0:ab12:4843:cd96:6265:6667"
            ],
            "id": "50052",
            "user": "services@tailscale.com",
            "name": "hello.tailscale.com",
            "hostname": "hello",
            "clientVersion": "",
            "updateAvailable": false,
            "os": "linux",
            "created": "",
            "lastSeen": "2021-12-18T10:38:37Z",
            "keyExpiryDisabled": true,
            "expires": "0001-01-01T00:00:00Z",
            "authorized": true,
            "isExternal": true,
            "machineKey": "",
            "nodeKey": "nodekey:30dc3c061ac8b33fdc6d88a4a67b053b01b56930d78cae0cf7a164411d424c0d",
            "blocksIncomingConnections": false,
            "enabledRoutes": [],
            "advertisedRoutes": [],

All my other devices seem to have a proper date.

	Line 14:             "created": "",
	Line 87:             "created": "2021-02-28T12:06:36Z",
	Line 163:             "created": "2021-02-28T12:31:37Z",
	Line 203:             "created": "2021-02-28T08:34:32Z",
	Line 289:             "created": "2021-03-01T14:46:52Z",
	Line 351:             "created": "2021-08-09T08:36:24Z",
	Line 395:             "created": "2021-02-28T08:49:32Z",
	Line 488:             "created": "2021-02-28T11:11:10Z",
	Line 546:             "created": "2021-02-28T12:11:52Z",
	Line 615:             "created": "2021-12-13T16:13:50Z",
	Line 687:             "created": "2021-02-28T11:16:14Z",
	Line 733:             "created": "2021-10-31T18:24:20Z",
	Line 813:             "created": "2021-02-28T11:06:19Z",
	Line 893:             "created": "2021-11-07T12:02:34Z",

I still have the same “unknown error occurred” after upgrading to 2021.12.2.

@frenck I just upgraded to 2021.12.2, and tried to install the integration… but it gives the same error, with the exact same stacktrace as above (including linenumbers) I saw something about tailscale in de changelogs, so I assumed something changed… did I miss something?

@timconinx Thanks for reporting this one. The problem is that the Tailscale API specification isn’t clear on what to expect for all fields. So, for the initial build, I’ve kept it rather strict.

I’ll lose the type strictness of these fields and create a patch for it.

@mefisto22 If you come across an issue, anywhere on GitHub, and you want to express you have the same issue; Add an 👍 to the issue instead of responding “I have the same issue”, Thanks 👍