0

I'm unable to use PAM plugin on SonarQube 5.1 on Debian 8 (64bit).

I did setup according to https://github.com/SonarCommunity/sonar-pam and still getting following error during login:

Java::JavaLang::UnsatisfiedLinkError (no jpam in java.library.path):
  java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
  java.lang.Runtime.loadLibrary0(Runtime.java:849)
  java.lang.System.loadLibrary(System.java:1088)
  net.sf.jpam.Pam.<clinit>(Pam.java:51)
  org.sonar.plugins.pam.PamConfiguration.newInstance(PamConfiguration.java:61)
  org.sonar.plugins.pam.PamConfiguration.getPAM(PamConfiguration.java:49)
  org.sonar.plugins.pam.PamAuthenticator.authenticate(PamAuthenticator.java:45)
  org.sonar.api.security.SecurityRealm$1.doAuthenticate(SecurityRealm.java:60)

Here's setup (sonar is located at /var/lib/sonarqube-5.1):

  • /var/lib/sonarqube-5.1/lib/JPam-1.1.jar
  • native libs (64bit and 32bit) have been put to /var/lib/sonarqube-5.1/bin/linux-x86-64/lib/libjpam.so and /var/lib/sonarqube-5.1/bin/linux-x86-32/lib/libjpam.so (just for sure in case sonar was run as 32bit)

All directories leading to native libraries and libraries themselves have +rx access

Any idea what can be causing problem?

JoshDM
  • 4,939
  • 7
  • 43
  • 72
Daimon
  • 3,703
  • 2
  • 28
  • 30

1 Answers1

1

I'd print the java.library.path variable. The only thing I can think of is that the jpam lib is in the wrong place or there is an issue with permissions. (Did you check the SonarQube user can actually read that file?)

UPDATE

  1. Check java.library.path in Settings->System Info page
  2. Move jpam lib to one of those paths
Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137
Marco Tizzoni
  • 532
  • 4
  • 13
  • I just followd instructions at http://docs.sonarqube.org/display/SONAR/Running+SonarQube+as+a+Service+on+Linux and https://github.com/SonarCommunity/sonar-pam . Any idea how to print java.library.path? I would need to print it from within sonar process somehow – Daimon May 22 '15 at 10:25
  • Regarding library accesibility - it's readable and executable by any user – Daimon May 22 '15 at 12:08
  • 1
    The settings->system info page shows all variables. I checked and looks like they took out the relevant setting. Please have a look at your variable value and copy the library in one of those path. If it works I will update the readme. Thank you for getting in touch – Marco Tizzoni May 22 '15 at 15:13
  • Forgot to mention you could setup it as explained here: http://jpam.sourceforge.net/documentation/getting_started.html – Marco Tizzoni May 22 '15 at 19:05
  • Moving library into java.library.path as checked in settings->system info page solved the problem. Thx for help, I'll accept main answer but it requires update – Daimon May 25 '15 at 05:49