Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ranger Usersync Not Starting

avatar
Contributor

Hi Team,

Ranger usersync daemon is not starting in our cluster.We are using HDP-2.5.6.

We are getting following error in ranger usersync log file:

19 May 2018 00:01:25 ERROR UserGroupSync [UnixUserSyncThread] - Failed to initialize UserGroup source/sink. Will retry after 60000 milliseconds. Error details:
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/URIException
        at org.apache.ranger.unixusersync.process.PolicyMgrUserGroupBuilder.delXUserGroupInfo(PolicyMgrUserGroupBuilder.java:615)
        at org.apache.ranger.unixusersync.process.PolicyMgrUserGroupBuilder.delXUserGroupInfo(PolicyMgrUserGroupBuilder.java:600)
        at org.apache.ranger.unixusersync.process.PolicyMgrUserGroupBuilder.addOrUpdateUser(PolicyMgrUserGroupBuilder.java:326)
        at org.apache.ranger.unixusersync.process.UnixUserGroupBuilder.updateSink(UnixUserGroupBuilder.java:92)
        at org.apache.ranger.usergroupsync.UserGroupSync.run(UserGroupSync.java:58)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.URIException
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

After debugging we found that its an known issue in Ranger:
https://issues.apache.org/jira/browse/RANGER-989

As per mentioned in "RANGER-989" we have copied given jar files from ranger-admin lib to usersync lib and restarted Ranger service:

cp /usr/hdp/current/ranger-admin/ews/webapp/WEB-INF/lib/commons-httpclient-3.1.jar /usr/hdp/current/ranger-usersync/lib/

cp /usr/hdp/current/ranger-admin/ews/webapp/WEB-INF/lib/commons-codec-1.9.jar /usr/hdp/current/ranger-usersync/lib/

Still we are getting same error.

How to resolve it? Please suggest.

Thanks,

Bhushan

1 ACCEPTED SOLUTION

avatar
Contributor

Hi @Bhushan Kandalkar can you please run below command on host

$ hdp-select it will show you all the services stack versions please check ranger-usersync service version then verify it with

ps -ef | grep ranger-usersync it will show you ranger user sync service process and from where its taking libraries.

Eg.

$hdp-select

ranger-usersync - 2.5.6.0-40

$ps -ef | grep ranger-usersync

ps -ef | grep rangeruser ranger 15429 1 99 08:53 ? 00:00:11 java -Dproc_rangerusersync -Dlog4j.configuration=file:/etc/ranger/usersync/conf/log4j.properties -Dlogdir=/var/log/ranger/usersync -cp /usr/hdp/2.5.6.0-40/ranger-usersync/dist/*:/usr/hdp/2.5.6.0-40/ranger-usersync/lib/*:/usr/hdp/2.5.6.0-40/ranger-usersync/conf:/* org.apache.ranger.authentication.UnixAuthenticationService -enableUnixAuth root 15579 13151 0 08:53 pts/2 00:00:00 grep --color=auto rangeruser

if it doesnt match then you need to kill process with

kill -9 15429

and restart your service.

it should resolve this issue. I faced this issue in our production envirnment after upgrading HDP from 2.3.4.0 to 2.5.6.0 and I resolved it by above mentionned way. Please update me if this resolution helped you too.

View solution in original post

6 REPLIES 6

avatar

@Bhushan Kandalkar Try Copying the jars to /usr/hdp/current/ranger-usersync/lib/

avatar
Contributor

@Sandeep Nemuri, I have already copied these jars to /usr/hdp/current/ranger-usersync/lib/. But still getting same error.

avatar

@Bhushan Kandalkar

RANGER-989 is actually a duplicate of

https://issues.apache.org/jira/browse/RANGER-804

Solution to this issue was to include the following 2 jars in the lib directory for the usersync process

commons-httpclient-3.1.jar
commons-codec-1.4.jar

Make sure you are on the correct node when copying the files to /usr/hdp/current/ranger-usersync/lib/ as usersync process maybe installed on separate node.

HTH

*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.

avatar
Contributor

@Felix Albani, I have copied jars at /usr/hdp/current/ranger-usersync/lib/. Also, I did these changes on Ranger machine. But still getting same error.

avatar
Contributor

Hi @Bhushan Kandalkar can you please run below command on host

$ hdp-select it will show you all the services stack versions please check ranger-usersync service version then verify it with

ps -ef | grep ranger-usersync it will show you ranger user sync service process and from where its taking libraries.

Eg.

$hdp-select

ranger-usersync - 2.5.6.0-40

$ps -ef | grep ranger-usersync

ps -ef | grep rangeruser ranger 15429 1 99 08:53 ? 00:00:11 java -Dproc_rangerusersync -Dlog4j.configuration=file:/etc/ranger/usersync/conf/log4j.properties -Dlogdir=/var/log/ranger/usersync -cp /usr/hdp/2.5.6.0-40/ranger-usersync/dist/*:/usr/hdp/2.5.6.0-40/ranger-usersync/lib/*:/usr/hdp/2.5.6.0-40/ranger-usersync/conf:/* org.apache.ranger.authentication.UnixAuthenticationService -enableUnixAuth root 15579 13151 0 08:53 pts/2 00:00:00 grep --color=auto rangeruser

if it doesnt match then you need to kill process with

kill -9 15429

and restart your service.

it should resolve this issue. I faced this issue in our production envirnment after upgrading HDP from 2.3.4.0 to 2.5.6.0 and I resolved it by above mentionned way. Please update me if this resolution helped you too.

avatar
Contributor

Thanks @Arshadullah Khan. That worked.