Confluence logs errors: 'This prevents creation of a GUID' due to incorrect host name
問題
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)
原因
The local hostname (or COMPUTERNAME - Windows) that is running Confluence is not in the host file or is not resolvable via DNS lookup.
ソリューション
Linux:
- Run hostname on the machine running Confluence
- Edit
/etc/hosts
and add the following line:
127.0.0.1 <output of hostname>
Windows:
Open a command prompt and run ipconfig /all
Locate the "Host Name" line and the hostname will be on the right
Navigate to:
C:\Windows\System32\drivers\etc\
Edit the hosts file in a text editor of your choice as an administrator
次の行を追加します。
127.0.0.1 <Host Name value>
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.