Confluence logs errors: 'This prevents creation of a GUID' due to incorrect host name

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

The following error appears in the atlassian-confluence.log:

2011-03-16 18:20:03,021 ERROR [main] [net.sf.ehcache.Cache] <clinit> Unable to set localhost. This prevents creation of a GUID. Cause was: <hostname>: <hostname>
java.net.UnknownHostException: <hostname>: <hostname>
    at java.net.InetAddress.getLocalHost(InetAddress.java:1354)
    at net.sf.ehcache.Cache.<clinit>(Cache.java:145)

Or appears as an APPARENT DEADLOCK with java.net.InetAddress.getLocalHost in the stack trace:

2020-04-23 13:06:05,467 WARN [C3P0PooledConnectionPoolManager[identityToken->2w3zt6a91asfohs45mi33|4e5cee73]-AdminTaskTimer] [mchange.v2.async.ThreadPoolAsynchronousRunner] log com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@75da8a7e -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
2020-04-23 13:06:05,471 WARN [C3P0PooledConnectionPoolManager[identityToken->2w3zt6a91asfohs45mi33|4e5cee73]-AdminTaskTimer] [mchange.v2.async.ThreadPoolAsynchronousRunner] log com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@75da8a7e -- APPARENT DEADLOCK!!! Complete Status:
    Managed Threads: 3
    Active Threads: 3
    Active Tasks:
        com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@381fa96e
            on thread: C3P0PooledConnectionPoolManager[identityToken->2w3zt6a91asfohs45mi33|4e5cee73]-HelperThread-#1
       ...
Pool thread stack traces:
    Thread[C3P0PooledConnectionPoolManager[identityToken->2w3zt6a91asfohs45mi33|4e5cee73]-HelperThread-#0,1,main]
        java.net.InetAddress.getLocalHost(InetAddress.java:1487)
        com.microsoft.sqlserver.jdbc.Util.lookupHostName(Util.java:665)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2211)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1897)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1738)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1062)
        com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:572)
        com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
    ...
    Thread[C3P0PooledConnectionPoolManager[identityToken->2w3zt6a91asfohs45mi33|4e5cee73]-HelperThread-#1,1,main]
        java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
        java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
        java.net.InetAddress.getLocalHost(InetAddress.java:1501)
        com.microsoft.sqlserver.jdbc.Util.lookupHostName(Util.java:665)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2211)
        com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1897)


Cause

The local hostname (or COMPUTERNAME - Windows) that is running Confluence is not in the host file or is not resolvable via DNS lookup.

Resolution

Linux:

  1.  Run hostname on the machine running Confluence
  2.  Edit/etc/hosts and add the following line:
127.0.0.1 <output of hostname>

Windows

  1. Open a command prompt and run ipconfig /all

  2. Locate the "Host Name" line and the hostname will be on the right

  3. Navigate to: C:\Windows\System32\drivers\etc\

  4. Edit the hosts file in a text editor of your choice as an administrator

  5. Add the following line:

127.0.0.1 <Host Name value>


(info) We strongly recommend placing the hostname in the hosts file as a fail-safe for DNS server failure.

Alternatively, make the hostname resolvable via DNS.



Last modified on May 20, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.