8000 All Tile entities become unavailable when second tile account is being added · Issue #57912 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

All Tile entities become unavailable when second tile account is being added #57912

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

Closed
MarpleA opened this issue Oct 17, 2021 · 3 comments · Fixed by #57942
Closed

All Tile entities become unavailable when second tile account is being added #57912

MarpleA opened this issue Oct 17, 2021 · 3 comments · Fixed by #57942

Comments

@MarpleA
Copy link
MarpleA commented Oct 17, 2021

The problem

Using the Tile integration with only one tile account does work and current data will be polled from tile cloud service.
As soon as a second Tile account is added via Integrations, all tile entities (from first account and second account) become unavailable.
After removing one of the accounts, the entities of the other one will be available again.

logs say, credentials are invalid, which is not the case, since they work if only one account is being connected.

Best

What is version of Home Assistant Core has the issue?

core-2021.10.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

tile

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Error fetching Wallet 01 Tile data: Error while retrieving data: Invalid credentials
Error fetching Keyring 01 Tile data: Error while retrieving data: Invalid credentials
Error fetching Carkey 01 Tile data: Error while retrieving data: Invalid credentials

Additional information

No response

@probot-home-assistant
Copy link

Hey there @bachya, mind taking a look at this issue as it has been labeled with an integration (tile) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


tile documentation
tile source
(message by IssueLinks)

@bachya
Copy link
Contributor
bachya commented Oct 18, 2021

Thanks, @MarpleA. I'm able to reproduce, but am not sure of the cause yet.

One thing I see: as soon as a second API is added (and before we started receiving invalid credential errors), the logs show a lot of HTTP 419 errors:

2021-10-17 19:37:28 ERROR (MainThread) [homeassistant.components.tile] Error fetching Keys data: Error while retrieving data: Error requesting data from tiles/REDACTED: 419, message='', url=URL('https://production.tile-api.com/api/v1/tiles/REDACTED')

HTTP 419 denotes an authentication timeout (i.e., previously valid authentication has expired). It's odd that it would expire so quickly after creation, but I wonder if pytile is using some common value between all API objects. Will investigate.

@bachya
Copy link
Contributor
bachya commented Oct 18, 2021

Okay, I see what's happening:

  • All instances of the Tile integration make use of the same aiohttp ClientSession.
  • The Tile API sets a cookie that, regardless of user UUID or client UUID, takes precedence.
  • Because the second API object overrides the cookie, the first API object is no longer authenticated.

I'll look into creating a new session for each instance.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0