Fatal error during "manage.py migrate registration" occurs during Symantec App Center upgrade

book

Article ID: 157931

calendar_today

Updated On:

Products

Symantec Products

Issue/Introduction

When upgrading Symantec App Center to version 4.1.x, the setup.sh script fails during the migration section with the following error:

 

running /usr/local/nukona/python/bin/python ./manage.py migrate registration --noinput --merge
migrate stdout:
Running migrations for registration:
 - Migrating forwards to 0004_auto__del_field_registrationrequest_registration_state_by.
 > registration:0002_auto__add_field_registrationrequest_registration_state__add_field_regi
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   = ALTER TABLE "REGISTRATION_REGISTRATIONRD967" DROP COLUMN "REGISTRATION_STATE"; []
   = ALTER TABLE "REGISTRATION_REGISTRATIONRD967" DROP COLUMN "REGISTRATION_STATE_BY_ID"; []

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS (one that supports DDL transactions)
 ! NOTE: The error which caused the migration to fail is further up.
Error in migration: registration:0002_auto__add_field_registrationrequest_registration_state__add_field_regi

migrate stderr:
FATAL ERROR - The following SQL query failed: ALTER TABLE "REGISTRATION_REGISTRATIONRD967" ADD "REGISTRATION_STATE" NVARCHAR2(50) DEFAULT 'submitted' NULL ;
The error was: ORA-00942: table or view does not exist

 

Cause

This error occurs due to an improperly named table in the Oracle database. This table receives an incorrect name during an upgrade from App Center 3.x to version 4.0.x. When the upgrade to 4.1.x is executed, the script is looking for a specific table name which doesn't exist in this scenario.

An environment which started with App Center version 4.0.x, or later, will not experience this issue.

  

Resolution

This behavior is a defect, and the attached fix_reg_migration.py script has been developed and qualified to resolve this issue. Its corresponding "read me" contains the following instructions:

Recovery (error has already occurred, upgrade has failed):

1. Copy the attached python script, fix_reg_migration.py, to the following path on the App Center server:

/usr/local/nukona/appstore_cu/scripts

2. Change working directory to:

/usr/local/nukona/appstore_cu/

3. Run the following command:

# python scripts/fix_reg_migration.py

Output should confirm that a table has been renamed, and appear similar to as follows:

Getting list of tables
Got 320 tables
Found REGISTRATION_REGISTRATIONR3BB9 in DB, renaming
Done.

5. Re-run App Center upgrade (setup.sh upgrade)


Prevention (4.1.x upgrade has not yet been executed):

1. Stop the App Center services by running:

# /usr/local/nukona/bin/nukona-services.sh stop

2. Copy the attached python script, fix_reg_migration.py, to the following path on the App Center server:

/usr/local/nukona/appstore_cu/scripts

2. Change working directory to:

/usr/local/nukona/appstore_cu/

4. Run the following command:

# python scripts/fix_reg_migration.py

Output should confirm that a table has been renamed, and appear similar to as follows:

Getting list of tables
Got 320 tables
Found REGISTRATION_REGISTRATIONR3BB9 in DB, renaming
Done.

5. Perform App Center upgrade (setup.sh upgrade)
 

 

 

 

Applies To

 
  • Symantec App Center 4.1.x
  • Oracle database

 

Attachments

fix_reg_migration.py get_app
fix_reg_migration-README.txt get_app