Home My Page Projects FusionForge
Summary Activity Forums Tracker Lists News SCM Files Mediawiki Hudson/Jenkins

[#765] 20140819-frs-migrate-rbac.sql: violates constraint "pfo_role_setting_unique"

Date:
2015-03-31 13:26
Priority:
3
State:
Closed
Submitted by:
Sylvain Beucler (beuc-inria)
Assigned to:
Franck Villaume (nerville)
Target Release:
6.0
Found in Version:
master
Severity:
major
Resolution:
Fixed
Summary:
20140819-frs-migrate-rbac.sql: violates constraint "pfo_role_setting_unique"

Detailed description
20140819-frs-migrate-rbac.sql doesn't apply correctly here, I get:

fusionforge=> SELECT FRSmigrateRBAC() as output;
ERROR: duplicate key value violates unique constraint "pfo_role_setting_unique"
DETAIL: Key (role_id, section_name, ref_id)=(1, frs, 1142) already exists.
CONTEXT: SQL statement "insert into pfo_role_setting (role_id, section_name, ref_id, perm_val) values (r.roleid, 'frs', t.packid, 1)"
PL/pgSQL function frsmigraterbac() line 20 at SQL statement
Message  ↓
Date: 2015-04-13 13:44
Sender: Franck Villaume

fix in branch 6.0
commit: 7bc3fbe9eb8ae5f9748038eba39b9f7d99abab02

Date: 2015-04-13 09:22
Sender: Sylvain Beucler

Hi, the upgrade script runs without error now, it appears to work AFAICS.

Date: 2015-04-12 17:30
Sender: Franck Villaume

Please find as attachment a fix against this bug.
Can you try it before pushing it into ff 6.0 branch ?

Date: 2015-04-03 10:04
Sender: Sylvain Beucler

As far as I understand:

- The script tries to change the meaning of the "frs" permission.

- However, there is a conflict between the previous meaning (ref_id=group_id) and the new one (ref_id=tracker_id) during the migration.

In this particular error, it tries, for the very first role (anonymous=1), to create a new "frs" permission on tracker ID 1142, while there is already a permission on group ID 1142.

Can you rework this script?

Attachments:
Size Name Date By Download
4 KiB0001-fix-765-20140819-frs-migrate-rbac.sql-violates-const.patch2015-04-12 17:30nerville0001-fix-765-20140819-frs-migrate-rbac.sql-violates-const.patch
Field Old Value Date By
ResolutionAwaiting Response2015-04-13 13:44nerville
status_idOpen2015-04-13 13:44nerville
close_dateNone2015-04-13 13:44nerville
ResolutionNone2015-04-12 17:30nerville
File Added500: 0001-fix-765-20140819-frs-migrate-rbac.sql-violates-const.patch2015-04-12 17:30nerville
assigned_tonone2015-04-03 10:04beuc-inria
SeverityNone2015-04-03 10:04beuc-inria