system_table is queried before its creation on 24.10
Parent Issue
No response
Problem Statement
When upgrading from 23.01, the startup task Task00002LoadClusterLicenses checks the table system_table, which has not been created yet.
19:49:30.162 INFO startup.StartupTasksExecutor - Running Startup Tasks : Task00002LoadClusterLicenses
19:49:30.167 INFO runalways.Task00002LoadClusterLicenses - found license pack: /data/shared/assets/license.zip
19:49:30.217 INFO enterprise.LicenseUtil - found license serial: eb62e693-1c23-4f70-b3d7-379be0382097
19:49:30.222 ERROR lang.System - Can't process license zip file
com.dotmarketing.exception.DotDataException: ERROR: current transaction is aborted, commands ignored until end of transaction block{
"SQL": ["SELECT lastping FROM sitelic WHERE id=? "],
"maxRows": [-1],
"offest": [0],
"params": "eb62e693-1c23-4f70-b3d7-379be0382097"
}
After that, dotCMS crashes and never upgrades because it enters a loop where query data from the table that does not exist yet and never gets to the actual UT where the table is created.
The workaround was to create the table manually, just before starting dotCMS:
create table system_table (
key varchar(511) primary key,
value text not null
);
Steps to Reproduce
Upgrade a dotCMS database from 23.01 to 24.10
Acceptance Criteria
Run a smooth upgrade between dotCMS 23.01 to 24.10 without manually creating the system_table on the database.
dotCMS Version
from 23.01 to 24.10
Note: Since this is about upgrades, I cannot reproduce them on the demo server.
Proposed Objective
Customer Support
Proposed Priority
Priority 2 - Important
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response
discussing the approach
Passed IQA:
dotcms-1 | 16:39:44.156 INFO startup.StartupTasksExecutor - Running Startup Tasks : Task00002LoadClusterLicenses
dotcms-1 | 16:39:44.156 INFO runalways.Task00002LoadClusterLicenses - found license pack: /data/shared/assets/license.zip
dotcms-1 | 16:39:44.224 INFO enterprise.LicenseUtil - found license serial: f67cc273-d2ae-46b2-a9f8-5952dfe4cec2
dotcms-1 | 16:39:44.226 INFO enterprise.LicenseUtil - found license serial: bc7a74d8-a163-46c3-a8cc-d871258e7103
dotcms-1 | 16:39:44.228 INFO enterprise.LicenseUtil - found license serial: b1d13b56-9982-4bb3-a996-040f611fdf15
dotcms-1 | 16:39:44.234 INFO license.LicenseRepoDAO - License f67cc273-d2ae-46b2-a9f8-5952dfe4cec2 was applied to server 40e2953a-1647-4e64-9a9b-9926648ff125
dotcms-1 | 16:39:44.248 INFO util.Config - Setting property: CACHE_BINDPORT to 5701
dotcms-1 | 16:39:44.257 INFO cluster.ClusterFactory - Cluster topography has changed. This might force a rewire
dotcms-1 | 16:39:44.257 INFO cluster.ClusterFactory - Expecting Servers:[]
dotcms-1 | 16:39:44.259 INFO cluster.ClusterFactory - Found Servers:[server={serverId=40e2953a-1647-4e64-9a9b-9926648ff125, clusterId=dotcms-production, ipAddress=172.22.0.3, host=null, name=2a3da93519b3, esTransportTcpPort=null, esNetworkPort=null, esHttpPort=9200, cachePort=5701, lastHeartBeat=1729096784255, key=null, licenseSerial=f67cc273-d2ae-46b2-a9f8-5952dfe4cec2, startupTime=1729096771695}]
dotcms-1 | 16:39:44.259 INFO cluster.ClusterFactory - Cluster Active. Rewiring
dotcms-1 | 16:39:44.262 INFO business.ChainableCacheAdministratorImpl - *** Cluster Update
dotcms-1 | 16:39:44.262 INFO transport.PubSubCacheTransport - initing PubSubCacheTransport
dotcms-1 | 16:39:44.263 INFO dotpubsub.JDBCPubSubImpl - Starting to listen for Postgres notifications.
dotcms-1 | 16:39:44.263 INFO dotpubsub.JDBCPubSubImpl - Running Listener Loop every 500ms
dotcms-1 | 16:39:44.264 INFO dotpubsub.JDBCPubSubImpl - PGListener listening : dotcache_topic
Tested upgrading from 23.01_lts_SNAPSHOT to trunk_be08096
Fixed, now I'm able to upgrade without problems
https://gist.github.com/bryanboza/52a9ac88de1fee41679bb405437b8a7f