zLinux user impersonation error

book

Article ID: 5164

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

The CA Release Automation agent is installed on a zLinux and configured to use a customActionsRunner.sh for user impersonation that calls: su - $3 -c "cd /path/to/NolioAgent/folder ;  ./ActionsRunner.sh $1 $2 $3"

This method is documented here: https://docops.ca.com/ca-release-automation/6-1/en/installation/deploy-agents#DeployAgents-RunProcessesUnderDifferentUsers–Unix/Linux 


However, after adding an action and setting it to execute as a different user it is failing. In the logs/<userSetInAction>_output.log file we're seeing: 

SLF4J: Class path contains multiple
SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/CA/ReleaseAutomationAgent/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/CA/ReleaseAutomationAgent/actionslib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 

log4j:WARN Failed to set property [remoteHost] to value "localhost". java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:245)
    at org.apache.log4j.config.PropertySetter.setProperty(PropertySetter.java:204)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:169)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
    at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:66)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
    at com.nolio.platform.shared.datamodel.execution.remote.ActionsRunner.<clinit>(ActionsRunner.java:47)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:233) 

Caused by: java.lang.NoClassDefFoundError: java.net.InetAddress$InetAddressHolder
    at java.net.InetAddress.init(Native Method)
    at java.net.InetAddress.<clinit>(InetAddress.java:253)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
    at org.apache.log4j.net.SocketAppender.getAddressByName(SocketAppender.java:315)
    at org.apache.log4j.net.SocketAppender.setRemoteHost(SocketAppender.java:339)
... 23 more 

 

Cause

The root cause of this issue appears to be the absence of the java.net.InetAddress$InetAddressHolder class. If you extract the <jreInstallDir>/lib/rt.jar file and extract it then you should be able to find this class/file here: ./java/net/InetAddress$InetAddressHolder.class

If you cannot find this class then the IBM JRE version that you are using is missing this class that is required for this implementation of user impersonation. 

Environment

CA Release Automation Agent 6.2zLinux running RHEL 7.2Very early version of IBM JRE 7.

Resolution

Install the latest version of IBM JRE. At the time of this writing we used the installer: ibm-java-s390x-jre-8.0-3.12.bin

Once you have the latest version of the IBM JRE installed:

  • It is recommended to uninstall the agent. 
  • export JAVA_HOME=/opt/ibm/java-s390x-80/jre (or wherever you installed the ibm jre)
  • Rerun the agent installer.