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

Spurious "You have no permission to build" errors with inconsistent effects.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.28, Ubuntu 14.04

      Jenkins 2.28. System info attached.

      I have projects Upstream and Downstream. I want Upstream to trigger
      Downstream when Upstream is stable.

      Preferably, I would trigger Downstream as a post-build action of
      Upstream. It is also viable for me to trigger Downstream as the
      final build-step of Upstream.

      Both Upstream and Downstream have configured Build Authorization
      Strategy = `Run as User who Triggered Build`.

      Nevertheless, whether Downstream is triggered as a post-build action of
      Upstream, or as the final build-step of Upstream, the Upstream
      configuration page displays the error message:-

      You have no permission to build Downstream

      When Downstream is triggered as a post-build action of Upstream,
      this error message is true. The Upstream build log concludes:

      Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped
      You have no permission to build Downstream
      Finished: SUCCESS

      When Downstream is triggered as the final build-step of Upstream,
      the error message is false. The Upstream build log concludes:

      Waiting for the completion of Downstream
      Downstream #NN completed. Result was SUCCESS
      Build step 'Conditional step (single)' changed build result to SUCCESS
      No GitLab connection configured
      No GitLab connection configured
      Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped
      Finished: SUCCESS

      Apparent bugs are:-

      • The error message is spurious, as Upstream should have permission
        to trigger Downstream per the configured Build Authorization Strategy.
      • If the error message were not spurious, then Upstream should be unable
        to trigger Downstream either as a build-step or as a post-build action.

          [JENKINS-39444] Spurious "You have no permission to build" errors with inconsistent effects.

          Oleg Nenashev added a comment -

          Please provide samples of your Global security settings and Authorize Project property in jobs. "this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped" likely means the authorization is not set at all

          Oleg Nenashev added a comment - Please provide samples of your Global security settings and Authorize Project property in jobs. "this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped" likely means the authorization is not set at all

          Mike Kinghan added a comment -

          Attached my security settings and example upstream and downstream configs.

          Mike Kinghan added a comment - Attached my security settings and example upstream and downstream configs.

          I'm experiencing the same issue. We are also using Jenkins 2.28. Jobs that previously simply kicked off the downstream project, no longer do this and instead give the error:

          Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped

          Scott Justason added a comment - I'm experiencing the same issue. We are also using Jenkins 2.28. Jobs that previously simply kicked off the downstream project, no longer do this and instead give the error: Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped

          Mike Kinghan added a comment - - edited

          As with @ScottJustason, this is a regression in my case. It started happening with my first upgrade to Jenkins >= 2.0. The problem was innocuous at first because the jobs that I "had no permission to build" where triggered as build-steps of parent jobs, and in fact they ran as they had always done. The problem bites now that I want to trigger a downstream job as a post-build action, and in this case "you have no permission to build" turns out true.

          Mike Kinghan added a comment - - edited As with @ScottJustason, this is a regression in my case. It started happening with my first upgrade to Jenkins >= 2.0. The problem was innocuous at first because the jobs that I "had no permission to build" where triggered as build-steps of parent jobs, and in fact they ran as they had always done. The problem bites now that I want to trigger a downstream job as a post-build action, and in this case "you have no permission to build" turns out true.

          Yes, I forgot to mention this problem only manifested after we upgraded to 2.28 from an earlier version (I don't remember which but it's been at least 6 months since we've upgraded

          Scott Justason added a comment - Yes, I forgot to mention this problem only manifested after we upgraded to 2.28 from an earlier version (I don't remember which but it's been at least 6 months since we've upgraded

          Oleg Nenashev added a comment -

          I will assign it to Authorize Project plugin maintainer. Maybe he has more insights regarding the potential regressions during the upgrade

          Oleg Nenashev added a comment - I will assign it to Authorize Project plugin maintainer. Maybe he has more insights regarding the potential regressions during the upgrade

          ikedam added a comment -

          "You" in the error message in the configuration page means the user configuring that project.
          "You" in the build log is the user building that build.
          They are different and the mismatched error messages doesn't mean inconsistency.

          Rather, there sounds inconsistency of behaviors of build action and post-build action.

          Anyway, this sounds an issue of parameterized-trigger plugin, and I change the component/s.

          ikedam added a comment - "You" in the error message in the configuration page means the user configuring that project. "You" in the build log is the user building that build. They are different and the mismatched error messages doesn't mean inconsistency. Rather, there sounds inconsistency of behaviors of build action and post-build action. Anyway, this sounds an issue of parameterized-trigger plugin, and I change the component/s.

          ikedam added a comment - - edited

          imkinghan
          Would you attach a screenshot of the upstream project when you configure a post-build action to trigger the downstream project?

          ikedam added a comment - - edited imkinghan Would you attach a screenshot of the upstream project when you configure a post-build action to trigger the downstream project?

          ikedam added a comment -

          Note: you should use "Run as Specific User" when you use build triggers,
          as builds triggered via build triggers are considered run as anonymous when using "Run as User who Triggered Build".

          ikedam added a comment - Note: you should use "Run as Specific User" when you use build triggers, as builds triggered via build triggers are considered run as anonymous when using "Run as User who Triggered Build".

            huybrechts huybrechts
            imkinghan Mike Kinghan
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: