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

Generate Sauce Support Zip fails in Pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When I click on the "Generate Sauce Support Zip" link from a pipeline job I get an "
      Access Denied: admin is missing the Job/Configure permission" error.

      From Freestyle job it works.

        Attachments

          Activity

          Hide
          halkeye Gavin Mogan added a comment -

          Liam Newman

          Right now the code is checking to see if someone has permission access
          https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java#L171-L173

                  AccessControlled ac = job;
                  Permission p = Project.CONFIGURE;
                  ac.checkPermission(p);
          

          Do you think its a bug with pipeline + permissions? Or are you saying we should have more lax permissions?

          Show
          halkeye Gavin Mogan added a comment - Liam Newman Right now the code is checking to see if someone has permission access https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java#L171-L173 AccessControlled ac = job; Permission p = Project.CONFIGURE; ac.checkPermission(p); Do you think its a bug with pipeline + permissions? Or are you saying we should have more lax permissions?
          Hide
          bitwiseman Liam Newman added a comment -

          Gavin Mogan
          It behaves differently and, from a user perspective, worse in a pipeline job vs a freestyle job.
          All I'm saying it should behave the same in both cases for the same user. I'm logged in as the same admin on the Jenkins website in both cases.

          Show
          bitwiseman Liam Newman added a comment - Gavin Mogan It behaves differently and, from a user perspective, worse in a pipeline job vs a freestyle job. All I'm saying it should behave the same in both cases for the same user. I'm logged in as the same admin on the Jenkins website in both cases.
          Hide
          halkeye Gavin Mogan added a comment -

          K k,

          I'll double check it. I have tests for freestyle jobs, but not pipeline jobs yet, so I'll make sure I add one.

          Thanks

          Show
          halkeye Gavin Mogan added a comment - K k, I'll double check it. I have tests for freestyle jobs, but not pipeline jobs yet, so I'll make sure I add one. Thanks
          Hide
          halkeye Gavin Mogan added a comment -

          I can't reproduce it.

          Do you know what ACL you are using? Can you run

          println(Jenkins.getInstance().getAuthorizationStrategy())
          println(User.current())
          

          In the groovy console? Ideally I'd like to know what permissions you have, especially per project

          Show
          halkeye Gavin Mogan added a comment - I can't reproduce it. Do you know what ACL you are using? Can you run println(Jenkins.getInstance().getAuthorizationStrategy()) println(User.current()) In the groovy console? Ideally I'd like to know what permissions you have, especially per project
          Hide
          halkeye Gavin Mogan added a comment -

          Liam Newman

          Any additional information you can provide? Otherwise I'm going to close the bug for now. I have tried a number of ways to reproduce it and got nowhere.

          Show
          halkeye Gavin Mogan added a comment - Liam Newman Any additional information you can provide? Otherwise I'm going to close the bug for now. I have tried a number of ways to reproduce it and got nowhere.
          Hide
          bitwiseman Liam Newman added a comment -

          Gavin Mogan
          Could you wait on that a couple days? I'm under a deadline for the next couple days. But I will get to this next week.

          Show
          bitwiseman Liam Newman added a comment - Gavin Mogan Could you wait on that a couple days? I'm under a deadline for the next couple days. But I will get to this next week.
          Hide
          halkeye Gavin Mogan added a comment -

          yea absolutely, I just try to triage the bug list regularly

          Show
          halkeye Gavin Mogan added a comment - yea absolutely, I just try to triage the bug list regularly
          Hide
          halkeye Gavin Mogan added a comment -

          Hey Liam Newman, i'm going to close this now. I havn't heard anything in a couple months. Please reopen if its still an issue.

          Show
          halkeye Gavin Mogan added a comment - Hey Liam Newman , i'm going to close this now. I havn't heard anything in a couple months. Please reopen if its still an issue.
          Hide
          bitwiseman Liam Newman added a comment -

          Gavin Mogan
          Sorry to be so slow - I can still reproduce this. I'm running my Jenkins master in a docker container running 2.30 and sauce plugin 1.158.

          With the commands you provided, I get this output:
          {{
          hudson.security.FullControlOnceLoggedInAuthorizationStrategy@74f816ad
          Liam Newman
          }}

          What else should I try?

          Show
          bitwiseman Liam Newman added a comment - Gavin Mogan Sorry to be so slow - I can still reproduce this. I'm running my Jenkins master in a docker container running 2.30 and sauce plugin 1.158. With the commands you provided, I get this output: {{ hudson.security.FullControlOnceLoggedInAuthorizationStrategy@74f816ad Liam Newman }} What else should I try?
          Hide
          halkeye Gavin Mogan added a comment -

          hrm okay, i'll make sure i set it to that strategy and do some tests.

          Show
          halkeye Gavin Mogan added a comment - hrm okay, i'll make sure i set it to that strategy and do some tests.
          Hide
          halkeye Gavin Mogan added a comment -

          Brand new jenkins docker install (2.19.3)
          Latest release of sauce connect

          Simple Pipeline script

          One successful build

          It download the zip just fine.

          Show
          halkeye Gavin Mogan added a comment - Brand new jenkins docker install (2.19.3) Latest release of sauce connect Simple Pipeline script One successful build It download the zip just fine.
          Hide
          halkeye Gavin Mogan added a comment -

          https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java#L171-L173

                  AccessControlled ac = job;
                  Permission p = Project.CONFIGURE;
                  ac.checkPermission(p);
          

          If I understand that properly, its checking to see if you have Project Configure permission on the job

          Show
          halkeye Gavin Mogan added a comment - https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandProjectAction.java#L171-L173 AccessControlled ac = job; Permission p = Project.CONFIGURE; ac.checkPermission(p); If I understand that properly, its checking to see if you have Project Configure permission on the job
          Hide
          halkeye Gavin Mogan added a comment -

          The link is actually using the same code to check, so it shouldn't even provide you the option to download the zip unless you are an admin.

          I'm at a complete loss as to the cause.

          Show
          halkeye Gavin Mogan added a comment - The link is actually using the same code to check, so it shouldn't even provide you the option to download the zip unless you are an admin. I'm at a complete loss as to the cause.
          Hide
          bitwiseman Liam Newman added a comment -

          Gavin Mogan - Well, maybe it is just something about my setup.
          I'm happy to screenshare and pair debug this (next week) or just let it go.
          Up to you.

          Show
          bitwiseman Liam Newman added a comment - Gavin Mogan - Well, maybe it is just something about my setup. I'm happy to screenshare and pair debug this (next week) or just let it go. Up to you.

            People

            Assignee:
            halkeye Gavin Mogan
            Reporter:
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: