Skip to content

fix: Return proper error code on config-related startup errors.#31596

Open
max-foss wants to merge 1 commit intoKoenkk:devfrom
max-foss:master
Open

fix: Return proper error code on config-related startup errors.#31596
max-foss wants to merge 1 commit intoKoenkk:devfrom
max-foss:master

Conversation

@max-foss
Copy link
Copy Markdown

@max-foss max-foss commented Apr 3, 2026

Well, my monitoring interprets that HTTP 200 as everything is well and if I somehow end up with an invalid config, I don't notice.

Quick fix to address that, didn't want to pollute the issue tracker with yet another issue first.

@max-foss max-foss force-pushed the master branch 2 times, most recently from 26dd572 to 7711bc1 Compare April 3, 2026 14:09
@max-foss max-foss changed the base branch from master to dev April 3, 2026 14:13
@max-foss
Copy link
Copy Markdown
Author

max-foss commented Apr 3, 2026

Sorry for using actions as a test runner, don't have that set up locally.

@Koenkk
Copy link
Copy Markdown
Owner

Koenkk commented Apr 3, 2026

Well, my monitoring interprets that HTTP 200 as everything is well and if I somehow end up with an invalid config

What kind of monitoring do you have? We have to be careful that this doesn't cause the addon to end-up in a restart loop (https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/c362dd90473c7e98cd8c10128bd54a74c9a0e28e/common/Dockerfile#L54)

@max-foss
Copy link
Copy Markdown
Author

max-foss commented Apr 3, 2026

Hmm, good point.

Had a simple web check in Uptime Kuma that caught one failure-mode, but it's also just me being annoyed about this kind of behaviour:
image

Alternative we could add an endpoint that return OK or sth similar in body when it booted and has both a connection to the Zigbee stick and to the MQTT broker.

@Koenkk
Copy link
Copy Markdown
Owner

Koenkk commented Apr 3, 2026

I think it depends on how you look at it, the onboarding page works fine, therefore I think returning 200 is correct. If we return 500 here you would end up in a restart loop disabling the ability to correct the config.

@max-foss
Copy link
Copy Markdown
Author

max-foss commented Apr 5, 2026

Thanks for the quick feedback.

If it is so problematic in relation to other services, I will either find a way to make the full MQTT health_check work in Uptime Kuma or design a dedicated endpoint just for all kinds of HTTP health monitoring.

The latter would be its own PR.

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

Successfully merging this pull request may close these issues.

2 participants