Project

General

Profile

Actions

Bug #3883

closed

The limit of the eventlog length (64chars) could lead to SQL errors

Bug #3883: The limit of the eventlog length (64chars) could lead to SQL errors

Added by François ARMAND almost 13 years ago. Updated almost 13 years ago.

Status:
Released
Priority:
2
Category:
Web - Maintenance
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Extracting that part of the bug #3874:

# 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":[]}}

(the return should be an error, see #3880)

Leads to:

[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)

The intersting part is:

   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)

Subtasks 2 (0 open2 closed)

Bug #3890: Remove virtual limitation on the user name in the databaseReleasedFrançois ARMANDActions
Bug #3891: Create a migration script for name length limitationReleasedJonathan CLARKEActions

Related issues 3 (0 open3 closed)

Related to Rudder - Bug #3880: Errors when accepting/refusing nodes are ignoredReleasedNicolas CHARLESActions
Related to Rudder - Bug #3874: API: Changing pending node status doesn't workReleasedFrançois ARMANDActions
Has duplicate Rudder - Bug #3885: Event logs can't be saved when the Actor name is more than 64 chars longRejectedFrançois ARMANDActions

Updated by François ARMAND almost 13 years ago Actions #1

  • Category set to Web - Nodes & inventories
  • Priority changed from N/A to 2
  • Target version set to 2.7.1

Updated by François ARMAND almost 13 years ago Actions #2

  • Description updated (diff)

Updated by François ARMAND almost 13 years ago Actions #3

More precise text from #3885:

No event logs are saved when the name of the user performing the action is more than 64 chars long.

This is due to a limitation we put in the eventLogs table :

principal varchar(64),

This cause a problem when using API, as we store a very long value, causing all API calls to fail ... :

We store :

REST Account: "name" (token which is very long)

If name is more than 10 characters, this is not working anymore

Updated by François ARMAND almost 13 years ago Actions #4

  • Category changed from Web - Nodes & inventories to Web - Maintenance
  • Status changed from New to 8
  • Assignee set to Nicolas CHARLES
  • Target version changed from 2.7.1 to 2.4.8

So, for that one, we should "just" have to:

  • correct the database creation to use "text" in place of "varchar 64" for that column,
  • add a migration script to alter the column accordingly in existing database.

Updated by Nicolas CHARLES almost 13 years ago Actions #5

  • Status changed from 8 to In progress

Ok, so there are two modifications for this, one as an integration, and one dev.
I'll create two tickets for that

Updated by Nicolas CHARLES almost 13 years ago Actions #6

  • Status changed from In progress to Pending technical review

Updated by Nicolas CHARLES almost 13 years ago Actions #7

  • Status changed from Pending technical review to Pending release

Tickets #3890 and #3891 have been merged, so this ticket is pending release

Updated by Nicolas PERRON almost 13 years ago Actions #8

  • Subject changed from Sometimes, trying to accept a node leads to SQL errors to The limit of the eventlog length (64chars) could lead to SQL errors

Updated by Nicolas PERRON almost 13 years ago Actions #9

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.4.8, which was released today.
Check out:

Actions

Also available in: PDF Atom