I inspected the contents of the database and here is the output:

For the list of tables:

               List of relations
 Schema |        Name        | Type  |  Owner
--------+--------------------+-------+----------
 public | basefiles          | table | postgres
 public | client             | table | postgres
 public | counters           | table | postgres
 public | device             | table | postgres
 public | devicestats        | table | postgres
 public | file               | table | postgres
 public | filename           | table | postgres
 public | fileset            | table | postgres
 public | job                | table | postgres
 public | jobhisto           | table | postgres
 public | jobmedia           | table | postgres
 public | jobstats           | table | postgres
 public | location           | table | postgres
 public | locationlog        | table | postgres
 public | log                | table | postgres
 public | media              | table | postgres
 public | mediatype          | table | postgres
 public | ndmpjobenvironment | table | postgres
 public | ndmplevelmap       | table | postgres
 public | path               | table | postgres
 public | pathhierarchy      | table | postgres
 public | pathvisibility     | table | postgres
 public | pool               | table | postgres
 public | quota              | table | postgres
 public | restoreobject      | table | postgres
 public | status             | table | postgres
 public | storage            | table | postgres
 public | tapealerts         | table | postgres
 public | unsavedfiles       | table | postgres
 public | version            | table | postgres
(30 rows)

For the structure of the fileset table:

                                                             Table
"public.fileset"
   Column   |            Type             |
Modifiers                          | Storage  | Stats target | Description
------------+-----------------------------+-------------------------------------------------------------+----------+--------------+-------------
 filesetid  | integer                     | not null default
nextval('fileset_filesetid_seq'::regclass) | plain    |              |
 fileset    | text                        | not
null                                                    | extended
|              |
 md5        | text                        | not
null                                                    | extended
|              |
 createtime | timestamp without time zone | not
null                                                    | plain
|              |
Indexes:
    "fileset_pkey" PRIMARY KEY, btree (filesetid)
    "fileset_name_idx" btree (fileset)

Everything looks fine except for FileSetText not existing.

Thanks,
oldtechaa

On Fri, Nov 24, 2017 at 10:20 AM, Joerg Steffens <[email protected]>
wrote:

