Logins Fail Periodically when Delegating User Management to JIRA
This article pertains to Confluence 3.4 and below.
When user management is delegated to JIRA, logins fail periodically. The following appears in the
2009-05-27 14:23:46,337 FATAL [TP-Processor1] [user.provider.jdbc.JDBCProfileProvider] handles Could not see if [user1] is handled – url: /confluence/dashboard.action | userName: anonymous | action: dashboard com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was70513 milliseconds ago.The last packet sent successfully to the server was 70513 milliseconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3270)
The datasource for the JIRA database is not validating connections or reconnecting as needed.
Update the datasource definition:
- Add an autoReconnect option to the JDBC URL. See Database Setup For MySQL.
- Add a validationQuery parameter. See Surviving Connection Closures. The end result should be something like the following example for MySQL:
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/jiradb?useUnicode=true&characterEncoding=UTF8&autoReconnect=true" username="jirauser" password="jirapassword" maxActive="20" validationQuery="select 1" />