Actions
Bug #3880
closedErrors when accepting/refusing nodes are ignored
Status:
Released
Priority:
3
Assignee:
Category:
Web - Nodes & inventories
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
When using API to accept/refuse nodes, errors are not kept :
- When there is an error when saving nodes (see #3874) :
# curl -X GET -H 'Content-Type: application/json' -H "X-API-Token: NeCk6maZMEgL555YNYquJEToYyIIuCei" -H "X-API-Version: 2" http://rudder/rudder/api/nodes/pending 2> /dev/null | sed 's/,/\n/g' | grep $HOSTNAME -B 2 "data":{"nodes":[{"id":"f858fe6c-2e16-40a0-b400-2661a7c7f79c" "status":"pending" "hostname":"ruddertest-01" # curl -X POST -H "X-API-Version: 2" -H "X-API-Token: NeCk6maZMEgL555YNYquJEToYyIIuCei" http://rudder/rudder/api/nodes/pending -d "nodeId=f858fe6c-2e16-40a0-b400-2661a7c7f79c" -d "status=accepted" {"action":"changePendingNodeStatus","result":"success","data":{"nodes":[]}} # curl -X GET -H 'Content-Type: application/json' -H "X-API-Token: NeCk6maZMEgL555YNYquJEToYyIIuCei" -H "X-API-Version: 2" http://rudder.hq.k.grp/rudder/api/nodes/pending 2> /dev/null | sed 's/,/\n/g' | grep $HOSTNAME -B 2 "data":{"nodes":[{"id":"f858fe6c-2e16-40a0-b400-2661a7c7f79c" "status":"pending" "hostname":"ruddertest-01"
with an error in webapp.log:
[2013-08-27 14:06:20] INFO com.normation.rudder.web.rest.node.NodeApiService2 - List(NodeId(cdf1ca03-3300-47a7-8b0c-e8258ce22ed2)) [2013-08-27 14:06:30] ERROR com.normation.rudder.repository.EventLogRepository - PreparedStatementCallback; SQL []; ERROR: value too long for type character varying(64); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) [2013-08-27 14:06:30] ERROR com.normation.rudder.services.servers.NewNodeManagerImpl - Error when trying to accept node cdf1ca03-3300-47a7-8b0c-e8258ce22ed2. Rollbaking. <- Error when executing accept node process named add_server_to_dyngroup <- Error when trying to update dynamic group NodeGroupId(8017932f-b941-4f47-b687-ddeb6e326fa3) with member cdf1ca03-3300-47a7-8b0c-e8258ce22ed2 <- Error when logging modification as an event <- Exception caught while trying to save an eventlog : PreparedStatementCallback; SQL []; ERROR: value too long for type character varying(64); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) [2013-08-27 14:06:30] ERROR com.normation.rudder.services.servers.AcceptInventory - Error when rollbacking server node id cdf1ca03-3300-47a7-8b0c-e8258ce22ed2 in process 'accept_new_server:inventory', you should delete it by hand. Error messages: Can not move 'nodeId=cdf1ca03-3300-47a7-8b0c-e8258ce22ed2,ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration' to new parent 'ou=Nodes,ou=Pending Inventories,ou=Inventories,cn=rudder-configuration': no such object [2013-08-27 14:06:30] ERROR com.normation.rudder.services.servers.NewNodeManagerImpl - Unit acceptor error for a node <- Error when trying to accept node cdf1ca03-3300-47a7-8b0c-e8258ce22ed2 <- Error when executing accept node process named add_server_to_dyngroup <- Error when trying to update dynamic group NodeGroupId(8017932f-b941-4f47-b687-ddeb6e326fa3) with member cdf1ca03-3300-47a7-8b0c-e8258ce22ed2 <- Error when logging modification as an event <- Exception caught while trying to save an eventlog : PreparedStatementCallback; SQL []; ERROR: value too long for type character varying(64); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) [2013-08-27 14:06:30] ERROR com.normation.rudder.repository.EventLogRepository - PreparedStatementCallback; SQL []; ERROR: value too long for type character varying(64); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) [2013-08-27 14:06:30] WARN com.normation.rudder.repository.xml.GitNodeGroupArchiverImpl - Auto-archive git failure: not found in git added files: 'groups/8c1c96b4-267a-4b2b-9815-3d911f945858/9946eefb-01fd-4e4b-a5a1-471b63f7084c/8017932f-b941-4f47-b687-ddeb6e326fa3.xml'. You can safelly ignore that warning if the file was already existing in Git and was not modified by that archive. [2013-08-27 14:06:31] INFO com.normation.rudder.services.servers.NodeConfigurationServiceImpl - No node configuration was updated, no promises to write [2013-08-27 14:06:31] INFO com.normation.rudder.batch.AsyncDeploymentAgent - Successful deployment 560 [2013/08/27 14:06:30 - 2013/08/27 14:06:31] [2013-08-27 14:06:31] ERROR com.normation.rudder.repository.EventLogRepository - PreparedStatementCallback; SQL []; ERROR: value too long for type character varying(64); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64)
- When trying to accept a non existing nodes: the API says :
14:00 < coredumb> curl http://rudder/api/nodes/pending -d "nodeId=xxxxx" -d "status=accepted" 14:01 < coredumb> {"action":"changePendingNodeStatus","result":"success","data":{"nodes":[]}} 14:01 < coredumb> :D 14:03 < coredumb> i really did put xxxx
I suspect that something went wrong in NewNodeManager functions, ignoring failure (maybe due to some flatten ? )
This should affect 2.4 too
Actions