Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61508

Project role only after 1 hour can be effective

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: role-strategy-plugin
    • Labels:
      None
    • Environment:
      jenkins:2.204.5 with role-strategy:2.16
    • Similar Issues:
    • Released As:
      Role Strategy 3.1

      Description

      After addRole for a project role and assignRole to an LDAP user is takes 1 hour until the role can be used.

      This can be an issue according to the cache implementation, and due to this issue we have to wait 1 hour for the Project Role to be effective.

      We are using Jenkins: 2.204.5 with role-strategy:2.16 plugin.

      *Update:

      Even when the role is already there (e.g. for days) if you assign it to one user it will be visible on the management page in Jenkins - but the user still cannot use the role.
      For the user it seems like he doesn't have the role, and after one hour it is working.
      So therefore the cache might not be flushed correctly every time when the real change occurs.

      Our guess is, that the cache flush done in https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleMap.java#L245 also needs to be done after an assignRole() and maybe in other methods also!

       

        Attachments

          Issue Links

            Activity

            Hide
            devopsasaservice Attila Ónodi-Szűcs added a comment -

            The ticket has been updated, more details have been provided about the issue (and for a possible solution also).

            Please check the update section of this ticket.

            Show
            devopsasaservice Attila Ónodi-Szűcs added a comment - The ticket has been updated, more details have been provided about the issue (and for a possible solution also). Please check the update section of this ticket.
            Hide
            bytemaster Boris Folgmann added a comment -

            We have the same problem and it's still present in the up-to-date Jenkins 2.249.1 with role-strategy:3.0

            At least one explicit cache flush is missing therefore the role will get visible only after waiting 1h or restarting Jenkins. A relogin with the affected user doesn't help.

            Who would be the right assignee for bugs in role-strategy?

            Show
            bytemaster Boris Folgmann added a comment - We have the same problem and it's still present in the up-to-date Jenkins 2.249.1 with role-strategy:3.0 At least one explicit cache flush is missing therefore the role will get visible only after waiting 1h or restarting Jenkins. A relogin with the affected user doesn't help. Who would be the right assignee for bugs in role-strategy?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been proposed by Hui Jun Ng and then released in 3.1: https://github.com/jenkinsci/role-strategy-plugin/releases/tag/role-strategy-3.1 . Thanks a lot to Hui Jun Ng for the contribution!

            My apologies to everyone who was affected and who waiting for the fix for so long. To indicate the maintenance status, I put the plugin for adoption. I will be happy to assist new maintainers and to help with onboarding. Any contributions to the plugin are welcome!

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been proposed by Hui Jun Ng  and then released in 3.1: https://github.com/jenkinsci/role-strategy-plugin/releases/tag/role-strategy-3.1  . Thanks a lot to Hui Jun Ng for the contribution! My apologies to everyone who was affected and who waiting for the fix for so long. To indicate the maintenance status, I put the plugin for adoption. I will be happy to assist new maintainers and to help with onboarding. Any contributions to the plugin are welcome!

              People

              Assignee:
              blanked Hui Jun Ng
              Reporter:
              devopsasaservice Attila Ónodi-Szűcs
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: