GPbackup failing with, Unable to update history database.  Error: database is locked
search cancel

GPbackup failing with, Unable to update history database.  Error: database is locked

book

Article ID: 394728

calendar_today

Updated On:

Products

VMware Tanzu Greenplum VMware Tanzu Data Suite VMware Tanzu Data Suite

Issue/Introduction

Intermittent critical errors that stop the backup, in the gpbackup log while using gpbackup version 1.30


20250406:04:31:29 gpbackup:gpadmin:cdw:2372759-[CRITICAL]:-database is locked
20250406:04:31:42 gpbackup:gpadmin:cdw:2328385-[ERROR]:-Unable to update history database.  Error: database is locked


Cause

 A new procedure for logging database history for gpbackup_manager was introduced in gpbackup version 1.28.0. This introduced a new  SQLite database $MASTER_DATA_DIRECTORY/gpbackup_history.db instead of the JSON file that had been used. 

It seems that running more than two concurrent backups can lock this database resulting with the error "Unable to update history database.  Error: database is locked"

Resolution

Workaround

  • Limit concurrent gpbackup to only 1 or 2 running at a time.

or

  • Use `--no-history` to skip writing gpbackup history.

 

Fix

The permanent fix will be to increase the timeout waiting for a lock on the SQLite DB file from 5 seconds to 60 seconds. 

As of April 2025, the fix with be included in the next version of gpbackup code.

Additional Information

This will be in the Release Note of the fixed version:

Increase gpbackup history sqlitedb timeouts from 5 seconds to 60 seconds. This will help users when running multiple gpbackups writing to slow storage.