CEE, 2.3.0p25: distributed setup
OS version: rocky 8.10
Error message:
good day everyone,
just switched from the raw to the cee version in trial mode but the error i experience happens on both versions.
I provision a lot of tags (and my entire config tbh) through ansible with below versions:
> *collections:*
> *# Install a collection from Ansible Galaxy.*
> * - name: checkmk.general*
> * version: ">=5.4.0,<6.0.0"*
> * - name: community.mysql*
> * version: ">=3.12.0,<4.0.0"*
> * - name: community.general*
> * version: ">=10.2.0,<11.0.0"*
> requires-python = ">=3.12"
> dependencies = [
> "ansible-core>=2.18.1",
> "pymysql>=1.1.1",
> ]
All my tag configuration in my ansible is looking exactly the same (for each tag, i have about 15).
Coming from an sql query, i insert below:
> - name: "Create function tag."
> checkmk.general.tag_group:
> server_url: "{{ server_url }}"
> site: "{{ site }}"
> automation_user: "{{ automation_user }}"
> automation_secret: "{{ automation_secret }}"
> name: "function"
> title: "Function"
> topic: "my_topic"
> tags: |-
> {% set result = [] %}
> {% set _ = result.append({'id':'empty'| lower,'title': ""}) %}
> {% for function in tags_function_result.query_result[0] %}
> {% set _ = result.append({'id': function.hostgroup | lower, 'title': function.hostgroup}) %}
> {% endfor %}
> {{ result }}
> state: "present"
Now, only for the function tag i very often got the error:
...
> TASK [Create status tag.] ***************************************************************************************************************************************************************
> ok: [localhost]
>
> TASK [Create function tag.] *************************************************************************************************************************************************************
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "401 - The user is not authorized to do this request Details: b'{\"title\": \"Updating this host tag group \\\\\"function\\\\\" requires additional authorization\", \"status\": 401, \"detail\": \"The host tag group you intend to edit is used by other instances. You must authorize Checkmk to update the relevant instances using the repair parameter\"}'"}
How I solve this at the moment:
OMD[monitoring]:~/etc/check_mk$ truncate -s 0 conf.d/wato/tags.mk
OMD[monitoring]:~/etc/check_mk$ truncate -s 0 multisite.d/wato/tags.mk
I re-run my ansible-playbook again to provision tags (always with 1 and the same user):
> TASK [Create function tag.] *************************************************************************************************************************************************************
> changed: [localhost]
>
> TASK [Create hostgroup tag.] ************************************************************************************************************************************************************
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "400 - Bad request: Parameter or validation failure Details: b'{\"title\": \"Bad Request\", \"status\": 400, \"detail\": \"These fields have problems: id\", \"fields\": {\"id\": [\"The specified tag group id is already in use: \\'hostgroup\\'\"]}}'"}
If i re-run it again:
the latest error, happening on hostgroup tag is now on another tag I want to create.
funtion and hostgroup showing OK. So the sync is ok.
Can someone explain why:
1: checkmk is not having sufficient rights all of a sudden to update always the same function tag?
2: a tag group id is suddenly already in use? and where? because all others like function (after the truncate) are also in use
3: i can insert an empty id with an empty name via the rest api but not in the GUI.
this url gave me some insights but not a solution:
https://forum.checkmk.com/t/how-to-repair-tag-groups-you-can-not-override-the-builtin-tag-group-agent/32030/9
and a big thanks up front to whoever have some good feedback or ideas to solve the issue