Skip to content
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

[measure] Ability to recover from 500 errors #3028

Open
5 tasks done
challgren opened this issue Jan 29, 2025 · 7 comments
Open
5 tasks done

[measure] Ability to recover from 500 errors #3028

challgren opened this issue Jan 29, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@challgren
Copy link
Contributor

System Health details

Measure script issue

Checklist

  • I have read the FAQ to see if there is a known solution to my problem.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I've been recently contributing to powercalc and I have been measuring some of my devices using the built in script.

However one of my biggest grips is when there is a 500 error presented during the home assistant api call there is no graceful error handling. Without this error handling or attempt to retry the entire measure session is wasted on a temporary error that is quickly gone away.

Reproduction steps

  1. Start measure session
  2. Create error 500 response code during measure session
  3. Watch entire 4 hours go down the drain

Debug logs

N/A

Diagnostics dump or YAML config

No response

@challgren challgren added the bug Something isn't working label Jan 29, 2025
@bramstroker
Copy link
Owner

You should be able to continue at the point it crashed when you have half CSV.
The measure tool should provide you with an option to resume.

Will have a look how to improve retry mechanism when HA API is temporarily unavailable.

@challgren
Copy link
Contributor Author

By default the RESUME var is not set in the env. I uncommented it out and resume worked. However still having timeouts so having to keep restarting the script.

@challgren
Copy link
Contributor Author

Ok so I figured out why I'm getting these random 500 errors.

I checked the Home Assistant main log and see.

Logger: homeassistant.components.light
Source: components/light/__init__.py:331
integration: Light ([documentation](https://www.home-assistant.io/integrations/light), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+light%22))
First occurred: 13:40:12 (5 occurrences)
Last logged: 23:38:17

Got `kelvin` argument in `turn_on` service, which is deprecated and will break in Home Assistant 2026.1, please use `color_temp_kelvin` argument

@challgren
Copy link
Contributor Author

Actually it looks like the issue is really the Hubspace integration. I keep getting 403 from their web service, my guess is rate limiting maybe occurring.

@bramstroker
Copy link
Owner

Yes the "error" you showed from log is not really an error but just a deprecation notice. Shouldn't break anything, and not be the cause of 500 error.

@bramstroker
Copy link
Owner

Actually it looks like the issue is really the Hubspace integration. I keep getting 403 from their web service, my guess is rate limiting maybe occurring.

You could try raising the SLEEP_TIME in order to prevent hitting rate limiting on that cloud API. looking at the response code it shouldn't be rate limiting, but I won't be surprised if it's a badly implemented API or infrastructure.

@challgren
Copy link
Contributor Author

Well majority of my issues were during the color_temp. Once I got into the HsVaration all my 403 errors resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants