-
Bug
-
Resolution: Fixed
-
Major
-
Jenkins 2.382, Bitbucket Server Integration 3.3.2, Bitbucket Data Center 7.21.7
-
-
3.4.1
After configuring Jenkins and Bitbucket to trigger building a Multibranch Pipeline Job in Jenkins after a pull request is created in Bitbucket, initially, everything works OK.
However, after a couple of days, creating a PR in Bitbucket suddenly stopped triggering builds. This is what the Multibranch Pipeline Events log shows after a successful trigger:
Successful trigger
[Wed Dec 14 09:14:52 CET 2022] Received com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadPullRequestEvent CREATED event from example-trigger with timestamp Wed Dec 14 09:14:52 CET 2022 > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/caches/git-dfb7ecede3df9ca94f084a3891c26a05/.git # timeout=10 Setting origin to https://example.com/example-trigger.git > /usr/bin/git config remote.origin.url https://example.com/example-trigger.git # timeout=10 Fetching & pruning origin... Listing remote references... > /usr/bin/git config --get remote.origin.url # timeout=10 > /usr/bin/git --version # timeout=10 > git --version # 'git version 1.8.3.1' using GIT_ASKPASS to set credentials Example credentials > /usr/bin/git ls-remote -h https://example.com/example-trigger.git # timeout=10 Fetching upstream changes from origin > /usr/bin/git config --get remote.origin.url # timeout=10 using GIT_ASKPASS to set credentials Example credentials > /usr/bin/git fetch --tags --progress --prune origin +refs/heads/*:refs/remotes/origin/* # timeout=10 Checking branches... Checking branch example-branch/main.py-1671005685967 'jenkins/Jenkinsfile' found Met criteria Scheduled build for branch: example-branch/main.py-1671005685967 Processed 4 branches (query complete) [Wed Dec 14 09:14:56 CET 2022] com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadPullRequestEvent CREATED event from example-trigger with timestamp Wed Dec 14 09:14:52 CET 2022 processed in 3.3 sec
And here's what a failed trigger looks like:
Failed trigger
[Wed Dec 14 09:13:27 CET 2022] Received com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadPullRequestEvent CREATED event from example-trigger with timestamp Wed Dec 14 09:13:27 CET 2022 > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/caches/git-dfb7ecece3dc9ca94f084a3891c26a05/.git # timeout=10 Setting origin to https://example.com/example-trigger.git > /usr/bin/git config remote.origin.url https://example.com/example-trigger.git # timeout=10 Fetching & pruning origin... Listing remote references... > /usr/bin/git config --get remote.origin.url # timeout=10 > /usr/bin/git --version # timeout=10 > git --version # 'git version 1.8.3.1' > /usr/bin/git ls-remote -h https://example.com/example-trigger.git # timeout=10 [Wed Dec 14 09:13:27 CET 2022] com.atlassian.bitbucket.jenkins.internal.trigger.BitbucketWebhookConsumer$BitbucketSCMHeadPullRequestEvent CREATED event from example-trigger with timestamp Wed Dec 14 09:13:27 CET 2022 processed in 0.26 sec
It appears it skips setting credentials for failed triggers. As a workaround, if you configure the Multibranch Pipeline Job and click "Apply" without changing any settings, everything works as intended again.
This issue seems to be occurring after upgrading Jenkins and restarting. Could it be caused by the use of transients?