gpbackup reports: Scan error on column index 1, name "schema": converting NULL to string is unsupported
search cancel

gpbackup reports: Scan error on column index 1, name "schema": converting NULL to string is unsupported

book

Article ID: 374908

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Running a backup with gpbackup utility fails with :

$ gpbackup --dbname db01
20240812:10:49:53 gpbackup:gpadmin:mdw:019583-[INFO]:-gpbackup version = 1.30.3
20240812:10:49:53 gpbackup:gpadmin:mdw:019583-[INFO]:-Greenplum Database Version = 6.25.2 build commit:2ca3d98b43958f23744aa2023f3d87c249cb481c
20240812:10:49:53 gpbackup:gpadmin:mdw:019583-[INFO]:-Starting backup of database db01
20240812:10:49:54 gpbackup:gpadmin:mdw:019583-[INFO]:-Backup Timestamp = 20240812104953
20240812:10:49:54 gpbackup:gpadmin:mdw:019583-[INFO]:-Backup Database = db01
20240812:10:49:54 gpbackup:gpadmin:mdw:019583-[INFO]:-Gathering table state information
20240812:10:49:54 gpbackup:gpadmin:mdw:019583-[INFO]:-Acquiring ACCESS SHARE locks on tables
Locks acquired:  414 / 414 [============================================================] 100.00% 0s
20240812:10:49:55 gpbackup:gpadmin:mdw:019583-[INFO]:-Gathering additional table metadata
20240812:10:50:03 gpbackup:gpadmin:mdw:019583-[INFO]:-Getting partition definitions
20240812:10:50:04 gpbackup:gpadmin:mdw:019583-[INFO]:-Getting storage information
20240812:10:50:06 gpbackup:gpadmin:mdw:019583-[INFO]:-Getting child partitions with altered schema
20240812:10:50:06 gpbackup:gpadmin:mdw:019583-[INFO]:-Metadata will be written to /data/backup/gpseg-1/backups/20240812/20240812104953/gpbackup_20240812104953_metadata.sql
20240812:10:50:06 gpbackup:gpadmin:mdw:019583-[INFO]:-Writing global database metadata
20240812:10:50:07 gpbackup:gpadmin:mdw:019583-[INFO]:-Global database metadata backup complete
20240812:10:50:07 gpbackup:gpadmin:mdw:019583-[INFO]:-Writing pre-data metadata
20240812:10:50:09 gpbackup:gpadmin:mdw:019583-[CRITICAL]:-sql: Scan error on column index 1, name "schema": converting NULL to string is unsupported
20240812:10:50:10 gpbackup:gpadmin:mdw:019583-[INFO]:-Found neither /usr/local/greenplum-db-6.25.2/bin/gp_email_contacts.yaml nor /home/gpadmin/gp_email_contacts.yaml
20240812:10:50:10 gpbackup:gpadmin:mdw:019583-[INFO]:-Email containing gpbackup report /data/backup/gpseg-1/backups/20240812/20240812104953/gpbackup_20240812104953_report will not be sent

Running gpcopy fails with:

# gpcopy --include-table db01.schema01.table01 --analyze --truncate --source-host 10.XX.XX.XX --source-port 5432 --source-user gpadmin --dest-host 10.YY.YY.YY --dest-port 5432 --dest-user gpadmin

20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-Starting copy 2.6.0...
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-Copy appname: gpcopy_202408121046_vdvnEoh34wfW7bjTtkJWTL
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-'gpcopy' --analyze --dest-host '10.YY.YY.YY' --dest-port '5432' --dest-user 'gpadmin' --include-table 'db01.schema01.table01' --source-host '10.XX.XX.XX' --source-port '5432' --source-user 'gpadmin' --truncate
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-Initializing gpcopy
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-Source cluster version: 6.25.2 build commit:2ca3d98b43958f23744aa2023f3d87c249cb481c
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-Destination cluster version: 6.25.2 build commit:2ca3d98b43958f23744aa2023f3d87c249cb481c
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-pg_dump (PostgreSQL) 9.4.26
20240812:10:46:36 gpcopy:gpadmin:mdw:017417-[INFO]:-pg_dumpall (PostgreSQL) 9.4.26
20240812:10:46:53 gpcopy:gpadmin:mdw:017417-[INFO]:-Start copying database "db01"
20240812:10:46:53 gpcopy:gpadmin:mdw:017417-[INFO]:-[Worker 1] Start copying table "db01"."schema01"."table01" => "db01"."schema01"."table01"
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[ERROR]:-[Worker 1] Finished task 512678_DL_P_DA_V_ with error:
 failed to dump metadata from 10.XX.XX.XX:5432.
 Command:
 pg_dump --gp-syntax -h 10.XX.XX.XX -p 5432 -U gpadmin -s -O -x -t '"schema01"."table01"' 'db01'
Error:
 pg_dump: schema with OID 7460683 does not exist
: exit status 1
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[ERROR]:-[Worker 1] [Progress: (0/1) DBs, (1/1) tables done] Failed to copy table "db01"."schema01"."table01" => "db01"."schema01"."table01"
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[ERROR]:-[Worker 0] Finished task 512678_A_ with error:
 failed to dump metadata from 10.XX.XX.XX:5432.
 Command:
 pg_dump --gp-syntax -h 10.XX.XX.XX -p 5432 -U gpadmin -s -O -x -t '"schema01"."table01"' 'db01'
Error:
 pg_dump: schema with OID 7460683 does not exist
: exit status 1
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-[db01] Finished copying database "Progress: (1/1) DBs, (1/1) tables done"
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-------------------------------------------------
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-Total elapsed time: 25.40578728s
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-Total transferred data 0B, transfer rate 0B/h
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-Copied 1 databases
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-        Database db01: successfully copied 0 tables, skipped 0 tables, failed 1 tables
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-          Failed tables list:
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-            "db01"."schema01"."table01"
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-Successful table list will be saved into '/home/gpadmin/gpAdminLogs/gpcopy_202408121046_vdvnEoh34wfW7bjTtkJWTL_success.list'.
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-Failed table list will be saved into '/home/gpadmin/gpAdminLogs/gpcopy_202408121046_vdvnEoh34wfW7bjTtkJWTL_failure.list'.
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-[Hint] You could re-run with below command excludes successfully copied tables at last time:
20240812:10:47:01 gpcopy:gpadmin:mdw:017417-[INFO]:-        'gpcopy' --analyze --dest-host '10.YY.YY.YY' --dest-port '5432' --dest-user 'gpadmin' --include-table 'db01.schema01.table01' --source-host '10.XX.XX.XX' --source-port '5432' --source-user 'gpadmin' --truncate --exclude-table-file '/home/gpadmin/gpAdminLogs/gpcopy_202408121046_vdvnEoh34wfW7bjTtkJWTL_success.list'

 

Cause

The cause of the failure is one or more catalog errors in the database.

Resolution

Run gpcheckcat utility, using KB How to run gpcheckcat on a Tanzu Greenplum Database

Resolve the issues reported by the utility and re-run the gpcopy or gpbackup utility.

Open a support ticket with Greenplum support on the Broadcom Support Portal if you need assistance to resolve the catalog issues.