Problem communicating with Crowd - Read timed out
Problem
Fisheye fails while performing operations related to an external Crowd directory.
The following appears in the atlassian-fisheye-YYYY-DD-MM.log:
com.cenqua.fisheye.user.AuthenticationException: Problem communicating with Crowd
...
Caused by: com.atlassian.crowd.exception.OperationFailedException: java.net.SocketTimeoutException: Read timed out
...
Caused by: java.net.SocketTimeoutException: Read timed out
...
There are a couple of use cases this error could occur. In both scenarios, the error will be followed by the stack trace above.
User synchronisation
ERROR [qtp685558284-24756 ] fisheye DefaultUserManager-synchroniseUsers - Error communicating with crowd. Skipping to the next user ...
User authentication
ERROR [qtp1896232624-6136 ] fisheye DefaultUserManager-loginWithSanitizedUserName - Could not authenticate user "testuser"
Cause
Fisheye closes the connection to Crowd if the response is slower than the default timeout.
See our documentation on Integrating Crowd with Atlassian FishEye for more information.
Diagnosis
The time required by the interaction between Fisheye/Crucible and Crowd is tracked in the DEBUG level log files. In order to make sure that's your case, please turn DEBUG logging on using your Fisheye UI:
- Go to Administration > Server Settings > Debug Logging, and turn debug logging "ON".
To locate the time and compare it with the default values or your environment configuration in order to check if the time out settings are exceeded, you should proceed as follows:
- locate the following line in the log files
com.cenqua.fisheye.user.AuthenticationException: Problem communicating with Crowd
- retrieve the line above the exception showing the Crowd operation being performed and read the value after the time (20016 in the following example). Note that the log line may be different depending on your use case.
DEBUG [qtp1603177117-1463 ] fisheye Timer-output - <- CrowdAuth.authenticate() time 20016 millis mem_usage = 173401976 heapsize = 2089811968 freemem = 1916409992
- compare this value with the values overwriting the defaults in your installation or with the default timeout settings.
- In the example above, the logs clearly reveal the 20000 ms time window before the stack trace is thrown, which is matches the default
socket.timeout
timeout for that specific Fisheye version.
Resolution
Increase the timeout from the default when communicating with Crowd.
- Stop Fisheye
- Create a backup your
FISHEYE_INST/config.xml.
- Add
http.timeout
andsocket.timeout
intoconfig.xml
:
<crowd jiraInstance="false" resyncPeriod="12 hour" resync="true" refreshExistingUsers="true" sso-enabled="true" auto-add="true"><crowd-properties>#Wed Aug 19 12:39:01 EDT 2015
application.password=Sanitized by Support Utility
application.name=crucible
crowd.server.url=http\://crowd.instance.com\:8095/crowd/
http.timeout=30000
socket.timeout=600000
</crowd-properties><resyncGroupsList><group name="Administrators"/><group name="Managers"/><group name="Test"/><group name="Other Group"/><group name="Developers"/></resyncGroupsList></crowd>
Once the change has been saved, start Fisheye and this should allow more time before Fisheye closes the connection when Crowd is slow to respond.