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

Description

Summary:

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 "pforolesettingunique" DETAIL: Key (roleid, sectionname, refid)=(1, frs, 1142) already exists. CONTEXT: SQL statement "insert into pforolesetting (roleid, sectionname, refid, permval) values (r.roleid, 'frs', t.packid, 1)" PL/pgSQL function frsmigraterbac() line 20 at SQL statement

General Information
Submitted by:
Sylvain Beucler
Date Submitted: 2015-03-31 13:26
Last Modified by: Nobody
Last Modified: 2017-11-02 20:00
Date Closed: 2015-04-13 13:44
Permalink: https://fusionforge.org/tracker/a_follow.php/765
Actions
Internal Fields
Data Type: Bugs
Assigned to: Franck Villaume (nerville)
State: Closed
Priority: 3
Extra Fields
Resolution:
Fixed
Severity:
major
Target Release:
6.0
Follow-up tabs
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 (refid=groupid) and the new one (refid=trackerid) 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:30
Franck Villaume
0001-fix-765-20140819-frs-migrate-rbac.sql-violates-const.patch

No related commits.

Field Old Value Date By
ResolutionAwaiting Response2015-04-13 13:44
Franck Villaume
status_idOpen2015-04-13 13:44
Franck Villaume
close_dateNone2015-04-13 13:44
Franck Villaume
ResolutionNone2015-04-12 17:30
Franck Villaume
File Added500: 0001-fix-765-20140819-frs-migrate-rbac.sql-violates-const.patch2015-04-12 17:30
Franck Villaume
assigned_tonone2015-04-03 10:04
Sylvain Beucler
SeverityNone2015-04-03 10:04
Sylvain Beucler

No relations found.