Error message:{"title": "The operation has failed.", "status": 422, "detail": "Currently there are no changes to activate."}
I have a automation user called vhost-ctrl. With that user (Authorization: Bearer USER PASS) I write new rules.
After wriring rules, I want to activate the changes by posting {"redirect":false,"sites":[]} to /domain-types/activation_run/actions/activate-changes/invoke.
But the API responses with 422 - No changes to activate. Even without sending sites. Omitting sites should do changes in any site, per documentation. That is what I want to achieve. Specify the right sites does not work either.
But opening the GUI as cmkadmin clearly states the opposite:
Exception 'Exception' with message 'Activation failed! {"title": "The operation has failed.", "status": 422, "detail": "Currently there are no changes to activate."}' but there are!
/domain-types/activation_run/actions/activate-changes/invoke still returns {"title": "The operation has failed.", "status": 422, "detail": "Currently there are no changes to activate."} but thats not true:
EDIT: No matter, if I post {"redirect":false,"force_foreign_changes":false} or {"redirect":false,"force_foreign_changes":true} or {"redirect":false,"sites":[],"force_foreign_changes":true}.
The request is posted in the initial post - but here again:
Endpoint: http://cmkserver/qlb/check_mk/api/1.0/domain-types/activation_run/actions/activate-changes/invoke
Method: POST
Headers: "Authorization: Bearer User:PW and Content-Type: application/json
Body: {"redirect":false,"sites":[],"force_foreign_changes":true} (tested with empty sites and specified site)
To be more clear - there are no foreign changes to activate, it just shows the webUI as cmkadmin. The mentioned vhost_ctrl user is the author of all changes and later CMK should apply its own changes.
So theoretically, foreign changes do not even come to play.
I have not seen this issue with other users or customers, so my gut still tells me, it is a local problem at your end. If it is still not resolved, I recommend opening a support ticket, as that enables us to take a look together. From the distance I cannot reproduce your problem in a fresh and current site. Can you?
Thanks for the idea - but no, that does not helped either.
I tested again against p17 (CEE): No change. Even with sleep between changes and the activation. I still get:
Activating changes...No activation needed!
422: {"title": "The operation has failed.", "status": 422, "detail": "Currently there are no changes to activate."}
(All except the SJON string is part of my application).
Someone may have made a change on one or more of the distributed sites. If that happened and you are trying to activate changes on the primary site, then you could get this. All changes need to be made on the primary site and replicated down. As part of our best practices for our installs, we turn off WATO/Setup on the distributed sites.