Pivotal Knowledge Base

Follow

Ranger UI does not start and shows IO error parsing security-applicationContext.xml

Environment

Product Version
Pivotal HD 3.0.x
OS ANY
Ambari 2.1.2

Symptom

When attempting to start Ranger from Ambari version 2.1.2,  the Ranger admin starts correctly, but the web interface does not load correctly and shows the error message as shown below:

in /var/log/ranger/admin/xa_portal.log

2015-05-08 15:42:12,724 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader (ContextLoader.java:307) - Context initialization failed 
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/classes/conf/security-applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/classes/conf/security-applicationContext.xml] 

in /var/log/ranger/admin/catalina.out

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/classes/conf/security-applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/classes/conf/security-applicationContext.xml]

Cause

Ambari overwrites the permissions of /etc/ranger/admin/conf/security-applicationContext.xml and makes them root. This makes Ranger web UI unable to start.  This is a known bug [AMBARI-1423].

Resolution

Permanent fix:

This is permanently fixed in Apache Ambari 2.2, which is available through Pivotal HDP.

Workaround:

1. Open /usr/phd/<versionX>/ranger-admin/setup.sh in a Linux text editor such as VI or NANO.

2. Find the line shown below:

echo "Installation of XASecure PolicyManager Web Application is completed."

3. Before the above line, insert this text:

chown -R ${unix_user}:${unix_group} ${WEBAPP_ROOT}/WEB-INF/classes/conf/

4. Restart Ranger via Ambari.

 

Comments

Powered by Zendesk