Jenkins downstream jobs not triggered after enabling security

27 views
Skip to first unread message

Jason LeMauk

unread,
Jul 12, 2017, 3:23:26 PM7/12/17
to jenkins...@googlegroups.com

I currently have two jenkins freestyle jobs setup. One is titled AutomatedBackup, and the other AutomatedBackupCleanup. Upon successful completion of the AutomatedBackup job, the AutomatedBackupCleanup job is triggered.

 

I have recently enabled security on my Jenkins instance, which appears to have broken the trigger between the two jobs. The console output from the AutomatedBackup job looks like so:

 

Started by user Chuck Norris

Running as Chuck Norris

Building on master in workspace /var/lib/jenkins/jobs/AutomatedBackup/workspace

[workspace] $ /bin/sh -xe /tmp/hudson2315047344125249883.sh

+ cp -a /var/lib/jenkins /opt/jenkinsbackups

+ cd /opt/jenkinsbackups

+ date +%Y%m%d-%H%M%S

+ tar czf jenkinsBackup_20170712-151641.tar.gz jenkins/

 

+ rm -rf /opt/jenkinsbackups/jenkins/

+ git add --all

 

+ git commit -m Jenkins Automated Backup

[master 85151d9] Jenkins Automated Backup

1 file changed, 0 insertions(+), 0 deletions(-)

create mode 100644 jenkinsBackup_20170712-151641.tar.gz

+ git push

 

To ssh://g...@191.55.63.157:7999/at/jenkinsbackup.git

   5fe7767..85151d9  master -> master

Running as anonymous cannot even see AutomatedBackup for trigger from AutomatedBackupCleanup

Finished: SUCCESS

 

Each job can be run with success, however the first job is no longer triggering the second job.

Any ideas?

J0991

unread,
Jul 13, 2017, 9:43:58 AM7/13/17
to jenkins...@googlegroups.com
Just to serve as a reference for the rest of the Jenkins community that may
stumble upon the issue outlined above, I have found a solution to the issue.

Per the Cloudbees documentation How to configure Access Control for Builds
<https://support.cloudbees.com/hc/en-us/articles/209641937-How-to-configure-Access-Control-for-Builds>
, the issue appears to be with the build authorization (made available via
the Authorize Project Plugin
<https://wiki.jenkins.io/display/JENKINS/Authorize+Project+plugin> ).

The documentation states:
============================================================
The special case of the Reverse Triggering
The reverse triggering is when the downstream job is configured to be
triggered after the upstream job.

When the build authorisations are configured triggers are executed by
default as anonymous.

If the upstream job visibility is limited, the downstream job won’t see the
upstream and thus it won’t be triggered. To make such triggering working,
you will have to configure the downstream job to run as a user having the
permission to see the upstream job.
============================================================

In order to get the triggered job to trigger, I had to set the project
Authorization to run as a specific user (my user Chuck Norris). After
setting this value for the project Authorization, my downstream job was then
triggered.

Hopes this helps someone out there!



--
View this message in context: http://jenkins-ci.361315.n4.nabble.com/Jenkins-downstream-jobs-not-triggered-after-enabling-security-tp4900460p4900500.html
Sent from the Jenkins users mailing list archive at Nabble.com.
Reply all
Reply to author
Forward
0 new messages