Strange Git Polling Behaviour

16 views
Skip to first unread message

Simon Young

unread,
Jan 24, 2019, 7:42:04 AM1/24/19
to Jenkins Users
Hi,

We are seeing some very odd behaviour when configuring Pipeline jobs to poll for changes in a BitBucket git repository. For example, we have a couple of jobs which poll the branch specifier "remotes/origin/master" every minute. These jobs simply don't run at all and have to be manually triggered.

And we have another job which polls the "remotes/origin/kubernetes" branch, which also doesn't run when that branch is changed. However, in the course of the build, that pipeline job checks out a second repo like this:

git url: 'g...@bitbucket.org:organisation/repo2.git', branch: 'master', credentialsId: 'jenkins_bitbucket'

Now, any changes to that 2nd repo trigger the job in Jenkins - even though it's not mentioned in the job config at all.

AND... sometimes, when builds fail (e.g. due to a syntax error in the Jenkinsfile), the build tries to run every minute until someone fixes the problem.

So in summary, jobs are *not* running when we want them to, and *are* running when we don't want them to.

Can anyone offer some pointers as to how to troubleshoot this? The Git Polling Log for the job doesn't help much, but it does confirm that changes to repo2 are triggering the build:

Started on Jan 24, 2019 10:11:00 AM
Using strategy: Default
[poll] Last Built Revision: Revision f77b3b19c4430faa5dc5fae597321d78f6f21209 (refs/remotes/origin/kubernetes)
 
> git --version # timeout=10
using GIT_SSH to set credentials Allows Jenkins to fetch code from BitBucket repositories
 
> git ls-remote -h git@bitbucket.org:organisation/repo1.git # timeout=10
Found 10 remote heads on git@bitbucket.org:organisation/repo1.git
Using strategy: Default
[poll] Last Built Revision: Revision f77b3b19c4430faa5dc5fae597321d78f6f21209 (refs/remotes/origin/kubernetes)
 
> git --version # timeout=10
using GIT_SSH to set credentials Allows Jenkins to fetch code from BitBucket repositories
 
> git ls-remote -h git@bitbucket.org:organisation/repo1.git # timeout=10
Found 10 remote heads on git@bitbucket.org:organisation/repo1.git
Using strategy: Default
[poll] Last Built Revision: Revision b5e3423b8575c7ecd90dae310437389b87a4a17f (refs/remotes/origin/master)
 
> git --version # timeout=10
using GIT_SSH to set credentials Allows Jenkins to fetch code from BitBucket repositories
 
> git ls-remote -h git@bitbucket.org:organisation/repo2.git # timeout=10
Found 5 remote heads on git@bitbucket.org:organisation/repo2.git
[poll] Latest remote head revision on refs/heads/master is: 6b413eaa1e715a4f1e3b5826b9b621d60f923792
Done. Took 9.8 sec
Changes found

Any suggestions appreciated!

Simon.
Reply all
Reply to author
Forward
0 new messages