Brian, Thanks for messaging again. Your issue had slipped my mind. Do you have a restored catalog backup from before your current trouble? If you have a catalog backup from before the trouble and after your most recent successful jobs, but haven't restored it yet, please attempt a restore. You should get a bacula.sql file. Next, please take a catalog dump directly using postgres pg_dump. The database might be in a bad state, but we want to back it up anyway.
You can skip the catalog backup/restores if this system isn't in production and you don't care about the backups taken so far. I do see jobid 48, which implies maybe it's a newish install. Next, I don't know what caused your trouble, but I have an idea that could fix this. Overall, my suggestion is to back up your configuration, logs, and catalog, then uninstall bacula and postgres, and reinstall it from the bacula community provided repos. I don't know if this is the best approach. *I STRONGLY advise you to test in a VM before proceeding.* My theory is that if you have a valid catalog backup, and you install bacula and its requested version of postgres fresh, maybe we can fix this problem. Maybe someone else knows what is wrong with the database and how to fix it. One caveat: the community repo doesn't have an entry for Debian 13 for bacula 15.0.3. You have to use the entry for Debian 12. Also, Debian 13 disabled using SHA1 signatures by default, and the current community repo uses SHA1 signatures. So you either need to disable signature checking for the repo, or enable SHA1 signatures system-wide (or upgrade to the Bacula 17 beta, which supposedly is signed with something more recent that SHA1). At minimum I would want to save copies of your bacula-sd.conf, bacula-dir.conf, and bacula-fd.conf files, + the bacula.log file. If you had installed bacula from the community repo, the conf files would be in /opt/bacula/etc and the log would be in /opt/bacula/log. I don't know where debian puts them, but I suspect it's different. I would also restore a copy of your most recent database backup. If you cannot restore due to bacula errors, I would attempt using bls / bextract to restore before proceeding. I would also take a dump of your catalog in its current state before proceeding any further using 'sudo -u postgres pg_dump bacula > /location/of/bacula.sql' Again, I would advise you to test all of this in a VM with snapshot capability before applying it to your system. Go incrementally, snapshot as you reach milestones, and revert if something goes wrong. I have used virtualbox to great effect for this sort of work in the past. I believe the current installer for virtualbox gives errors about pything if you take the default options when installing (under windows, anyhow). I think you can work around this by unchecking the option to install python network interface management capability. Regards, Robert Gerber 402-237-8692 [email protected] On Tue, Nov 10, 2026 at 10:50 AM Brian <[email protected]> wrote: > (I've been having some trouble with my outbound e-mail; please excuse if > this is a repost) > > Hello, > > This past weekend I upgraded a Debian 12 server to Debian 13 with > `apt-get full-upgrade`. There were errors involving upgrading > postgresql and bacula, seemingly because dpkg tried to configure > packages in the wrong order. A few iterations eventually led to no > further errors from apt-get or dpkg. > > I had to manually run the update_postgres_tables script, and that > required modding the script to correct for the fact that bash will > convert "$$" into the current PID, breaking psql if-blocks. > > Bacula no longer complains about database versions (found 1019, want > 1026, etc), but now all my backup jobs fail at the end with the > following log message: > > JobId 48: Fatal error: backup.c:343 [DE0028] Query failed: DECLARE > _bac_cursor CURSOR FOR SELECT Path, Filename, FileIndex, JobId, LStat, > DeltaSeq , JobTDate FROM ((SELECT Path.Path, T1.Filename, > T1.FileIndex, T1.JobId, LStat, DeltaSeq , JobTDate FROM ( SELECT > DISTINCT ON (Filename, PathId) JobTDate, JobId, FileId, FileIndex, > PathId, Filename, LStat , DeltaSeq FROM (SELECT FileId, JobId, > PathId, Filename, FileIndex, LStat , DeltaSeq FROM File WHERE JobId > IN (1,23) UNION ALL SELECT File.FileId, File.JobId, PathId, Filename, > File.FileIndex, LStat , DeltaSeq FROM BaseFiles JOIN File USING > (FileId) WHERE BaseFiles.JobId IN (1,23) ) AS T JOIN Job USING (JobId) > ORDER BY Filename, PathId, JobTDate DESC ) AS T1 JOIN Path ON > (Path.PathId = T1.PathId) WHERE FileIndex > 0 ) ) AS U1 ORDER BY > JobTDate, FileIndex ASC: ERR=ERROR: column "filename" does not exist > LINE 1: ... , DeltaSeq FROM (SELECT FileId, JobId, PathId, Filename, ... > > Googling gives results that talk about fixing SQL files that don't exist > on my system and/or do not contain the quoted query. > > All tips on what to do next will be greatly appreciated. > > Bacula version 15.0.3 as packaged for Debian Trixie (13). > Postgresql version 13. > > Thanks, > -Brian > > > _______________________________________________ > 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
