core
core copied to clipboard
Flume integration keep running into "refresh token invalid" issue
The problem
Every couple of weeks I started seeing this error and the integration stops working until I restart and enter password again.
WARNING (MainThread) [homeassistant.config_entries] Config entry '[email protected]' for flume integration could not authenticate: Message:Can't get token for user [email protected].
Response code returned:400.
Eror message returned:Refresh token is invalid.
Note that there is also a typo in "Eror".
When I enter the password at the reconfigure screen everything is back to normal. I have been using Flume integration for several months without issues so this behavior is something new.
What version of Home Assistant Core has the issue?
Home Assistant 2022.9.4 Frontend 20220707.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Flume
Link to integration documentation on our website
https://www.home-assistant.io/integrations/flume/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
WARNING (MainThread) [homeassistant.config_entries] Config entry '[email protected]' for flume integration could not authenticate: Message:Can't get token for user [email protected].
Response code returned:400.
Eror message returned:Refresh token is invalid.
Additional information
No response
flume documentation flume source (message by IssueLinks)
Hey there @chrismandich, @bdraco, @jeeftor, mind taking a look at this issue as it has been labeled with an integration (flume
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
So the fix (I think) which doesn't make sense is to remove the flume token file. This seems to be an issue with the flume lib as best as I can tell and I ran into it but was unable to duplicate the issue after removing my bad token file.
That being said there should be a better way to handle this.... because asking people to do this requires command line access to your ha instance ....
Also I think it would be much better for ha if we stored the token data not in a file but in the configuration database
@bdraco - you got any ideas?

Also the misspelling is in the parent lib (pyflume) which I'm considering forking and updating.... as the user hasn't touched GitHub in over a year.
make sense is to remove the flume token file Thanks for the tip, I've deleted the token file ([email protected]), hopefully that resolved it for me. I agree this is not an ideal fix for everyone.
@zraken - did that work for you? I really hate that answer because its very manually intensive.
Yes it worked but ran into another issue with the integration, this time there was nothing in the logs and data stopped updating. Anyway, this new thing is probably unrelated and I'll open a separate ticket if I get anything in the logs. For now a restart fixed it. You can close this ticket if there's nothing more user friendly that can be done.