apache / apache/cloudberry

[Bug] gprestore report : -ERROR: schema "gp_toolkit" does not exist (SQLSTATE 3F000)

Open
#681 7 comments 0 reactions 1 assignee Claimed by @Terry1504 View on GitHub
type: Bug
Dominant language
C
Stars
1.4k
Forks
247
Avg merge
4d 3h
Merged PRs (30d)
39

Description

### Cloudberry Database version

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 14.4 (Cloudberry Database 1.6.0 build 1) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22), 64-bit compiled on Sep 3 2024 07:22:14
(1 row)

### What happened

System can not use gprestore to restore database. The case is descripted as below:
**Step 1: gpbackup --dbname cloudberry**

```
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-gpbackup version = 1.6.0
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Cloudberry Database Version = oudberry Database 1.6.0 build 1
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Starting backup of database cloudberry
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Backup Timestamp = 20241018100852
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Backup Database = cloudberry
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Gathering table state information
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Acquiring ACCESS SHARE locks on tables
Locks acquired: 6 / 6 [================================================================] 100.00% 0s
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Gathering additional table metadata
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Getting storage information
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Metadata will be written to /data/coordinator/gpseg-1/backups/20241018/20241018100852/gpbackup_20241018100852_metadata.sql
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Writing global database metadata
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Global database metadata backup complete
20241018:10:08:52 gpbackup:gpadmin:apm:045737-[INFO]:-Writing pre-data metadata
20241018:10:08:53 gpbackup:gpadmin:apm:045737-[INFO]:-Pre-data metadata metadata backup complete
20241018:10:08:53 gpbackup:gpadmin:apm:045737-[INFO]:-Writing post-data metadata
20241018:10:08:53 gpbackup:gpadmin:apm:045737-[INFO]:-Post-data metadata backup complete
20241018:10:08:53 gpbackup:gpadmin:apm:045737-[INFO]:-Writing data to file
Tables backed up: 3 / 3 [==============================================================] 100.00% 3s
20241018:10:08:56 gpbackup:gpadmin:apm:045737-[INFO]:-Data backup complete
20241018:10:08:57 gpbackup:gpadmin:apm:045737-[INFO]:-/usr/local/cloudberry-db-1.6.0/bin/gp_email_contacts.yaml list found, /data/coordinator/gpseg-1/backups/20241018/20241018100852/gpbackup_20241018100852_report will be sent
20241018:10:08:57 gpbackup:gpadmin:apm:045737-[WARNING]:-Unable to send email report: Error reading email contacts file.
20241018:10:08:57 gpbackup:gpadmin:apm:045737-[WARNING]:-Please ensure that the email contacts file is in valid YAML format.
20241018:10:08:57 gpbackup:gpadmin:apm:045737-[INFO]:-Backup completed
```
**Step 2: dropdb cloudberry**
```
Step3: gprestore --timestamp 20241018100852 --create-db
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-Restore Key = 20241018100852
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-gpbackup version = 1.6.0
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-gprestore version = 1.6.0
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-Database Version = oudberry Database 1.6.0 build 1
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-Creating database
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-Database creation complete for: cloudberry
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-Restoring pre-data metadata
Pre-data objects restored: 0 / 17 [-------------------------------------------------------] 0.00%20241018:10:12:39 gprestore:gpadmin:apm:046007-[WARNING]:-Schema pg_ext_aux already exists

20241018:10:12:39 gprestore:gpadmin:apm:046007-[CRITICAL]:-**ERROR: schema "gp_toolkit" does not exist (SQLSTATE 3F000)**
20241018:10:12:39 gprestore:gpadmin:apm:046007-[INFO]:-/usr/local/cloudberry-db-1.6.0/bin/gp_email_contacts.yaml list found, /data/coordinator/gpseg-1/backups/20241018/20241018100852/gprestore_20241018100852_20241018101239_report will be sent
20241018:10:12:39 gprestore:gpadmin:apm:046007-[WARNING]:-Unable to send email report: Error reading email contacts file.
20241018:10:12:39 gprestore:gpadmin:apm:046007-[WARNING]:-Please ensure that the email contacts file is in valid YAML format.
```

Why and how to resolve it?

### What you think should happen instead

Since I use gpbackup and gprestore as user manual, It shall be able to restore the backed database normally.
But it seems that gprestore can not create system schema "gp_toolkit"!

### How to reproduce

As descripted in "What happen" section.

### Operating System

Rocky Linux release 8.10 (Green Obsidian)

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes, I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://cloudberrydb.org/community/coc).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.