Lai
Lai

Reputation: 1350

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

Repository URL: [email protected]:/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 [email protected]:/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?

Upvotes: 1

Views: 1197

Answers (2)

Oliver Gondža
Oliver Gondža

Reputation: 3511

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.

Upvotes: 0

VonC
VonC

Reputation: 1323183

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 $LIBPATH.

Type 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 /opt/freeware/lib/libiconv.a(libiconv.so.2).
But the Git error is from /usr/lib/libiconv.a(libiconv.so.2).

There is a libiconv.la in /opt/freeware/lib but not in /usr/lib.
I copied it to /usr/lib then it works.

Upvotes: 1

Related Questions