Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-11577

web.rights migration 20230203T0000 fails on unknown profile

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.7.0
    • 4.6.0
    • None
    • None
    • 4.7.0 M1

      If the right datasource contains an assignement linked to an unexisting profile, the migration will fail with the following error instead of ignoring the assignement.

      Error while executing script to upgrade component 'web.rights' to version '20230203T0000'. Error : '', message : 'Cannot invoke "org.ametys.core.right.Profile.getId()" because "profile" is null'
      

          [CMS-11577] web.rights migration 20230203T0000 fails on unknown profile

          This issue won't be fix in 4.6. To solve the error, one need to clean the datasource containing the profile and assignement.
          To do so, list the existing profile :

          SELECT Id FROM Rights_Profile
          

          List all profile registered in an assignement :

          SELECT Profile_Id FROM Rights_AllowedGroups WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedProfilesAnonym WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedProfilesAnyCon WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedUsers WHERE Context LIKE '/cms/%'
          

          Remove all assignement for a profile that is not listed in the result of the first request.

          Guillaume Gouin added a comment - This issue won't be fix in 4.6. To solve the error, one need to clean the datasource containing the profile and assignement. To do so, list the existing profile : SELECT Id FROM Rights_Profile List all profile registered in an assignement : SELECT Profile_Id FROM Rights_AllowedGroups WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedProfilesAnonym WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedProfilesAnyCon WHERE Context LIKE '/cms/%' UNION SELECT Profile_Id FROM Rights_AllowedUsers WHERE Context LIKE '/cms/%' Remove all assignement for a profile that is not listed in the result of the first request.

            ggouin Guillaume Gouin
            ggouin Guillaume Gouin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: