Bug #24853
closedCannot remove rules create with API
Updated by Gael Richier 6 months ago · Edited
- Category set to API
Hello,
I create a rule using API, with spaces (2) in the ID and name.
When I tried to remove this rules from UI or API, I have the following error:
2024-05-13 12:53:39+0000 ERROR api-processing - Inconsistency: Error when parsing 'Audit+all+host' as a rudder id. At most one '+' is authorized.
Do you have a workaround to remove it ? (I tried remove the rules file from /var/rudder/configuration-repository/rules and restart the server, but the issue still there)
Updated by Clark ANDRIANASOLO 6 months ago
Hello @Gael Richier !
Unfortunately having spaces within the ID
can lead to errors, we recommend only using alphanumeric characters and '-' or '_' for the ID
A workaround is effectively to remove the rule from /var/rudder/configuration-repository/rules
as you did, but you need to commit that on the git repository, AND also commit all other changes on rules. In practice :
git add ./rules
git commit -m "Delete 'Audit all host' rule, ..."
Then you would need to use to archiving feature of Rudder : in the menu, open Utilities > Archives, and scroll to Archive rules, then restore rules with Latest Git commit.
After that, the rule should have been deleted from Rudder.
Beware that if you don't correctly commit your changes on rules, you may lose data. So you should double check that !
Updated by Gael Richier 6 months ago
Thanks for the workaround, it's working !
Maybe add a control on the create API side to avoid spaces in ID could be a good improvement like you do in delete.
I'll use a "slugification" in a future to avoid this again
Updated by Clark ANDRIANASOLO 6 months ago · Edited
- Status changed from New to Resolved
- Assignee set to Clark ANDRIANASOLO
- Target version set to 7.3.15
Happy to hear that grichier
empty, an UUID would be generated which is the case when creating it from the Rudder UI.
Yes, we definitely should add the control...
By default if you leave the @ID
Updated by Clark ANDRIANASOLO 6 months ago
- Related to Bug #24859: Creating IDs with special characters should not be supported added