[JIRA] [git-plugin] (JENKINS-34603) git scm poll not working with global environment variable

5 views
Skip to first unread message

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 12:54:02 PM5/4/16
to jenkinsc...@googlegroups.com
smruti sahoo created an issue
 
Jenkins / Bug JENKINS-34603
git scm poll not working with global environment variable
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2016/May/04 4:53 PM
Priority: Critical Critical
Reporter: smruti sahoo

Steps to reproduce -

Manage Jenkins => Configure System => Global properties => Environment variables
Add
Name = GITHUB_HOST
Value = <github IP address>

Name = GITHUB_REPO
Value = <github repo path>

Create a job
Under job configuration define git repository as below
https://$

{GITHUB_HOST}/${GITHUB_REPO}
provide user/pass for credential
complete the job configuration

Trigger SCM poll by using curl (Note - provide your Jenkins host in following command)

curl http://${JENKINS_SERVER}/jenkins/git/notifyCommit?url=https://\$"{GITHUB_HOST}"/\$"{GITHUB_REPO}"

It'll poll the corresponding job but if you see Git SCM poll log, it's dumping the following error
It's not able to expand the global variable

> /usr/bin/git --version # timeout=10
> /usr/bin/git -c core.askpass=true fetch --tags --progress https://${GITHUB_HOST}

/$

{GITHUB_REPO} +refs/heads/:refs/remotes/origin/
FATAL: hudson.plugins.git.GitException: Failed to fetch from https://${GITHUB_HOST}/${GITHUB_REPO}

hudson.util.IOException2: hudson.plugins.git.GitException: Failed to fetch from https://$

{GITHUB_HOST}/${GITHUB_REPO}
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:573)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
at hudson.scm.SCM.poll(SCM.java:398)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1468)
at hudson.model.AbstractProject._poll(AbstractProject.java:1438)
at hudson.model.AbstractProject.poll(AbstractProject.java:1349)
at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: hudson.plugins.git.GitException: Failed to fetch from https://${GITHUB_HOST}

/$

{GITHUB_REPO}
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:701)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571)
... 14 more
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git -c core.askpass=true fetch --tags --progress https://${GITHUB_HOST}/${GITHUB_REPO}

+refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: remote: Invalid username or password.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 12:56:02 PM5/4/16
to jenkinsc...@googlegroups.com
smruti sahoo commented on Bug JENKINS-34603
 
Re: git scm poll not working with global environment variable

If I'm triggering the job manually either individually or build pipeline - It's working as expected
It's failing only when for "Poll SCM"

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 12:57:01 PM5/4/16
to jenkinsc...@googlegroups.com
smruti sahoo edited a comment on Bug JENKINS-34603
If I'm triggering the job manually either individually or build pipeline - It's working as expected
It's failing only when
 for  "Poll SCM"
 

Because of this the notification mails are not getting triggered upon git commit
 

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 12:57:02 PM5/4/16
to jenkinsc...@googlegroups.com
smruti sahoo edited a comment on Bug JENKINS-34603
If I'm triggering the job manually either individually or build pipeline - It's working as expected
It's failing only
 when  for  "Poll SCM" 

Because But because  of this the notification mails are not getting triggered upon git commit  which is causing big issue  

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 12:58:01 PM5/4/16
to jenkinsc...@googlegroups.com
smruti sahoo updated an issue
 
Change By: smruti sahoo
Steps to reproduce -

Manage Jenkins => Configure System => Global properties => Environment variables 
Add 
Name = GITHUB_HOST
Value = <github IP address>

Name = GITHUB_REPO
Value = <github repo path>

Create a job 
Under job configuration define git repository as below
https://${GITHUB_HOST}/${GITHUB_REPO}
provide user/pass for credential 
complete the job configuration 

Trigger SCM poll by using curl (Note - provide your Jenkins host in following command)

curl http://${JENKINS_SERVER}/jenkins/git/notifyCommit?url=https://\$"\{GITHUB_HOST\}"/\$"\{GITHUB_REPO\}"

It'll poll the corresponding job but if you see Git SCM poll log, it's dumping the following error 
{color:red} In short - It's not able to expand the global variable {color}

 > /usr/bin/git --version # timeout=10
 > /usr/bin/git -c core.askpass=true fetch --tags --progress https://${GITHUB_HOST}/${GITHUB_REPO} +refs/heads/*:refs/remotes/origin/*

