Index queue won't flush automatically, 'Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed' errors thrown
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
Unable to clear indexing queue automatically, items sit in the queue even after:
The following appears in the atlassian-confluence
.log
1
Caused by: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
You may also see this error:
1
2
ERROR [scheduler_Worker-6] [org.quartz.core.ErrorLogger] schedulerError Unable to notify JobListener(s) of Job to be executed: (Job will NOT be executed!). trigger= DEFAULT.IndexQueueFlusher job= DEFAULT.IndexQueueFlusher
org.quartz.SchedulerException: JobListener 'ScheduledJobListener' threw exception: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.JDBCConnectionException: Cannot open connection [See nested exception: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.JDBCConnectionException: Cannot open connection]
Diagnosis
Environment
Windows
Server has both IPv4 and IPv6 enabled
Cause
The Java Virtual Machine (JVM) can have problems opening or closing sockets at the operating system level when both IPv4 and IPv6 are enabled on a Windows server.
Solution
Workaround
JVM will need to run over IPv4, if possible. To do this add this set the following JVM option:
Shutdown Confluence
Open <confluence-install-directory>/bin/setenv.bat
For Confluence 5.6 and later
Add the following below CATALINA_OPTS section
1
set CATALINA_OPTS=-Djava.net.preferIPv4Stack=true %CATALINA_OPTS%
Save the file
Confluence 5.5 and below
Add the following below the JAVA_OPTS section
1
set JAVA_OPTS=-Djava.net.preferIPv4Stack=true %JAVA_OPTS%
Save the file
Start Confluence
You may also need to adjust the prefix policy to prefer IPv4 over IPv6
If you are unfamiliar with the process you can refer to Microsoft's Fix-its.
⚠️ These Fix-its are provided by Microsoft and are not supported by Atlassian.
Prefer IPv6 over IPv4 (restore the default behavior)
Was this helpful?