while spinning helm db-upgrade job ended up with error 'external_devportal_portal.API_ASSET' doesn't exist
search cancel

while spinning helm db-upgrade job ended up with error 'external_devportal_portal.API_ASSET' doesn't exist

book

Article ID: 379306

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

while spinning helm db-upgrade job endded up with below error .
[2024-09-27 09:21:01] INFO [liquibase.lockservice] Successfully released change log lock
Unexpected error running Liquibase: Migration failed for change set doesntmatter::onprem-migrate-legacy-swagger-from-api-to-api_asset::bagjo04:
     Reason: liquibase.exception.DatabaseException: Table 'external_devportal_portal.API_ASSET' doesn't exist [Failed SQL: (1146) INSERT INTO `API_ASSET` (
      `UUID`,
      `TENANT_ID`,
      `API_UUID`,
      `NAME`,
      `TYPE`,
      `CONTENT`,
      `CREATE_TS`,
      `CREATED_BY`,
      `MODIFY_TS`,
      `MODIFIED_BY`)

      SELECT
      UUID(),
      TENANT_ID,
      UUID,
      SPEC_FILENAME,
      'LEGACY',
      SPEC_CONTENT,
      MODIFY_TS,
      MODIFIED_BY,
      MODIFY_TS,
      MODIFIED_BY
      FROM API
      WHERE SPEC_CONTENT IS NOT NULL]

Environment

5.2.3

Cause

API_ASSET table was missing from the portal db.

Resolution

Need to create API_ASSET table in your portal db . While creating it kindly check the below parameters and values as to how you need to create it.

mysql> show create table API_ASSET;
+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table     | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| API_ASSET | CREATE TABLE `API_ASSET` (
  `UUID` varchar(36) NOT NULL,
  `TENANT_ID` varchar(255) NOT NULL DEFAULT '',
  `API_UUID` varchar(36) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `TYPE` varchar(20) NOT NULL,
  `CONTENT` longblob NOT NULL,
  `CREATE_TS` bigint NOT NULL,
  `CREATED_BY` varchar(100) DEFAULT NULL,
  `MODIFY_TS` bigint NOT NULL,
  `MODIFIED_BY` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`TENANT_ID`,`UUID`),
  UNIQUE KEY `UK_API_ASSET_TENANT_ID_API_UUID_NAME_TYPE` (`TENANT_ID`,`API_UUID`,`NAME`,`TYPE`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+