Cannot connect to GIT from jenkins
I have run Jenkins on AIX with:
java -jar jenkins.war --httpPort=8082
In the Jenkins job configure > Source Code Management > Git, I enter
- How do I make Jenkins see a Git merge commit as a change?
- How to trigger build on upstream project on event in downstream project Jenkins
- Jenkins and Bitbucket integration
- Jenkins: How to access parameters in a parameterized job
- How can i add an administrative build in jenkins?
- Jenkins JUnit Test Result Report plugin states that the JUnit xml file is not found?
Repository URL: user@XXX.XXX.XXX.XXX:/opt/git/project.git
where XXX is the ip of the server.
I got the following error message:
Failed to connect to repository : Command "/usr/bin/git ls-remote -h user@XXX.XXX.XXX.XXX:/opt/git/project.git HEAD" returned status code 255: stdout: stderr: exec(): 0509-036 Cannot load program /usr/bin/git because of the following errors: 0509-150 Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded. 0509-152 Member libiconv.so.2 is not found in archive
I have tested on both AIX and WinXP. It works fine on the windows machine. But I need the Jenkins to be on the AIX server. Have googled the error but in vain. How can I solve this error?
2 Solutions collect form web for “Cannot connect to GIT from jenkins”
Make sure you have libiconv installed (either in /usr/… or in /opt), as in this thread or this one.
find /opt -name "libiconv*" -print find /usr -name "libiconv*" -print
Try and unset
ldd /usr/bin/git to check where git looks for its dependencies.
The OP Lai confirms having used one of the solutions:
When I use
ldd /usr/bin/git, it gives
But the Git error is from
There is a
/opt/freeware/libbut not in
I copied it to /usr/lib then it works.
I run into this even though I have no
LIBPATH configured in shell, but processes forked from java had. Consequently, git did not worked when invoked from java but worked just fine otherwise.
IBM JDK uses
LIBPATH to manage own shared libraries but as any environment variable it is inherited by subprocesses where it can cause problems that are not present when
LIBPATH is not set at all.
As IBM JDK prepends existing
LIBPATH and not replacing it, it should be enough to set
LIBPATH for the java process with all the paths necessary for the forked processes so it will be inherited.