LDAP sync fails with IllegalArgumentException due to wrong MySQL JDBC driver being used
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
Syncing with LDAP directory fails and the following exception is written in the atlassian-fisheye.log
file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
2021-06-07 12:36:31,273 ERROR [schedulerServiceQuartzScheduler_Worker-1 ] com.atlassian.crowd.directory.DbCachingDirectoryPoller DbCachingDirectoryPoller-pollChanges - Error occurred while refreshing the cache for directory [ 2 ].
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2553) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2536) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.loader.Loader.list(Loader.java:2361) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) [hibernate-core-4.2.13.Final.jar:4.2.13.Final]
at com.atlassian.crowd.dao.user.UserDAOHibernate.search(UserDAOHibernate.java:377) [crowd-persistence-hibernate4-2.9.5-7fb674b.jar:?]
Caused by: java.sql.SQLException: HOUR_OF_DAY: 2 -> 3
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:85) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:939) [mysql-connector-java-.jar:8.0.24]
at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:977) [mysql-connector-java-8.0.24.jar:8.0.24]
Caused by: com.mysql.cj.exceptions.WrongArgumentException: HOUR_OF_DAY: 2 -> 3
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [?:1.8.0_191]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_191]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_191]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_191]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:195) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:51) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.result.AbstractDateTimeValueFactory.createFromDatetime(AbstractDateTimeValueFactory.java:104) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeDatetime(MysqlTextValueDecoder.java:90) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:86) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:243) [mysql-connector-java-8.0.24.jar:8.0.24]
at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91) [mysql-connector-java-8.0.24.jar:8.0.24]
... 71 more
Caused by: java.lang.IllegalArgumentException: HOUR_OF_DAY: 2 -> 3
at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2829) [?:1.8.0_191]
at java.util.Calendar.updateTime(Calendar.java:3393) [?:1.8.0_191]
at java.util.Calendar.getTimeInMillis(Calendar.java:1782) [?:1.8.0_191]
at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:191) [mysql-connector-java-8.0.24.jar:8.0.24]
... 77 more
Environment
Fisheye 4.8.6
MySQL 5.7
JDBC Driver version 8.x
Cause
This turns out to be a bug in MySQL JDBC driver version 8.x, and as can be seen in the stack trace above the mysql-connector-java-8.0.24.jar
driver version is being used.
Solution
We recommend at Migrating to MySQL to not use the JDBC driver version 8.x. The driver version needs to be downgraded to 5.1.x by following these steps:
Access the MySQL Connector / J download website
Click the Archives tab
In Product Version dropdown, select 5.1.49.
Leave the Operating System dropdown set to Platform Independent
Click the Download button corresponding to the Compressed TAR Archive option listed
Expand the downloaded tar.gz file.
Copy the mysql-connector-java-5.1.49-bin.jar file to your FISHEYE_INST/lib directory.
NOTES:
FISHEYE_INST
is an environment variable that points to the directory used by Fisheye for storing dataYou may need to create the
lib
directory insideFISHEYE_INST
Delete the existing MySQL driver mysql-connector-java-8.0.24.jar from FISHEYE_INST/lib directory.
Restart Fisheye/Crucible.
Was this helpful?