upgrading 18.2 > 22.0, db upgrade error

42 views
Skip to first unread message

Seth Galitzer

unread,
Mar 10, 2023, 11:30:59 AM3/10/23
to bareos-users
Finally getting around to my upgrade, running the update_bareos_tables to patch the db and get this output and error:

Info: Updating bareos tables
Info: Upgrading database schema from version 2171 to 2192
BEGIN
ALTER TABLE
DROP INDEX
UPDATE 1
COMMIT
SET
ANALYZE
Info: Upgrading database schema from version 2192 to 2210
BEGIN
CREATE INDEX
UPDATE 1
DROP VIEW
DROP VIEW
CREATE VIEW
CREATE VIEW
COMMIT
SET
ANALYZE
ERROR:  syntax error at or near "AS"
LINE 1: ALTER SEQUENCE basefiles_baseid_seq AS BIGINT
                                            ^
Warning: WARNING: Failed to update sequence basefiles_baseid_seq
Info: Finished upgrading database to version 2210

I'm guessing the upgrade didn't actually finish, the script just dropped out prematurely. What do I need to do to get past this?

Using Postgres 9.2 on CentOS 7.

Thanks.
Seth

Seth Galitzer

unread,
Mar 10, 2023, 5:48:37 PM3/10/23
to bareos-users
First of all, I upgraded from 18.7, not 18.2, I typoed earlier.

After some digging, the problem I originally reported turns out to be a warning that can safely be ignored. In case anybody else comes across this, here's what's going on.

This sql statement is invoked in line 107 of the script /usr/lib/bareos/scripts/update_bareos_tables. The only command after this is to remove files in /tmp. Digging into the database and inspecting the sequence basefiles_baseid_seq shows that it is already of type BIGINT, which triggered the warning.

bareos=# \d basefiles_baseid_seq
     Sequence "public.basefiles_baseid_seq"
    Column     |  Type   |        Value        
---------------+---------+----------------------
 sequence_name | name    | basefiles_baseid_seq
 last_value    | bigint  | 1
 start_value   | bigint  | 1
 increment_by  | bigint  | 1
 max_value     | bigint  | 9223372036854775807
 min_value     | bigint  | 1
 cache_value   | bigint  | 1
 log_cnt       | bigint  | 0
 is_cycled     | boolean | f
 is_called     | boolean | f
Owned by: public.basefiles.baseid

Since it was only a warning, pgsql did not return an error, and the rest of the script completed successfully. Restarted the director daemon and it comes up fine, listing all of my completed jobs, which should indicate a happy database.

Upgrading all my clients went fine without any problems.

Seth
Reply all
Reply to author
Forward
0 new messages