Upgrade to git plugin 3.1.0 broken the build job. Please advise if you experienced

85 views
Skip to first unread message

Simba K

unread,
Apr 2, 2017, 12:42:56 PM4/2/17
to Jenkins Users
I have upgraded jenkins from 1.6 to 2.32.  and git plugin to 3.1 and git client plugin to 2.4.1. It broken existing build job. Has anyone experienced?


> git.exe fetch --tags https://myproject.git +refs/heads/*:refs/remotes/origin/*
 > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "origin/master^{commit}" # timeout=10
 
  ERROR : Couldn't find any revision to build. Verify the repository and branch configuration for this job.

Jenkins running as a service on windows 7.

Mark Waite

unread,
Apr 2, 2017, 4:35:25 PM4/2/17
to Jenkins Users
That message usually means that the repository in the workspace does not contain a reference named "master" or named "origin/master".  That is a surprise, since most repositories include a master branch.  

You could try "Wipe Workspace" from the job's "Workspace" link, then run the job again.  If that works, then that hints there was something unexpectedly wrong with the repository in the job workspace.

If that does not work, then you may want to look at the job definition to see if there is a reference to a branch or tag which does not exist in the repository.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3680dc38-18f1-4034-b482-aa22c23f7c80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fritz Elfert

unread,
Apr 2, 2017, 5:24:01 PM4/2/17
to jenkins...@googlegroups.com
On 02.04.2017 22:35, Mark Waite wrote:
> That message usually means that the repository in the workspace does not
> contain a reference named "master" or named "origin/master". That is a
> surprise, since most repositories include a master branch.

If the git plugin has this requirement, then this assumption is a bug.
There is no obligation at all to have a branch called "master". In fact,
at my employer, the default branch is called "devel" instead.

Cheers
-Fritz

signature.asc

Mark Waite

unread,
Apr 2, 2017, 6:08:44 PM4/2/17
to jenkins...@googlegroups.com
The git plugin does not have any requirement that there be a branch named master.

It would have been clearer if I had said that Simba's job definition is referring to a branch named master, or a reference named origin/master, but for some reason that reference is not available in that repository.

The reference could be unavailable in the repository because the working repository was damaged.  It could be unavailable because the refspec used to clone the repository did not include the master branch (though the refspec which is logged in the "fetch" statement indicates that is not the case).  It could be unavailable because the job definition used the advanced setting to rename "origin" to something else.  There are likely several more possibilities for why the reference "origin/master^{commit}" cannot be resolved.

The absence of a branch named master is not a problem for the Jenkins git plugin as far as I know.

Thanks,
Mark Waite
 
Cheers
 -Fritz


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Fritz Elfert

unread,
Apr 3, 2017, 3:08:22 AM4/3/17
to jenkins...@googlegroups.com
Replies inline

On 03.04.2017 00:08, Mark Waite wrote:
>
>
> On Sun, Apr 2, 2017 at 3:23 PM Fritz Elfert <fr...@fritz-elfert.de
> <mailto:fr...@fritz-elfert.de>> wrote:
>
> On 02.04.2017 22:35, Mark Waite wrote:
> > That message usually means that the repository in the workspace
> does not
> > contain a reference named "master" or named "origin/master". That
> is a
> > surprise, since most repositories include a master branch.
>
> If the git plugin has this requirement, then this assumption is a bug.
> There is no obligation at all to have a branch called "master". In fact,
> at my employer, the default branch is called "devel" instead.
>
>
> The git plugin does not have any requirement that there be a branch
> named master.
[...]

Thanks for making that clear.

Cheers
-Fritz

signature.asc

Simba K

unread,
Apr 8, 2017, 10:12:09 AM4/8/17
to Jenkins Users
Thank you All for sharing thoughts. ..Branch actually exists.. But when i use option to poll the repo hourly, I see below error msg in logs.


using GIT_ASKPASS to set credentials XXXX
 > git.exe ls-remote -h https://git.URLXXXX.git # timeout=10
Unexpected ls-remote output line ''
[poll] Couldn't get remote head revision
Done. Took 0.15 sec

Mark Waite

unread,
Apr 8, 2017, 10:37:49 AM4/8/17
to Jenkins Users
That message usually means that the authentication failed for the "git ls-remote" call.

If the repository requires credentials, then you'll need to define the credential in the Jenkins credentials, and use that credential in the job definition.

Note that https git URL's need a username / password credential, not a private key credential.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Simba K

unread,
Apr 8, 2017, 10:44:47 AM4/8/17
to jenkins...@googlegroups.com
Yes using Jenkins credentials.. Same working in Jenkins 1.6 running on Tomcat server running on windows. But failing Jenkins 2.0 running as a windows service.

Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/WFWUJAO1oNc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFW5GDvvXPi6HnFQPnQ6HpvR%2BFr%3DorT8ieWKhOkE7-jTg%40mail.gmail.com.

Mark Waite

unread,
Apr 8, 2017, 10:55:16 AM4/8/17
to jenkins...@googlegroups.com
Running the Jenkins agent (master or slave) as a Windows service will show you JENKINS-20356 (git ssh doesn't work from a Windows service) and may show you JENKINS-34082 (git username / password fails from service if git installation included credentials manager).  Since newer git installations default to include the credentials manager, you are likely seeing the second case.

Mark Waite

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/WFWUJAO1oNc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAN%2BocjVAv-hKue1-a2GrFFcpdJkYbG9Dh0eFXjLG4m1mq41gLQ%40mail.gmail.com.

Simba K

unread,
Apr 9, 2017, 10:45:07 AM4/9/17
to Jenkins Users
Thank you for sharing info. I have uninstalled GIT and reinstalled without windows credential manager and also i also disabled credential manager service on windows . Still It is failing with same error.

Thanks.

Mark Waite

unread,
Apr 9, 2017, 10:49:27 AM4/9/17
to Jenkins Users
If you were previously running the agent with a desktop session, the safest bet is to run the new agent from a desktop session.  Recent versions of Windows no longer allow services to interact with the desktop.  There are many test scenarios which need desktop interactions, and running as a service may prevent those scenarios from working for you.

Mark Waite

Reply all
Reply to author
Forward
0 new messages