Project

General

Profile

Actions

Bug #14056

closed

Cannot modify groups when workflow are enabled

Added by Nicolas CHARLES almost 6 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
73
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

Related to Rudder - Bug #13582: Hikari pool autocomit configuration is incorrect, which can impact performanceReleasedNicolas CHARLESActions
Actions #1

Updated by Nicolas CHARLES almost 6 years ago

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

Actions #2

Updated by Nicolas CHARLES almost 6 years 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)

Actions #3

Updated by Nicolas CHARLES almost 6 years ago

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

Updated by Nicolas CHARLES almost 6 years ago

tried with the nefarious @Transactional, without success either

Actions #5

Updated by Nicolas CHARLES almost 6 years ago

  • Translation missing: en.field_tag_list 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
Actions #6

Updated by François ARMAND almost 6 years ago

We are reverting the autocommit property in branch 4.1 only.

Actions #7

Updated by François ARMAND almost 6 years ago

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

Updated by François ARMAND almost 6 years 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
Actions #9

Updated by François ARMAND almost 6 years ago

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

Updated by Vincent MEMBRÉ almost 6 years 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
Actions #12

Updated by Vincent MEMBRÉ almost 6 years 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
Actions #13

Updated by Alexis Mousset over 2 years ago

  • Priority changed from 84 to 73
Actions

Also available in: Atom PDF