FATAL: hudson.plugins.git.GitException: Failed to fetch from https://${GITHUB_HOST}/${GITHUB_REPO}
hudson.util.IOException2: hudson.plugins.git.GitException: Failed to fetch from https://${GITHUB_HOST}/${GITHUB_REPO}
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:573)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
at hudson.scm.SCM.poll(SCM.java:398)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1468)
at hudson.model.AbstractProject._poll(AbstractProject.java:1438)
at hudson.model.AbstractProject.poll(AbstractProject.java:1349)
at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: hudson.plugins.git.GitException: Failed to fetch from https://${GITHUB_HOST}/${GITHUB_REPO}
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:701)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571)
... 14 more
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git -c core.askpass=true fetch --tags --progress https://${GITHUB_HOST}/${GITHUB_REPO} +refs/heads/*:refs/remotes/origin/*" returned status code 128:

stdout: 
stderr: remote: Invalid username or password.

asksmruti@gmail.com (JIRA)

unread,
May 4, 2016, 1:12:01 PM5/4/16
to jenkinsc...@googlegroups.com

brianbarker3@gmail.com (JIRA)

unread,
May 10, 2016, 5:44:01 AM5/10/16
to jenkinsc...@googlegroups.com

I also would like this addressed. When you have hundreds of engineers browsing build jobs, it is nice to set a var like $BRANCH=develop so they can just change that and not miss the multiple places in our config we use that value.

mark.earl.waite@gmail.com (JIRA)

unread,
May 13, 2016, 8:07:01 AM5/13/16
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

jm_men1@yahoo.com (JIRA)

unread,
Oct 10, 2016, 4:29:01 PM10/10/16
to jenkinsc...@googlegroups.com
Jeffrey Mendez commented on Bug JENKINS-34603
 
Re: git scm poll not working with global environment variable

I am also seeing this issue. Environment variables are not being substituted when polling runs. I am using an environment variable for my Branch Specifier in the SCM configuration.

I have tried this in many versions of the Git Plugin. Version 3.0 is the latest, but version 2.3.4 is the last known working version that I have found.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 19, 2020, 10:06:03 PM1/19/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
Priority: Critical Minor
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

benjamin.c.cross@gmail.com (JIRA)

unread,
Jan 24, 2020, 2:24:03 PM1/24/20
to jenkinsc...@googlegroups.com
Benjamin Cross updated an issue
Change By: Benjamin Cross
Steps to reproduce -

Manage Jenkins => Configure System => Global properties => Environment variables
Add
Name = GITHUB_HOST
Value = <github IP address>

Name = GITHUB_REPO
Value = <github repo path>

Create a job
Under job configuration define git repository as below
[ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO}

provide user/pass for credential
complete the job configuration
Trigger SCM poll by using curl (Note - provide your Jenkins host in following command)

curl [ http://$ |http://%24/] {JENKINS_SERVER}/jenkins/git/notifyCommit?url= [ https://\$ |https://%24/] "\{GITHUB_HOST \ }"/\$"\{GITHUB_REPO \ }"


It'll poll the corresponding job but if you see Git SCM poll log, it's dumping the following error
{color: red #FF0000 }In short - It's not able to expand the global variable {color}

> /usr/bin/git --version # timeout=10
> /usr/bin/git -c core.askpass=true fetch --tags --progress
[ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO} +refs/heads/*:refs/remotes/origin/*
FATAL: hudson.plugins.git.GitException: Failed to fetch from
[ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO}
hudson.util.IOException2: hudson.plugins.git.GitException: Failed to fetch from
[ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO}

at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:573)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
at hudson.scm.SCM.poll(SCM.java:398)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1468)
at hudson.model.AbstractProject._poll(AbstractProject.java:1438)
at hudson.model.AbstractProject.poll(AbstractProject.java:1349)
at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: hudson.plugins.git.GitException: Failed to fetch from [ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO}

at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:701)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571)
... 14 more
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git -c core.askpass=true fetch --tags --progress [ https://$ |https://%24/] {GITHUB_HOST}/${GITHUB_REPO} +refs/heads/*:refs/remotes/origin/*" returned status code 128:

stdout:
stderr: remote: Invalid username or password.
Reply all
Reply to author
Forward
0 new messages