Actions
Bug #20460
closedInvalid attribute 'special:all_servers_with_role' (or special:all_nodes_without_role) for entry ruleTarget
Status:
Released
Priority:
N/A
Assignee:
Category:
Web - Config management
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
Description
After migration to 7.0, we get error about the removed role-related special target (special:all_nodes_without_role
or special:all_servers_with_role
), like:
[2021-12-08 17:15:24+0100] ERROR rudder-ldap-entity-mapper - Invalid attribute 'special:all_servers_with_role' for entry ruleTarget. [2021-12-08 17:15:24+0100] WARN com.normation.rudder.repository.ldap.RoLDAPNodeGroupRepository - Error when mapping entry with DN 'ruleTarget=special:all_servers_with_role,groupCategoryId=SystemGroups,groupCategoryId=GroupRoot,ou=Rudder,cn=rudder-configuration' from node groups library, that entry will be ignored; cause was: UnexpectedObject: Can not unserialize target, 'special:all_servers_with_role' does not match any known target format [2021-12-08 17:15:24+0100] ERROR com.normation.rudder.domain.policies.RuleTarget - Error when trying to read the following serialized Rule target as a composite target: 'special:all_nodes_without_role'. Reported parsing error cause was: unknown token s Near: sp [2021-12-08 17:15:24+0100] WARN com.normation.rudder.repository.ldap.RoLDAPNodeGroupRepository - Error when mapping entry with DN 'ruleTarget=special:all_nodes_without_role,groupCategoryId=SystemGroups,groupCategoryId=GroupRoot,ou=Rudder,cn=rudder-configuration' from node groups library, that entry will be ignored; cause was: UnexpectedObject: Can not unserialize target, 'special:all_nodes_without_role' does not match any known target format
And:
[2021-12-20 21:50:21+0100] ERROR com.normation.rudder.domain.policies.RuleTarget - Error when trying to read the following serialized Rule target as a composite target: 'special:all_nodes_without_role'. Reported parsing error cause was: unknown token s Near: sp [2021-12-20 21:50:21+0100] ERROR rudder-ldap-entity-mapper - Invalid attribute '{"include":{"or":["group:f0e24e0a-1900-4d07-977d-da12db681abd","policyServer:root","special:all_nodes_without_role"]},"exclude":{"or":["group:all-nodes-with-dsc-agent"]}}' for entry ruleTarget.
There is likely two problems:
- the special targets are read before they are suppressed, so we don't know them anymore: they should be ignored.
- if the target was used in a rule, it will lead to second error telling that the special target is not known => we need to migrated these case.
For migration:
- special:all_nodes_without_role
can be migrated to special:all_exceptPolicyServers
since only policy servers had roles
- special:all_servers_with_role
can be migrated to a new special:all_policyServers
target - there is no reason it doesn't exist I think.
Actions