ConfigHubPub/ConfigHubPlatform

Fresh install of v1.8.1 fails with database error

Closed this issue · 5 comments

Have downloaded ConfigHub 1.8.1.tar.gz, setup the datasource for mySQL (granted all permissions to user) and triggered startup.sh. Seeing the below error in /var/log/confighub/configHub.log. ConfigHub isn't starting up. server.out log looks clean. No exceptions whatsoever.

16:18:29,528 INFO HHH000204: Processing PersistenceUnitInfo [
name: ConfigHubMain
...]
16:18:29,589 INFO HHH000412: Hibernate Core {5.2.17.Final}
16:18:29,590 INFO HHH000206: hibernate.properties not found
16:18:29,595 WARN HHH000059: Defining hibernate.transaction.flush_before_completion=true ignored in HEM
16:18:29,633 INFO HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
16:18:29,932 INFO HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
16:18:29,968 INFO Envers integration enabled? : true
16:18:30,983 WARN HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.spi.UpdateTimestampsCache]; using defaults.
16:18:30,987 INFO HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache
16:18:30,988 WARN HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults.
16:18:30,992 INFO HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache
16:18:31,103 WARN HHH020003: Could not find a specific ehcache configuration for cache named [com.confighub.core.system.SystemConfig]; using defaults.
16:18:31,507 INFO HHH000397: Using ASTQueryTranslatorFactory
16:18:31,880 INFO HHH000204: Processing PersistenceUnitInfo [
name: ConfigHubMain
...]
16:18:31,882 WARN HHH000059: Defining hibernate.transaction.flush_before_completion=true ignored in HEM
16:18:31,895 INFO HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
16:18:31,899 INFO Envers integration enabled? : true
16:18:32,051 INFO HHH000250: Starting update timestamps cache at region: org.hibernate.cache.spi.UpdateTimestampsCache
16:18:32,051 INFO HHH000248: Starting query cache at region: org.hibernate.cache.internal.StandardQueryCache
16:18:32,169 INFO HHH000397: Using ASTQueryTranslatorFactory
16:18:32,313 WARN SQL Error: 1146, SQLState: 42S02
16:18:32,313 ERROR Table 'ConfigHubDS.systemconfig' doesn't exist
16:18:32,319 INFO ConfigHub Version: 1.8.1
16:18:32,323 INFO ConfigHub Shutdown

Am running this on Ubuntu 18.04.2 LTS with openjdk 1.8.0_181 and mySQL 5.7.26

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

Ubuntu kernel
4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Database config in server.xml

<Resource id="ConfigHubMainDS" type="DataSource">
      JdbcDriver = com.mysql.jdbc.Driver
      JdbcUrl = jdbc:mysql://localhost:3306/ConfigHubDS
      UserName = confighub
      Password = password
      JtaManaged = false
      validationQuery="SELECT 1"
      maxWaitTime = 2 seconds
      maxActive = 200
    </Resource>

Same issue here, and same with v1.8 (non-hotfixed). It also fails on an upgrade from 1.7 series, apparently: #89, and it failed for me on an upgrade from (Dockerized) 1.6.5 as well.

Doesn't help much, but the table name in the current spelling first appeared in the change in 8ff5922. Before, it was missing (4245183) and at some other point, it was named system_config.

Good catch there @sunsided. Indeed the table name was never annotated in the earlier versions which I suspect, Hibernate would've constructed the name automatically and as you said at rev 8ff5922 I see the Table name annotation appearing with system_config which is not inline with the Liquibase schema def here But in the latest revision 6611fd3 I can see the correct table name though, but still it complains in the log.

Hi guys. Sorry, liquibase is not integrated into ConfigHub startup. Just didn't have the time yet. However, if you look at the https://github.com/ConfigHubPub/Database-Manager repo, it is a standalone database creation/upgrade manager (backed by liquibase).

I just ran it against a new MySQL database:

[edin@Edins-MacBook-Pro Database-Manager]$ mysql -V
mysql  Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)
  1. Build the tool:
[edin@Edins-MacBook-Pro Database-Manager]$ ./gradlew clean build jar

BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed
  1. Run it :)
java -jar build/libs/ConfigHubDBManager-1.8.jar -t mysql -r 'jdbc:mysql://localhost:3306/ConfigHub?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC' -u edin -p ***********

Thanks @edoarsla that explains the issue. Thanks once again for the DB Manager steps. It works now !