Project

General

Profile

Bug #14056

Cannot modify groups when workflow are enabled

Added by Nicolas CHARLES 9 months ago. Updated 8 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
84
Tags:

Description

When creating a change request, it fails with the error message

There was problem with your request.
could not save change request Save Group XXXX <- Couldn't find newly created entry when saving Change Request

in the postgresql logs, we have

2018-12-28 16:26:55 CET [2905-189] rudder@rudder LOG:  execute S_1: COMMIT
2018-12-28 16:26:57 CET [2905-190] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 16:26:57 CET [2905-191] rudder@rudder LOG:  execute <unnamed>: insert into ChangeRequest (name, description, creationTime, content, modificationId) values ($1, $2, $3, $4, $5)
    RETURNING "id" 
2018-12-28 16:26:57 CET [2905-192] rudder@rudder DETAIL:  parameters: $1 = 'Save Group XXXXXX', $2 = '', $3 = '2018-12-28 16:26:57.616+01', $4 = '<changeRequest fileFormat="6"><groups><group id="4c395876-db0b-4cd2-b48c-a370a1e56f11"><initialState><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>nXXXXXXXXX</displayName><description></description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></initialState><firstChange><change><actor>admin</actor><date>2018-12-28T16:26:51.515+01:00</date><reason></reason><diff action="modifyTo"><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>XXXXXXXXXX</displayName><description>xxxxxxx</description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></diff></change></firstChange><nextChanges/></group></groups><directives/><rules/><globalParameters/></changeRequest>', $5 = ''
2018-12-28 16:26:57 CET [2905-193] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 16:27:01 CET [2905-194] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 16:27:01 CET [2905-195] rudder@rudder LOG:  execute <unnamed>: SELECT 1
2018-12-28 16:27:01 CET [2905-196] rudder@rudder LOG:  execute <unnamed>: SELECT id, name, description, creationTime, content, modificationId FROM ChangeRequest where id = $1
2018-12-28 16:27:01 CET [2905-197] rudder@rudder DETAIL:  parameters: $1 = '8'
2018-12-28 16:27:01 CET [2905-198] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 16:27:01 CET [2905-199] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 16:27:01 CET [2905-200] rudder@rudder LOG:  execute <unnamed>: SELECT CR.id

manually executing the query succeed.

reverting the change in #13582 solves the issue (setting query to auto commit)


Related issues

Related to Rudder - Bug #13582: Hikari pool autocomit configuration is incorrect, which can impact performanceReleasedActions

Associated revisions

Revision 7664b564 (diff)
Added by François ARMAND 9 months ago

Fixes #14056: Change request cannot be created - \"Couldn't find newly created entry when saving Change Request\"

Revision c055c4f9
Added by François ARMAND 9 months ago

Merge pull request #2106 from fanf/bug_14056/change_request_cannot_be_created_couldn_t_find_newly_created_entry_when_saving_change_request

Fixes #14056: Change request cannot be created - "Couldn't find newly created entry when saving Change Request"

History

#1

Updated by Nicolas CHARLES 9 months ago

It only happens in 4.1.15, 4.1.16 and 4.1.17 (4.3 branch is immune)

#2

Updated by Nicolas CHARLES 9 months ago

I tried to add connection.commit() at the end of the preparedStatement in createChangeRequest, without success
Setting connection.setAutoCommit(true) in the preparedStatement fails in a different way: the roRepo.get(ChangeRequestId(keyHolder.getKey().intValue)) cannot find the created entry, even if we see the database logs says


2018-12-28 17:44:27 CET [3613-223] rudder@rudder DETAIL:  parameters: $1 = '494513', $2 = '2018-12-28 17:44:27.828+01', $3 = 'executionStatus'
2018-12-28 17:44:27 CET [3613-224] rudder@rudder LOG:  execute S_1: COMMIT
2018-12-28 17:44:28 CET [3613-225] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-226] rudder@rudder LOG:  execute <unnamed>: SELECT 1
2018-12-28 17:44:28 CET [3613-227] rudder@rudder LOG:  execute S_1: COMMIT
2018-12-28 17:44:28 CET [3613-228] rudder@rudder LOG:  execute <unnamed>: insert into ChangeRequest (name, description, creationTime, content, modificationId) values ($1, $2, $3, $4, $5)
    RETURNING "id" 
2018-12-28 17:44:28 CET [3613-229] rudder@rudder DETAIL:  parameters: $1 = 'Save Group node-git-cve', $2 = '', $3 = '2018-12-28 17:44:28.814+01', $4 = '<changeRequest fileFormat="6"><groups><group id="4c395876-db0b-4cd2-b48c-a370a1e56f11"><initialState><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>node-git-cve</displayName><description></description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></initialState><firstChange><change><actor>admin</actor><date>2018-12-28T17:44:28.792+01:00</date><reason></reason><diff action="modifyTo"><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>node-git-cve</displayName><description>git cve</description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></diff></change></firstChange><nextChanges/></group></groups><directives/><rules/><globalParameters/></changeRequest>', $5 = ''
2018-12-28 17:44:28 CET [3613-230] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-231] rudder@rudder LOG:  execute <unnamed>: SELECT id, name, description, creationTime, content, modificationId FROM ChangeRequest where id = $1
2018-12-28 17:44:28 CET [3613-232] rudder@rudder DETAIL:  parameters: $1 = '18'
2018-12-28 17:44:28 CET [3613-233] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 17:44:28 CET [3613-234] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-235] rudder@rudder LOG:  execute <unnamed>: 
              insert into eventlog (creationdate, modificationid, principal, eventtype, severity, data, reason, causeid)
              values($1, $2, $3, $4,
                     $5, $6, $7, $8
                    )

    RETURNING "id" 
