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

[speedtest] Fix speedtest thing going offline when image not available #18066

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented Jan 8, 2025

The issue is mentioned on the forum, but I ran into the same thing: https://community.openhab.org/t/an-exception-occurred-while-running-speedtest-invalid-uri-host-null-authority-null/156906

The root cause is Ookla does not always create a result image. This is visible through a flag(persisted) that is also part of the result. At the moment, the whole things goes offline. With this fix, it will just set the image to UnDefType.NULL but still show the other results.

The root cause of the thing going offline is in https://github.com/openhab/openhab-core/blob/f00c7700cb13b4ab6dbc6a8e493f226d8099689c/bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/http/HttpUtil.java#L212. If the url is not a valid uri this line will throw a (somewhat hidden) IllegalArgumentException. All other errors in that method are properly catched, but this one does not throw an IOException, which could be catched properly.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege mherwege requested a review from MikeTheTux as a code owner January 8, 2025 11:01
@mherwege mherwege added the bug An unexpected problem or unintended behavior of an add-on label Jan 8, 2025
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/an-exception-occurred-while-running-speedtest-invalid-uri-host-null-authority-null/156906/3

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the analysis and fix!

@jlaur jlaur merged commit 5ac2780 into openhab:main Jan 8, 2025
2 checks passed
@jlaur jlaur added this to the 5.0 milestone Jan 8, 2025
jlaur pushed a commit that referenced this pull request Jan 8, 2025
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@jlaur jlaur added the patch A PR that has been cherry-picked to a patch release branch label Jan 8, 2025
@mherwege mherwege deleted the speedtest branch January 8, 2025 19:26
GearrelW pushed a commit to GearrelW/openhab-addons that referenced this pull request Jan 12, 2025
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
chilobo pushed a commit to chilobo/openhab-addons that referenced this pull request Feb 10, 2025
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Christian Koch <78686276+chilobo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants