Bacula catalog service uses a database back-end to keep tack of the backup jobs by storing such information as names of archived files, their locations, dates and clients. When you are backing up the catalog, you are essentially saving a copy of the database.
The catalog backup job invokes a Bacula script which uses an external tool specific to the back-end to dump the entire database. Lack of proper access permissions for the user could result in the failure of the tool, the script and ultimately the backup job.
I came across this issue recently when backing up the catalog following a PostgreSQL server upgrade. Below are the main parts of error messages as observed on bconsole and in bacula.log. Note that, in case of PostgreSQL, the backup tool is pg_dump.
pg_dump: [archiver (db)] query failed: ERROR: permission denied for relation snapshot pg_dump: [archiver (db)] query was: LOCK TABLE public.snapshot IN ACCESS SHARE MODE
Modify and run the Bacula grant_postgresql_privileges script. On my Debian system, the script is located at:
There are three parameters to be changed:
db_user=<bacula_db_user> db_name=<bacula_db_name> db_password=<bacula_db_password>
The script asks for your PostgreSQL user password when you run it.
Date: July 2016 Operating System: Debian Testing (Stretch) Bacula: bacula-director-pgsql 7.4.1~dfsg-1 PostgreSQL: postgresql-9.4 9.4.5-2