Johannes,

In bacula 15.x the catalog format changed. It was necessary to run the
update_bacula_tables script. I assume you have probably already done this,
but I just
want to check.

See these release notes.
https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/releases

When you restored your catalog backup, what process did you follow?

After your server crash, did you have the original bacula configuration
files, or did you have to recreate them?

When you back up the catalog, are you using the catalog backup job that
came with your original configuration, or the catalog backup job that came
with bacula 15.x? Not sure if there is a difference, but maybe there is.

This suggests that the user running the backup might be lacking the SELECT
permission for table metaemail.
https://stackoverflow.com/questions/28106467/postgresql-pg-dump-fails-with-permission-denied#28108200

Is bacula running as user bacula? (default for bacula installations from
the bacula community repository, unsure how it is configured in bacula
obtained from the Ubuntu repositories). For bacula community sourced from
the community repos, user bacula is authenticated to postgres using peer
authentication, which means that the user which created the database
(bacula) is allowed to access it.

Did user bacula create the new database? What happens when your user runs
the bacula catalog dump commands specified in bacula-dir.conf?
What happens when the bacula user runs those commands?

I do see mention of a grant_bacula_permissions script in the release notes,
but they say it's for use om bacula installations <5.0, which is not your
case.

I'd take a manual dump of the database using pgdump before doing anything
that could change the database. Might need to be user postgres for that to
work. Look up syntax online for doing a dump of the DB. I don't have it
memorized. Think it was something like "pgdump bacula > dumpfile.sql".
Don't just run that command, that's only my vague memory.

Reminder: do not run bacula dir / sd as root.

Overall, I believe something probably went wrong when importing the
previous catalog. It's almost certainly fixable.

Also, be advised that bacula 15 upgraded the volume format from BB02 to
BB03. Bacula 15 can read either type of volume. Bacula <15 cannot read BB03
volumes. So, if you have substantial backup data in new volumes, going back
to 13.x is probably not going to work.

Sorry, I don't have any better suggestions at the moment. Hopefully someone
more knowledgeable than myself on this issue can assist.


Robert Gerber
402-237-8692
[email protected]

On Sat, Sep 6, 2025, 8:10 AM Johannes Becker <[email protected]> wrote:

> Hello,
>
> After a server crash I had to do a fresh install of bacula and went from
> version 13 to 15. OS is Ubuntu 24.04 LTS.
>
> After installing Bacula I used the scripts to update the dump that I did
> before. Now backup and restore work fine.
>
> However backing up the catalog generates the error:
>
> BeforeJob: pg_dump: error: query failed: ERROR:  permission denied for
> table metaemail
>
>
> When I look for this table in the database I can see:
>
> | schemaname         | tablename                | tableowner | tablespace
> | hasindexes | hasrules | hastriggers | rowsecurity |
> +--------------------+--------------------------+------------+------------+------------+----------+-------------+-------------+
>
>
> ... lots of stuff deleted...
>
> | public             | metaemail                | postgres |            |
> t          | f        | f           | f           |
>
> A search did not give me any hints were to search. Does anyone have an
> idea where this goes wrong?
>
>
> Johannes
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
>
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to