Issue Summary
Jira upgrade from 8.13.3 to 8.22.1 fails with Table 'jiradb_staging.nomenclature_entries' doesn't exist.
This is reproducible on Data Center: (no)
Steps to Reproduce
1. Environment used
Jira Software 8.13.3
Java Version : 11.0.14 - Red Hat, Inc.
Database Product Name is MySQL
Database Product Version is 5.7.16-enterprise-commercial-advanced-log
Database Driver Name is MySQL Connector/J
Database Driver Version is mysql-connector-java-8.0.27 (Revision: e920b979015ae7117d60d72bcc8f077a839cd791)
2. Database created for the upgrade restoring mySQL backup
DROP DATABASE jiradb_staging; CREATE DATABASE jiradb_staging CHARACTER SET utf8mb4 COLLATE UTF8MB4_BIN; create user 'jiradbuser'@'127.0.0.1' IDENTIFIED BY 'xxx'; CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on jiradb.* TO 'jiradbuser'@'127.0.0.1'; flush privileges;
sudo mysql -u root -p jiradb < prod.sql
3. Offline Backup following Upgrading Jira (manual)
4. Start Jira for the first time using 8.22.1
Expected Results
- We would expect that the new tables were created during the upgrade (the log file below was captured on an upgrade to Jira 8.22.1 using mySQL 5.7.37):
2022-03-29 15:44:12,962+0000 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks. 2022-03-29 15:44:12,962+0000 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully. 2022-03-29 15:44:13,160+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Product Name is MySQL 2022-03-29 15:44:13,160+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Product Version is 5.7.37 2022-03-29 15:44:13,161+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Driver Name is MySQL Connector/J 2022-03-29 15:44:13,161+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Driver Version is mysql-connector-java-8.0.27 (Revision: e920b979015ae7117d60d72bcc8f077a839cd791) 2022-03-29 15:44:13,471+0000 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Entity "CommentReaction" has no table in the database 2022-03-29 15:44:13,489+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Created table "comment_reaction" 2022-03-29 15:44:13,498+0000 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Entity "CustomField" has 12 fields but table "customfield" has 10 columns. 2022-03-29 15:44:13,498+0000 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Field "lastValueUpdate" of entity "CustomField" is missing its corresponding column "lastvalueupdate" 2022-03-29 15:44:13,584+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Added column "lastvalueupdate" to table "customfield" 2022-03-29 15:44:13,584+0000 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Field "issuesWithValue" of entity "CustomField" is missing its corresponding column "issueswithvalue" 2022-03-29 15:44:13,667+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Added column "issueswithvalue" to table "customfield" 2022-03-29 15:44:13,739+0000 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Entity "NomenclatureEntry" has no table in the database 2022-03-29 15:44:13,759+0000 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Created table "nomenclature_entries"
Actual Results
1. Offline backup. When starting Jira using 8.22.1, We can observe that the database checks are logging multiple warnings and there is no message related to
Created table "nomenclature_entries":
2022-04-01 15:12:34,580-0500 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks. 2022-04-01 15:12:34,581-0500 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully. 2022-04-01 15:12:34,979-0500 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Product Name is MySQL 2022-04-01 15:12:34,980-0500 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Product Version is 5.7.16-enterprise-commercial-advanced-log 2022-04-01 15:12:34,980-0500 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Driver Name is MySQL Connector/J 2022-04-01 15:12:34,980-0500 JIRA-Bootstrap INFO [o.o.c.entity.jdbc.DatabaseUtil] Database Driver Version is mysql-connector-java-8.0.27 (Revision: e920b979015ae7117d60d72bcc8f077a839cd791) 2022-04-01 15:12:38,831-0500 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Column "ID" of table "jiraaction" of entity "Action" exists in the database but has no corresponding field 2022-04-01 15:00:21,780-0500 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Column "ISSUEID" of table "jiraaction" of entity "Action" exists in the database but has no corresponding field 2022-04-01 15:00:21,780-0500 JIRA-Bootstrap WARN [o.o.c.entity.jdbc.DatabaseUtil] Column "AUTHOR" of table "jiraaction" of entity "Action" exists in the database but has no corresponding field
2. Jira startup fails with fatal error due to the missed table:
2022-04-01 15:00:31,826-0500 JIRA-Bootstrap ERROR [c.a.jira.startup.ComponentContainerLauncher] A fatal error occurred during initialisation. JIRA has been locked. com.atlassian.cache.CacheException: com.querydsl.core.QueryException: Caught SQLSyntaxErrorException for select NOMENCLATURE_ENTRY.id, NOMENCLATURE_ENTRY.original_name, NOMENCLATURE_ENTRY.new_name, NOMENCLATURE_ENTRY.new_name_plural, NOMENCLATURE_ENTRY.timestamp from nomenclature_entries NOMENCLATURE_ENTRY at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:93) at com.atlassian.jira.i18n.terminology.CachingTerminologyEntryDao.getAllTerminologyEntries(CachingTerminologyEntryDao.java:81) at com.atlassian.jira.i18n.terminology.TerminologyEntryReaderImpl.getAllTerminologyEntries(TerminologyEntryReaderImpl.java:45) at com.atlassian.jira.i18n.terminology.TerminologyTransformerImpl.refreshTerminologyEntries(TerminologyTransformerImpl.java:37) at com.atlassian.jira.i18n.terminology.TerminologyMapTransformer.transformAll(TerminologyMapTransformer.java:31) at com.atlassian.jira.web.bean.i18n.DefaultTranslationStoreFactory.createTranslationStore(DefaultTranslationStoreFactory.java:52) at com.atlassian.jira.i18n.BackingI18nFactoryImpl.create(BackingI18nFactoryImpl.java:29) at com.atlassian.jira.i18n.BackingI18nFactoryImpl.create(BackingI18nFactoryImpl.java:14) at com.atlassian.jira.i18n.CachingI18nFactory.lambda$buildCache$0(CachingI18nFactory.java:130) [...] at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.querydsl.core.QueryException: Caught SQLSyntaxErrorException for select NOMENCLATURE_ENTRY.id, NOMENCLATURE_ENTRY.original_name, NOMENCLATURE_ENTRY.new_name, NOMENCLATURE_ENTRY.new_name_plural, NOMENCLATURE_ENTRY.timestamp from nomenclature_entries NOMENCLATURE_ENTRY at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50) at com.querydsl.sql.Configuration.translate(Configuration.java:459) at com.querydsl.sql.AbstractSQLQuery.fetch(AbstractSQLQuery.java:502) at com.atlassian.jira.i18n.terminology.QueryDSLTerminologyEntryDao.lambda$getAllEntries$1(QueryDSLTerminologyEntryDao.java:51) [...] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964) at com.atlassian.cache.memory.DelegatingCachedReference.getUnderLock(DelegatingCachedReference.java:103) at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:88) ... 233 more Caused by: java.sql.SQLSyntaxErrorException: Table 'jiradb_staging.nomenclature_entries' doesn't exist at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009) at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83) at com.querydsl.sql.AbstractSQLQuery.fetch(AbstractSQLQuery.java:446) ... 254 more
Workaround
- Use MySQL Connector/J 5.1.49 for the upgrade instead of 8.0.27;
- After the upgrade, you can replace it with the 8.0.27 connector.
- mentioned in
-
Page Loading...