Articles in this section

Plesk Migrator fails: APS database assignment error: Not a gzipped file (b'PK')

Applicable to:

  • Plesk for Windows

Symptoms

Migration in Windows fails in APS assignment step.

  • The web interface shows:

    CONFIG_TEXT:  Failed to assign APS databases to domains for subscription 'example.com'

  • The migration log shows:

    CONFIG_TEXT: Migration tools tried to perform operation in 3 attempts: Not a gzipped file (b'PK')

  • The Migrator debug log shows a traceback ending in:

    CONFIG_TEXT: gzip.BadGzipFile: Not a gzipped file (b'PK')

Cause

The migration dump archive is a valid ZIP file, but it contains trailing data after the last End Of Central Directory (EOCD) record. This causes the Migrator's archive type detection to misidentify the file as GZIP instead of ZIP, which breaks extraction during the APS database assignment step.

The truncation could be caused by connection issues between source and target, based on the fact that the dump download has no completeness check, so if the connection to the source RPC agent drops mid-transfer, backup.zip ends up truncated. 

Resolution

Restart RPC agents by following the steps from this guide - then retry the migration.

As a workaround:

  1. Connect to the server via RDP.
  2. Back up the file before editing:

    C:\ copy "C:\Program Files (x86)\Plesk\admin\plib\modules\panel-migrator\backend\lib\python\parallels\core\actions\deploy\assign_databases_to_domains.py" "C:\Program Files (x86)\Plesk\admin\plib\modules\panel-migrator\backend\lib\python\parallels\core\actions\deploy\assign_databases_to_domains.py.bak"

  3. Open assign_databases_to_domains.py and locate the run method.
  4. Comment out the line that builds the APS database assignment list and replace it with an empty list, so the method never attempts to read the affected archive:

    CONFIG_TEXT: def run(self, global_context, subscription):
        #assignments = list(self._iter_aps_database_assignments(global_context, subscription))
        assignments = []

  5. Save the file and re-run the migration for the affected subscriptions.

Note: The following workaround was reported by a customer. Not officially tested.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.