6

I'm having trouble getting Jenkins to recognize my git repo. The screenshot is below. I was told using git clone https://blah/blah.git will clone the repo as read-only w/o needing credentials or keys. I want to just pull the code and build it.

The funny thing is when I execute the same command from the command line, it works and files get pulled down from the repo.

export GIT_SSL_NO_VERIFY=true
git clone https://blah.com:8443/blah.git

When I enter the url and environment variable in Jenkins, it's says it can't connect to the repository. Does anyone know what I might need to do to get it to work? Thanks in advance for your help.

enter image description here

UPDATE/CLARIFICATION: The Jenkins install is under a service account, not related to any user within the company.

UPDATE#2: Here's the console output. I've sanitized it a little so i apologize if i missed something.

Started by user anonymous
Building in workspace /home/hduser/.jenkins/workspace/analytics
Fetching changes from the remote Git repository
Fetching upstream changes from https://blah.com:8443/blah.git
FATAL: Failed to fetch from https://blah.com:8443/blah.gitt
hudson.plugins.git.GitException: Failed to fetch from https://blah.com:8443/blah.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)    
    at hudson.model.Run.execute(Run.java:1665)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.plugins.git.GitException: Failed to connect to https://blah.com:8443/blah.git
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:167)
    at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610)
    ... 10 more
rjohnston
  • 7,153
  • 8
  • 30
  • 37
Classified
  • 5,759
  • 18
  • 68
  • 99
  • can you post the jenkins log please. – Nathan Nov 01 '13 at 20:58
  • By "executing the same command from the command line" I assume you mean something like `curl https://blah.com:8443/proj.git`? – Max Leske Nov 01 '13 at 20:59
  • @Nathan when you say jenkins log, i assume you mean the build log for the job? – Classified Nov 01 '13 at 21:02
  • @MaxLeske i'm assuming jenkins runs something similar to what i'm running on the command line. what I run on the command line is `git clone https://blah.com:8443/proj.git` and i see all this activity flash on my screen and seconds later, I have the files from the git repo in my current directory – Classified Nov 01 '13 at 21:05
  • oh, and please keep in mind that i'm a jenkins and git noob. i've been trying to figure this out for 2 days with little progress – Classified Nov 01 '13 at 21:07
  • @Classified Jenkins has a both a system level and job level logging. Mainly what I'm looking for is more detail as to a) what Jenkins actually ran and B) What if any more error information there might be. – Nathan Nov 01 '13 at 22:09
  • Add console output from your job to the question. – eis Nov 04 '13 at 17:51
  • Nathan and eis, I posted the console output/job log to the posting. thx again for your continued help. – Classified Nov 04 '13 at 20:07

1 Answers1

1

Thanks for everyone's suggestions, comments, and help. I think this is a plugin issue. Someone else experienced the same thing I did (original post here). If I run this command from the command line or if I enter the command in Jenkins as Build>Execute shell>Command, it works fine.

I have Git Client plugin = 1.4.3 and Git Plugin 1.5.0. I'll wait to see if a newer plugin fixes this.

Community
  • 1
  • 1
Classified
  • 5,759
  • 18
  • 68
  • 99
  • 1
    did you try the suggestion mentioned in the [main page of git plugin](https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin) (see "gotchas"), telling to use fully qualified path for git executable? – eis Nov 04 '13 at 17:47
  • also, you could test `-Dorg.jenkinsci.plugins.gitclient.Git.useCLI=false` like proposed in the same page – eis Nov 04 '13 at 17:53
  • thx for your suggestions. yeah, the "gotcha" didn't help. i upgraded the plugin and i'm still getting a failure, although, it's a different message now. i haven't tried ur second comment yet but i'll try in a sec. i might downgrade my plugin again to get the same conditions as before. hopefully it works – Classified Nov 04 '13 at 20:15
  • second one forces the usage of a different plugin, so it should make it work, but would result in reduced functionality. – eis Nov 04 '13 at 20:28
  • @eis, thx but the option useCLI=false didn't help. I ran this via tomcat (./catalina.sh -Dblah.useCLI=false start) so I don't know if that makes a difference but when I do a ps -ef | grep catalina, I do see the option in there so I assume Jenkins saw it. – Classified Nov 05 '13 at 02:46