Start a conversation

Error: 'cannot create index PK_ARC_NEW_OWNERS' when upgrading the schema of a Firebird archive store ( ONLY)

Answer

IMPORTANT: This article is written as a Skynet type article for a reason. The cause behind the scenario is database corrupt and therefore not fully in our control / responsibility. We do have a way to potentially restore such a corrupt database to a state which might allow the schema upgrade to succeed.

Do not state to the customer that we are able to fix it for him (it might be corrupt to a level that the fix does not work).

Internal reference: TT1486

PROBLEM

The schema upgrade of an Firebird based Archive Store fails with:

When using the web interface:

The pipe has been ended. (109, 0x6d)

Note: The error above is very generic and does not allow to fully identify this situation!

Detailed debug log error from..\Store\Debuglogs\ManagementProviders.log):
 
2013-06-19,17:43:06,325,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Database version [57], Latest schema version [65]"
2013-06-19,17:43:06,325,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Schema Type [Upgradable]"
2013-06-19,17:43:06,325,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FS) Authentication Type >> [WindowsProcess]"
2013-06-19,17:43:06,325,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FS) Schema Type >> [Upgradable]"
2013-06-19,17:43:06,372,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) UpgradeSchema()"
2013-06-19,17:43:06,372,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Creating connection from: *** (828)"
2013-06-19,17:43:06,387,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Database On-disk structure (ODS) version 11.1"
2013-06-19,17:43:06,387,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Upgrading to version [60]. Number of steps to execute [46] >>"
2013-06-19,17:43:06,466,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Step [1] Completed"
2013-06-19,17:43:06,528,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Step [2] Completed"
*** truncated steps 3-44 for readability ***
2013-06-19,17:43:06,919,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Step [45] Completed"
2013-06-19,17:43:06,934,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Step [46] Completed"
2013-06-19,17:43:06,934,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Upgrade to version [60] >> Completed"
2013-06-19,17:43:06,934,1,"#00001BFC","#00000004","info   ","ManagementProviders","(FB) Version table updated with schema details >> guid [GFI.MAR4.FireBirdFS.Eml], version [60]"
2013-06-19,17:43:07,169,1,"#00001BFC","#00000004","error  ","ManagementProviders","Error: (FB) UpgradeSchema. Rolling back  
;message: unsuccessful metadata update
;cannot create index PK_ARC_NEW_OWNERS 
;stack trace:    at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()
;   at Store.Management.FBSchemaProvider.UpgradeSchema(String connectionString, Schema schemaConfiguration, SchemaDetails schemaDetails) 
;message: unsuccessful metadata update
;cannot create index PK_ARC_NEW_OWNERS
;stack trace:    at FirebirdSql.Data.Client.Native.FesDatabase.ParseStatusVector(IntPtr[] statusVector)
;   at FirebirdSql.Data.Client.Native.FesTransaction.Commit()
;   at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()

Note that the error marked in red color specifically identifies this scenario.

ENVIRONMENT

  • GFI MailArchiver (builds 20130510, 20130704, 20130723)
  • Using Firebird based archive stores

SOLUTION

IMPORTANT
  • This script should be applied ONLY to installations of the following builds of GFI MailArchiver 2013: 20130510, 20130704, 20130723
  • Please ensure to read the readme.txt bundled with the script
  • It is recommended to take a backup of your GFI MailArchiver databases before applying the scripts below
  • If the FDB file is way larger than 2GB in size, the script above does not fix the issue follow the route to reimport the emails from it into SQL based archive stores.
  1. Download the script: http://ftp.gfisoftware.com/support/MARC/ScriptsAndTools/2013/MARC2013_FIX_CORRUPT_FDB_SCRIPT_20130726_01.zip
  2. Extract the download zip file
  3. Read the readme.txt
  4. Stop the GFIMailArchiver Store Service service
  5. Extract the attached zip file to a preferred directory
  6. Take a backup of the corrupted FireBird database (FDB)
  7. Copy the corrupted FDB file to the preferred directory
  8. Open CMD and set the path to the preferred directory
  9. Run the following command replacing XYZ.FDB with the corrupted FDB filename:
    • gbak -b -g -user SYSDBA -pass masterkey "XYZ.FDB" "XYZ_backup.FDB"
  10. Rename XYZ.FDB to XYZ.FDB_CORRUPTED
  11. Run the following command to repair the corrupted FireBird database:
    • gbak -c -user SYSDBA -pass masterkey "XYZ_backup.FDB" "XYZ.FDB"
  12. Replace the corrupted FDB in the databases folder with the newly restored FDB
  13. Start the GFIMailArchiver Store Service service
  14. Attempt to upgrade archive store via the Bulk Schema Upgrader or directly from the GFI MailArchiver UI

CAUSE

The Firebird database is corrupt.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments