[speedtest] Fix speedtest thing going offline when image not available #18066
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 validuri
this line will throw a (somewhat hidden)IllegalArgumentException
. All other errors in that method are properly catched, but this one does not throw anIOException
, which could be catched properly.