Agent uninstaller fails on RHEL7 - Could not display the GUI. This application needs access to an X Server.
search cancel

Agent uninstaller fails on RHEL7 - Could not display the GUI. This application needs access to an X Server.

book

Article ID: 217909

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio)

Issue/Introduction

When we install Nolio Agents we configure them to run using a different installation of JAVA from Azul Zulu. The process to do this was based on guidance from Broadcom and is similar to the steps listed in Changing JRE version for Agents. The process we follow on installing an agent to make it run using Azul Zulu Java which is already installed on the server is (where /usr/local/java/zulu/java8 is an installed Azul Zulu JRE on the server):

- delete (or move) the jre subfolder in the agent install folder
- create folders jre/bin and jre/lib under the agent install folder
- create symlink from jre/bin/NolioAgent under the agent install folder to /usr/local/java/zulu/java8/bin/java
- create symlink from jre/lib/ext under the agent install folder to /usr/local/java/zulu/java8/lib/ext

Our agents mostly run as expected with no issues having been reported so far.

However, when we try to run the embedded Nolio Agent uninstaller script <agent_install_dir>/uninstall on RHEL7 (at least 7.8 and 7.9 have been shown to have the issue) we get the following error:

root# /apps/Nolio/NolioAgent/uninstall -q
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.6.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
You can also try to delete the JVM cache file

This can be resolved if the env variable INSTALL4J_JAVA_HOME is set to point to the installed Azul Zulu JRE on the server which the agent is using to run, i.e. 

export INSTALL4J_JAVA_HOME=/usr/local/java/zulu/java8

Once that is set we then see the following GUI X server error

root# /apps/Nolio/NolioAgent/uninstall -q
testing JVM in /usr/local/java/zulu/java8 ...
Could not display the GUI. This application needs access to an X Server.
*******************************************************************
You can also run this application in console mode without
access to an X server by passing the argument -c
*******************************************************************

I searched the KB articles and checked some of the points mentioned in Upgrading to 6.7 result in error version `GLIBC_2.14' not found which is talking about a somewhat similar error but for upgrading server (NAC/NES) components. All the versions mentioned in the KB article seem to be satisfied on our system where I'm seeing this issue.

root# cat /proc/version
Linux version 3.10.0-1127.13.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Fri Jun 12 14:34:17 EDT 2020
root# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)
root# ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

The same embedded uninstaller script works for agents installed in the same way to run using Azul Zulu JRE on RHEL6 (6.10).

Environment

Release : 6.6, 6.7

Component : CA RELEASE AUTOMATION CORE

Cause

After troubleshooting it was identified that possible cause of the issue is missing configuration pointing to correct JAVA and missing fonts or some pacakages.

Error: For the below mentioned error

Could not display the GUI. This application needs access to an X Server.

Troubleshooting

  • Remove install4j cache file. It was saved in the /root folder in my environment because we used the root user. You may have different path based on user running RA agent. This file should contain the following list of parameters:
JRE_VERSION     /tmp/ra/zulu6.22.0.3-jdk6.0.119-linux_x64/jre/  1       6       0       0
JRE_INFO        /tmp/ra/zulu6.22.0.3-jdk6.0.119-linux_x64/jre/  110

Removing install4j cache file (It will be /RA-USER/.install4j)
   > rm /root/.install4j
  • Setup the INSTALL4J_JAVA_HOME parameter:
   > export INSTALL4J_JAVA_HOME=/tmp/ra/OpenJDK8U-jre_x64_linux_hotspot_8u282b08/
  • Optional. Modify the RA\.install4j\pref_jre.cfg file with specifying the correct link to the JRE. 
  • Try Uninstalling agent, if still it's not able to uninstall please capture the error files i.e. /tmp/install4jError....*.log and look for any errors like mentioned below
Exception:
java.lang.Error: Probable fatal error: No fonts found.
at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1097)

Resolution

Please follow steps below to resolve the error

Error: For the below mentioned error

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.6.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
You can also try to delete the JVM cache file

Solution: Need to set JAVA_HOME to JRE install directory making sure that java is resolved on system. It can be done either at specific user profile(vi ~/.bashrc OR vi ~/.bash_profile) uninstalling or at system level for all users. In below instruction we are setting it at system level.

Steps to set JAVA_HOME on RHEL

1: Take a note of path to JRE install directory on system.

2: Open the file /etc/profile in edit mode using command vi /etc/profile

3: In insert mode, add below lines

# Syntax
     export JAVA_HOME=PATH_TO_JRE_INSTALL_DIR
     export PATH=$JAVA_HOME/bin:$PATH

#Example
     export JAVA_HOME=/usr/local/java/zulu/java8
     export PATH=$JAVA_HOME/bin:$PATH

4: Save the file

5: Logout and Login again or use source /etc/profile to apply changes immediately

Validation

1: Validate if java is resolved on system, key in command java -version on terminal

2: Try to run the agent uninstaller ReleaseAutomationAgent/uninstall -q and it should uninstall fine

Error: For the below mentioned error

Could not display the GUI. This application needs access to an X Server.

Solution

1: Check for the any missing packages like font etc. error in file /tmp/install4jError....*.log. Install the missing packages and fonts which were missing as per respective JRE and try uninstall which will work fine.

Example:
root# yum install fontconfig dejavu-sans-fonts dejavu-serif-fonts

 

Additional Information