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

Suppress SseItemStates warnings during startup #3774

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Aug 22, 2023

During openhab startup the following warnings were logged:

09:35:16.934 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Power_Load_Display
09:35:16.935 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Power_From_Solar_Display
09:35:16.937 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Power_From_Grid
09:35:16.938 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Power_From_Grid_Display
09:35:16.939 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Weather_Current_Iconid
09:35:16.940 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Outdoor_Temperature
09:35:16.940 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: UV_Index_Color
09:35:16.941 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: UV_Index
09:35:16.941 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: UV_Protection
09:35:16.942 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Wind_Direction_Icon
09:35:16.942 [WARN ] [se.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: Wind_Speed

This PR suppresses these warnings when items weren't loaded yet, so the startup process is not littered with useless warnings.

@jimtng jimtng requested a review from a team as a code owner August 22, 2023 00:02
@jimtng
Copy link
Contributor Author

jimtng commented Sep 2, 2023

This issue could possibly be avoided if we could start Jetty http server after models and possibly rule engine is started, thus avoiding having to serve REST before things are ready.

@wborn
Copy link
Member

wborn commented Sep 10, 2023

What may also help is to use the application.ready.service.filter of the JAX-RS Whiteboard.

See:

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Looks like a fair and quick fix for the issue, thanks!

@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of the Core label Nov 7, 2023
@kaikreuzer kaikreuzer added this to the 4.1 milestone Nov 7, 2023
@kaikreuzer kaikreuzer merged commit 99bb994 into openhab:main Nov 7, 2023
2 checks passed
@jimtng jimtng deleted the rest-startup-warnings branch November 7, 2023 07:28
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 the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants