Actions
Bug #12715
closedAPI generate sometimes error 500 when try create or update a directive
Pull Request:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Very Small
Priority:
0
Name check:
Fix check:
Regression:
Description
when I try to clone a directive from a server to another with the api,
I have sometimes (not always cause I just have to relaunch my query) an error 500
the data I send come from the first server with query get rudder/api/latest/directives
logs : 2018-05-30 11:40:19,250 - rudder-sync - INFO - createDirective: [Ubuntu] [Perms] Symlinks and permissions 2018-05-30 11:40:19,261 - rudder-sync - WARNING - apiQuery: eRRoR 500 : PUT https://10.66.239.8/rudder/api/latest/directives 2018-05-30 11:40:19,261 - rudder-sync - WARNING - apiQuery: request's answer: {"action":"createDirective","result":"error","errorDetails":"Could not create Directive <- Could not extract values from request <- Missing required attribute 'name' for <section>: JObject(List(JField(var,JObject(List(JField(value,JString(symlink)), JField(name,JString(FILE_AND_FOLDER_MANAGEMENT_ACTION)))))))"} {'displayName': '[Ubuntu] [Perms] Symlinks and permissions', 'enabled': 'true', 'id': '345ac34c-080f-40e0-a2c0-c2f07bfc4af6', 'longDescription': '', 'parameters': '{"section": {"sections": [{"section": {"sections": ' '[{"section": {"vars": [{"var": {"value": "/etc/krb5.conf", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": ' '"File"}}, {"section": {"vars": [{"var": {"value": "0", "name": ' '"FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", ' '"name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ' '".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": ' '"File cleaning options"}}, {"section": {"vars": [{"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": ' '{"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, ' '{"var": {"value": "", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": ' '"1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": ' '"false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": ' '"Permissions"}}, {"section": {"vars": [{"var": {"value": "", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, ' '{"var": {"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": ' '"Post-modification hook"}}], "vars": [{"var": {"value": ' '"symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, ' '{"var": {"value": "true", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": ' '{"value": "/etc/forge/krb5.conf", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File ' 'to manage"}}, {"section": {"sections": [{"section": {"vars": ' '[{"var": {"value": "/etc/bugzilla/localconfig", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, ' '{"section": {"vars": [{"var": {"value": "0", "name": ' '"FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", ' '"name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ' '".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": ' '"File cleaning options"}}, {"section": {"vars": [{"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": ' '{"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, ' '{"var": {"value": "", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": ' '"1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": ' '"false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": ' '"Permissions"}}, {"section": {"vars": [{"var": {"value": "", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, ' '{"var": {"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": ' '"Post-modification hook"}}], "vars": [{"var": {"value": ' '"symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, ' '{"var": {"value": "true", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": ' '{"value": "/srv/bugzilla/localconfig", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File ' 'to manage"}}, {"section": {"sections": [{"section": {"vars": ' '[{"var": {"value": "/etc/gitweb.conf", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, ' '{"section": {"vars": [{"var": {"value": "0", "name": ' '"FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", ' '"name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ' '".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": ' '"File cleaning options"}}, {"section": {"vars": [{"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": ' '{"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, ' '{"var": {"value": "", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": ' '"1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": ' '"false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": ' '"Permissions"}}, {"section": {"vars": [{"var": {"value": ' '"apachectl restart", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, {"var": ' '{"value": "true", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": ' '"Post-modification hook"}}], "vars": [{"var": {"value": ' '"symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, ' '{"var": {"value": "true", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": ' '{"value": "/etc/forge/gitweb.conf", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File ' 'to manage"}}, {"section": {"sections": [{"section": {"vars": ' '[{"var": {"value": "/etc/forge/AuthzGIT", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, ' '{"section": {"vars": [{"var": {"value": "0", "name": ' '"FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", ' '"name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ' '".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": ' '"File cleaning options"}}, {"section": {"vars": [{"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": ' '{"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, ' '{"var": {"value": "", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": ' '"1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": ' '{"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": ' '"false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": ' '"Permissions"}}, {"section": {"vars": [{"var": {"value": "", ' '"name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, ' '{"var": {"value": "false", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": ' '"Post-modification hook"}}], "vars": [{"var": {"value": ' '"symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, ' '{"var": {"value": "true", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": ' '{"value": "/etc/forge/AuthzSVN", "name": ' '"FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File ' 'to manage"}}], "name": "sections"}}', 'priority': 5, 'shortDescription': '', 'tags': [], 'techniqueName': 'fileManagement', 'techniqueVersion': '4.0'} 2018-05-30 11:40:19,262 - rudder-sync - WARNING - apiQuery: request's datas: None debug: curl -k -H "X-API-Token: token-XXX" -X PUT "https://10.66.239.8/rudder/api/latest/directives" -d "{'id': '345ac34c-080f-40e0-a2c0-c2f07bfc4af6', 'displayName': '[Ubuntu] [Forge] [14.4.5] [Perms] Symlinks and permissions', 'parameters': '{"section": {"sections": [{"section": {"sections": [{"section": {"vars": [{"var": {"value": "/etc/krb5.conf", "name": "FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, {"section": {"vars": [{"var": {"value": "0", "name": "FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", "name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": "File cleaning options"}}, {"section": {"vars": [{"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", "name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": "1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": "Permissions"}}, {"section": {"vars": [{"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": "Post-modification hook"}}], "vars": [{"var": {"value": "symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, {"var": {"value": "true", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": {"value": "/etc/forge/krb5.conf", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File to manage"}}, {"section": {"sections": [{"section": {"vars": [{"var": {"value": "/etc/bugzilla/localconfig", "name": "FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, {"section": {"vars": [{"var": {"value": "0", "name": "FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", "name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": "File cleaning options"}}, {"section": {"vars": [{"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", "name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": "1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": "Permissions"}}, {"section": {"vars": [{"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": "Post-modification hook"}}], "vars": [{"var": {"value": "symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, {"var": {"value": "true", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": {"value": "/srv/bugzilla/localconfig", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File to manage"}}, {"section": {"sections": [{"section": {"vars": [{"var": {"value": "/etc/gitweb.conf", "name": "FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, {"section": {"vars": [{"var": {"value": "0", "name": "FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", "name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": "File cleaning options"}}, {"section": {"vars": [{"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", "name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": "1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": "Permissions"}}, {"section": {"vars": [{"var": {"value": "apachectl restart", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, {"var": {"value": "true", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": "Post-modification hook"}}], "vars": [{"var": {"value": "symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, {"var": {"value": "true", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": {"value": "/etc/forge/gitweb.conf", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File to manage"}}, {"section": {"sections": [{"section": {"vars": [{"var": {"value": "/etc/forge/AuthzGIT", "name": "FILE_AND_FOLDER_MANAGEMENT_PATH"}}], "name": "File"}}, {"section": {"vars": [{"var": {"value": "0", "name": "FILE_AND_FOLDER_DELETION_DAYS"}}, {"var": {"value": "none", "name": "FILE_AND_FOLDER_DELETION_OPTION"}}, {"var": {"value": ".*", "name": "FILE_AND_FOLDER_DELETION_PATTERN"}}], "name": "File cleaning options"}}, {"section": {"vars": [{"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP"}}, {"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER"}}, {"var": {"value": "000", "name": "FILE_AND_FOLDER_MANAGEMENT_PERM"}}, {"var": {"value": "1", "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SGID"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_SUID"}}], "name": "Permissions"}}, {"section": {"vars": [{"var": {"value": "", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND"}}, {"var": {"value": "false", "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN"}}], "name": "Post-modification hook"}}], "vars": [{"var": {"value": "symlink", "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION"}}, {"var": {"value": "true", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE"}}, {"var": {"value": "/etc/forge/AuthzSVN", "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_SOURCE"}}], "name": "File to manage"}}], "name": "sections"}}', 'tags': [], 'priority': 5, 'longDescription': '', 'shortDescription': '', 'enabled': 'true', 'techniqueVersion': '4.0', 'techniqueName': 'fileManagement'}"
Actions