Server Start Failure Because of Inability to Set Localhost

Problem

Manta Server is not starting, and trying to open Manta Dataflow Viewer in a web browser results in HTTP error 404: not found. The manta-dataflow.log file in Manta Server contains an error like:

2020-08-07 11:43:58.479 [main] ERROR net.sf.ehcache.Cache Unable to set localhost. 
This prevents creation of a GUID. Cause was: <hostname>: <hostname>: Name or service not known
java.net.UnknownHostException: <hostname>: <hostname>: Name or service not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1642) ~[?:?]
    at net.sf.ehcache.Cache.<clinit>(Cache.java:222) ~[ehcache-2.10.5.jar:2.10.5]
    at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:305) ~[ehcache-2.10.5.jar:2.10.5]
    at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:223) ~[ehcache-2.10.5.jar:2.10.5]
    at net.sf.ehcache.CacheManager.configure(CacheManager.java:783) ~[ehcache-2.10.5.jar:2.10.5]

Cause

This issue is caused by a missing unknown host name alias.

Solution

  1. Add a mapping with the following line to the hosts file (typically, /etc/hosts on UNIX or C:\Windows\System32\drivers\etc\ on Windows).

    1. If the file does not contain a mapping of 127.0.0.1, add the following line:
      127.0.0.1 <hostname>

    2. If the file already contains a mapping of 127.0.0.1:
      127.0.0.1 <other hostname>,
      add the <hostname> alias to the mapping
      127.0.0.1 <other hostname> <hostname>

  2. Restart the Manta Server.

Example

The server is not starting and there is an error in manta-dataflow.log.

2020-08-07 11:43:58.479 [main] ERROR net.sf.ehcache.Cache Unable to set localhost. 
This prevents creation of a GUID. Cause was: jsmith01: jsmith01: Name or service not known
java.net.UnknownHostException: jsmith01: jsmith01: Name or service not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1642) ~[?:?]
    at net.sf.ehcache.Cache.<clinit>(Cache.java:222) ~[ehcache-2.10.5.jar:2.10.5]

The host name alias jsmith01 is missing, so it must be added to the hosts file. The hosts file contains:

127.0.0.1 localhost

so the line must be modified to:

127.0.0.1 localhost jsmith01