> Hi,
>
> please answer to bareos-users, in case, other people have similar problems.
>
> I guess, you have to check, how your database looks like.
>
> psql
> \dt
> \d+ fileset
>
> regards,
> Jörg
>
>
> On 24.11.2017 at 16:06 wrote oldtechaa:
> > Thanks Jorg,
> >
> > I updated previously manually using psql (I believe). To try reapplying
> > the update today, I used the Bareos scripts. I just tried applying this
> > as follows:
> >
> > su - bareos -s /bin/sh
> > psql
> > ALTER TABLE FileSet ADD COLUMN FileSetText TEXT DEFAULT ''
> > COMMIT
> > \q
> > exit
> > systemctl restart bareos-dir postgresql
> > bconsole
> > run
> >
> > I still receive the same error. Please let me know what you think.
> >
> > Thank you,
> > oldtechaa
> >
> > On Fri, Nov 24, 2017 at 9:50 AM, Jörg Steffens
> > <[email protected] <mailto:[email protected]>> wrote:
> >
> >     On 24.11.2017 at 15:06 wrote [email protected]
> >     <mailto:[email protected]>:
> >     > Hello everyone,
> >     >
> >     > I am getting the error in the subject line when running a job with
> >     a changed fileset.
> >     >
> >     > This is Bareos 16.2.4 running on Debian 9 "Stretch". When Stretch
> >     was released, I upgraded from the existing configuration of Debian 8
> >     "Jessie". Since I am using the Debian Bareos packages, this upgraded
> >     Bareos from 14.2 to 16.2.4. I did not check the release notes (my
> >     mistake, I know) and did not update the database scheme as I should
> >     have. I manually updated the database scheme version to 2004.
> >     >
> >     > I have not since had a reason to update the FileSet until
> >     yesterday. I updated a FileSet and tried to run a job. The job fails
> >     with the error below:
> >     >
> >     >
> >     > 24-Nov 08:49 backup-dir JobId 908: Error: sql_create.c:791 Create
> >     DB FileSet record INSERT INTO FileSet
> >     (FileSet,MD5,CreateTime,FileSetText) VALUES
> >     ('Clients','j+/9T+NcNR/U67/H5j/v6A','2017-11-24 08:49:30','FileSet {
> >     >   Name = "Clients"
> >     >   Include {
> >     >     Options {
> >     >       Signature = MD5
> >     >       IgnoreCase = Yes
> >     >       Drive Type = "fixed"
> >     >     }
> >     >     File = "C:/Users/"
> >     >   }
> >     > }
> >     >
> >     > ') failed. ERR=ERROR:  column "filesettext" of relation "fileset"
> >     does not exist
> >     > LINE 1: INSERT INTO FileSet (FileSet,MD5,CreateTime,FileSetText)
> >     VAL...
> >     >                                                     ^
> >     >
> >     > 24-Nov 08:49 backup-dir JobId 908: Error: Could not create FileSet
> >     "Clients" record. ERR=
> >     >
> >     >
> >     > The job runs if I change the FileSet back to what it previously
> was.
> >     >
> >     > I assume this is because 15.2 added the FileSetText column in the
> >     database. I have now updated the database scheme, but the problem
> >     continues.
> >     >
> >     > Also, grant_bareos_privileges gives me this error, but appears to
> >     work correctly:
> >     >
> >     >
> >     > Granting postgresql tables
> >     > psql:/tmp/grants.sql.6698:1: ERROR:  role "bareos" already exists
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > GRANT
> >     > Privileges for user bareos granted ON database bareos.
> >     >
> >     >
> >     > So how can I fix this, recognizing that it probably is my fault?
> >
> >     Well, I don't know, how you did perform your database update. On
> Debian,
> >     dbconfig should take care of this automatically (unless you disabled
> >     it).
> >
> >     This change has been introduced on the schema update from version
> 2003
> >     to 2004 and luckily for you, it is the only change that have been
> made
> >     there.
> >
> >     You see the change in the file
> >     /usr/lib/bareos/scripts/ddl/updates/postgresql.2003_2004.sql:
> >
> >     BEGIN; -- Necessary for Bareos core
> >
> >     ALTER TABLE FileSet ADD COLUMN FileSetText TEXT DEFAULT '';
> >     UPDATE Version SET VersionId = 2004;
> >     COMMIT;
> >
> >     set client_min_messages = fatal;
> >
> >     ANALYSE;
> >
> >
> >     You only need to apply the statment
> >     ALTER TABLE FileSet ADD COLUMN FileSetText TEXT DEFAULT ''
> >
> >     # switch user to "bareos"
> >     su - bareos -s /bin/bash
> >     psql
> >
> >     # enter the relevant line
> >
> >
> >     regards,
> >     Jörg
> >
> >
> >     --
> >      Jörg Steffens                   [email protected]
> >     <mailto:[email protected]>
> >      Bareos GmbH & Co. KG            Phone: +49 221 630693-91
> >     <tel:%2B49%20221%20630693-91>
> >      http://www.bareos.com           Fax:   +49 221 630693-10
> >     <tel:%2B49%20221%20630693-10>
> >
> >      Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
> >      Komplementär: Bareos Verwaltungs-GmbH
> >      Geschäftsführer:
> >      S. Dühr, M. Außendorf, Jörg Steffens, P. Storz
> >
> >     --
> >     You received this message because you are subscribed to a topic in
> >     the Google Groups "bareos-users" group.
> >     To unsubscribe from this topic, visit
> >     https://groups.google.com/d/topic/bareos-users/5LEeq_-
> gWu0/unsubscribe
> >     <https://groups.google.com/d/topic/bareos-users/5LEeq_-
> gWu0/unsubscribe>.
> >     To unsubscribe from this group and all its topics, send an email to
> >     [email protected]
> >     <mailto:bareos-users%[email protected]>.
> >     To post to this group, send email to [email protected]
> >     <mailto:[email protected]>.
> >     For more options, visit https://groups.google.com/d/optout
> >     <https://groups.google.com/d/optout>.
> >
> >
>
>
> --
>  Jörg Steffens                   [email protected]
>  Bareos GmbH & Co. KG            Phone: +49 221 630693-91
>  http://www.bareos.com           Fax:   +49 221 630693-10
>
>  Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
>  Komplementär: Bareos Verwaltungs-GmbH
>  Geschäftsführer:
>  S. Dühr, M. Außendorf, Jörg Steffens, P. Storz
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to