RestAPI returns nothing on check_config with error in one

Hi there!
I try to check (wrong) config using Rest API request like this:

curl -X POST "https://my_hass_url/api/services/homeassistant/restart" -H "Authorization: Bearer <token_here>"

and it returns empty object:

[]

And there is an error appears in logs after the request:

Log Details (ERROR)
Sun May 10 2020 13:51:12 GMT+0300 (MSK)

Invalid config for [recorder]: [purge_days] is an invalid option for [recorder]. Check: recorder->recorder->purge_days. (See /config/configuration.yaml, line 201). Please check the docs at https://home-assistant.io/integrations/recorder/

Home Assistant 0.103.0 running in docker.
What could be wrong?

Exactly what it says. I think you want to use purge_keep_days ?

Restart won’t work if your config is not correct :slight_smile:

Hi! The error in the config is for testing purposes. Plus I’ve got some additional info: It does work, but only first time after restart (with the error fixed and then readded).

dell ➜  curl -X POST "https://my_hass/api/services/homeassistant/restart" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" 

[{"attributes": {"message": "Config error. See [the logs](/developer-tools/logs) for details.", "title": "Config validating"}, "context": {"id": "d91ecf9997234ebf94a6164fce497cf8", "parent_id": null, "user_id": null}, "entity_id": "persistent_notification.homeassistant_check_config", "last_changed": "2020-05-10T11:36:03.866471+00:00", "last_updated": "2020-05-10T11:36:03.866471+00:00", "state": "notifying"}]%   

dell ➜  curl -X POST "https://my_hass/api/services/homeassistant/restart" -H "Authorization: Bearer <token> " -H "Content-Type: application/json"
[]% 

Sorry for misleading first message. Actual question is why API returns readable response on first request only.

Why you don’t try this : POST /api/config/core/check_config

I do, result is the same: API returns an error only on the first request.