2018-12-28 17:44:28 CET [3613-236] rudder@rudder DETAIL:  parameters: $1 = '2018-12-28 17:44:28.859+01', $2 = 'e7532a9c-8ad7-4af6-8c0e-b97b2a9d33f6', $3 = 'admin', $4 = 'ChangeRequestAdded', $5 = '100', $6 = '<entry><changeRequest changeType="add"><id>18</id><name>Save Group node-git-cve</name><description></description></changeRequest></entry>', $7 = '', $8 = NULL
2018-12-28 17:44:28 CET [3613-237] rudder@rudder LOG:  execute S_1: COMMIT
2018-12-28 17:44:28 CET [3613-238] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-239] rudder@rudder LOG:  execute <unnamed>: SELECT id, state FROM Workflow WHERE id = $1
2018-12-28 17:44:28 CET [3613-240] rudder@rudder DETAIL:  parameters: $1 = '18'
2018-12-28 17:44:28 CET [3613-241] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 17:44:28 CET [3613-242] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-243] rudder@rudder LOG:  execute <unnamed>: INSERT into Workflow (id, state) values ($1, $2)
2018-12-28 17:44:28 CET [3613-244] rudder@rudder DETAIL:  parameters: $1 = '18', $2 = 'Pending validation'
2018-12-28 17:44:28 CET [3613-245] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 17:44:28 CET [3613-246] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-247] rudder@rudder LOG:  execute <unnamed>: SELECT id, state FROM Workflow WHERE id = $1
2018-12-28 17:44:28 CET [3613-248] rudder@rudder DETAIL:  parameters: $1 = '18'
2018-12-28 17:44:28 CET [3613-249] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 17:44:28 CET [3613-250] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:28 CET [3613-251] rudder@rudder LOG:  execute <unnamed>: SELECT CR.id, name, description, creationTime, content, modificationId FROM  changeRequest CR LEFT JOIN workflow W on CR.id = W.id where cast( xpath('/changeRequest/groups/group/@id', content) as text[]) = $1 and state like 'Pending%'
2018-12-28 17:44:28 CET [3613-252] rudder@rudder DETAIL:  parameters: $1 = '{4c395876-db0b-4cd2-b48c-a370a1e56f11}'
2018-12-28 17:44:28 CET [3613-253] rudder@rudder LOG:  execute S_6: ROLLBACK
2018-12-28 17:44:32 CET [3613-254] rudder@rudder LOG:  execute S_3: BEGIN
2018-12-28 17:44:32 CET [3613-255] rudder@rudder LOG:  execute <unnamed>: SELECT 1
2018-12-28 17:44:32 CET [3613-256] rudder@rudder LOG:  execute S_2: 
            select lastid, date from statusupdate where key=$1


and in the database
 id |          name           | description |        creationtime        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    content                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | modificationid 
----+-------------------------+-------------+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------
 18 | Save Group node-git-cve |             | 2018-12-28 17:44:28.814+01 | <changeRequest fileFormat="6"><groups><group id="4c395876-db0b-4cd2-b48c-a370a1e56f11"><initialState><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>node-git-cve</displayName><description></description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></initialState><firstChange><change><actor>admin</actor><date>2018-12-28T17:44:28.792+01:00</date><reason></reason><diff action="modifyTo"><nodeGroup fileFormat="6"><id>6b536c1a-4389-4aca-b5bb-156f87da37bb)</id><displayName>node-git-cve</displayName><description>git cve</description><query>{&quot;select&quot;:&quot;node&quot;,&quot;composition&quot;:&quot;And&quot;,&quot;where&quot;:[]}</query><isDynamic>true</isDynamic><nodeIds/><isEnabled>true</isEnabled><isSystem>false</isSystem></nodeGroup></diff></change></firstChange><nextChanges/></group></groups><directives/><rules/><globalParameters/></changeRequest> | 
(1 row)

#3

Updated by Nicolas CHARLES 9 months ago

  • Related to Bug #13582: Hikari pool autocomit configuration is incorrect, which can impact performance added
#4

Updated by Nicolas CHARLES 9 months ago

tried with the nefarious @Transactional, without success either

#5

Updated by Nicolas CHARLES 9 months ago

  • Tags set to Sponsored
  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Operational - other Techniques | Rudder settings | Plugins
  • Priority changed from 0 to 84
#6

Updated by François ARMAND 9 months ago

We are reverting the autocommit property in branch 4.1 only.

#7

Updated by François ARMAND 9 months ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
#8

Updated by François ARMAND 9 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/2106
#9

Updated by François ARMAND 9 months ago

  • Status changed from Pending technical review to Pending release
#11

Updated by Vincent MEMBRÉ 9 months ago

  • Subject changed from Change request cannot be created - "Couldn't find newly created entry when saving Change Request" to Cannot modify groups when workflow are enabled
#12

Updated by Vincent MEMBRÉ 8 months ago

  • Status changed from Pending release to Released
This bug has been fixed in Rudder 4.1.18, 4.3.8 and 5.0.4 which were released today.
Changelog
Changelog
Changelog

Also available in: Atom PDF