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

Error When Adding Integration (No Trailing / ) #121

Open
ChipSkylark37 opened this issue Dec 26, 2024 · 1 comment
Open

Error When Adding Integration (No Trailing / ) #121

ChipSkylark37 opened this issue Dec 26, 2024 · 1 comment

Comments

@ChipSkylark37
Copy link

ChipSkylark37 commented Dec 26, 2024

Hello,

I seem to have a similar issue where I get an unexpected error when adding into Home Assistant via HACs.

I have seen some other closed Issues where there was a trailing slash, but I've verified and manually typed the URL, accessed the /metrics and tried with and without the username, enabling / disabling SSL check, and always get the same HTML error below.

EDIT: I forgot to add that I am using the API key instead of the normal password.

Can someone assist with what I may be able to do to resolve this?

`This error originated from a custom integration.

Logger: custom_components.uptime_kuma
Source: custom_components/uptime_kuma/config_flow.py:58
integration: Uptime Kuma (documentation, issues)
First occurred: 7:35:47 AM (1 occurrences)
Last logged: 7:35:47 AM

could not convert string to float: 'html>'
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/prometheus_client/parser.py", line 115, in _parse_sample
label_start, label_end = text.index("{"), text.rindex("}")
~~~~~~~~~~^^^^^
ValueError: substring not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/uptime_kuma/config_flow.py", line 58, in _validate_input
await uptime_robot_api.async_get_monitors()
File "/usr/local/lib/python3.13/site-packages/pyuptimekuma/decorator.py", line 68, in wrapper
response = UptimeKumaApiResponse.from_prometheus(
{"monitors": result, "_api_path": api_path, "_method": method}
)
File "/usr/local/lib/python3.13/site-packages/pyuptimekuma/models.py", line 76, in from_prometheus
for family in parsed:
^^^^^^
File "/usr/local/lib/python3.13/site-packages/prometheus_client/parser.py", line 14, in text_string_to_metric_families
yield from text_fd_to_metric_families(StringIO.StringIO(text))
File "/usr/local/lib/python3.13/site-packages/prometheus_client/parser.py", line 210, in text_fd_to_metric_families
sample = _parse_sample(line)
File "/usr/local/lib/python3.13/site-packages/prometheus_client/parser.py", line 133, in _parse_sample
value, timestamp = _parse_value_and_timestamp(text[name_end:])
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/prometheus_client/parser.py", line 107, in _parse_value_and_timestamp
value = float(values[0])
ValueError: could not convert string to float: 'html>'`

@ChipSkylark37
Copy link
Author

Adding it via the Local IP, without http(S) and instead using http works.

Is there an issue using the host name and over HTTPS? Since otherwise I can access the HTTPS instance without issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant