Auto Upgrade fails for MID servers on Linux hosts: ERROR *** Error or exception in monitor: java.long.NoClassDefFoundError


Description

MID server Auto Upgrade fails with error:

AutoUpgrade.3600 SEVERE *** ERROR *** Error or exception in monitor: java.long.NoClassDefFoundError.

Agent logs also show below error:

StatusMonitor.600 SEVERE *** ERROR *** ip-192-168-220-6: ip-192-168-220-6: Name or service not known

Release or Environment

MID servers installed on Linux/Unix hosts

Cause

Both errors seen in the agent and wrapper logs come down to the following parts of the code:

For startup:

com.glide.util.HostUtil.getHostname(HostUtil.java:47)

Or for upgrade:

shade.distupgrade.com.glide.util.HostUtil.getHostname(HostUtil.java:52) 

This calls regular java class: 

java.net.InetAddress.getLocalHost(); 

This only checks the hostname in /etc/hosts and ignores /etc/resolv.conf of Linux hosts

Resolution

  1.  Putty into the host
  2. Attempt to restart the MID
    1. cd /servicenow/MIDSERVER1/agent
    2. Run the command ./stop.sh
    3. Run the command ./start.sh

At this point the MID should come UP and then quickly change to UPGRADING state

If not....

  1. Check the agent log for the errors below(You can use VI editor or "less" command):
    MIDServer SEVERE *** ERROR *** MIDSERVER1: MIDSERVER1: System error
    java.net.UnknownHostException: MIDSERVER: MISERVER: System error
    at java.net.InetAddress.getLocalHost(InetAddress.java:1505)

    Or
    AutoUpgrade.3600 SEVERE *** ERROR *** Error or exception in monitor
    java.lang.NoClassDefFoundError: shade/distupgrade/org/xml/sax/SAXException
    at shade.distupgrade.com.glide.util.Log.isIgnoredException(Log.java:482)

To resolve this you can do the following:

  1. Run the command "hostname" to find the name of the host
  2. Run "ifconfig" to find the IP address of the host
  3. Use VI (editor) and edit the /etc/hosts file by adding a line to reflect the localhost
    192.168.220.6 MIDSERVER1 localhost
  4. Restart the MID by doing the following:
    1. Change directory by running "cd /servicenow/MIDSERVER1/agent"
    2. Run the command ./stop.sh
    3. Run the command ./start.sh