My guess is that during the migration from MySQL to Postgres, the sequences in Bacula did not get seeded right and probably are starting with a seed value of 1.
the filesetid field in the fileset table is automatically populated by the fileset_filesetid_seq sequence. Run the following two queries and see what the results are - in particular, see what the last_value is for the sequence. This should be equal to the max value from the fileset table which it is in my Bacula database. If not, you'll need to manually fix it via a sql update command to the sequence. select max(filesetid) from fileset; select * from fileset_filesetid_seq; hope this helps, --tom > Hello, > > I've tried to switch a bacula configuration that has been running for > years using from MySQL to PostgreSQL. Everything worked apparently > fine (I did the same before with two other instalations, where the > very same steps worked, too), but when trying to run jobs in the new > PostgreSQL environment, some jobs fail with errors like this: > > 13-Jan 22:13 XXX-dir JobId 1: Error: sql_create.c:741 Create DB FileSet > record INSERT INTO FileSet (FileSet,MD5,CreateTime) VALUES ('YYY > root','zD/PtXx6xx/IEHZH8X5OJB','2014-01-13 22:13:59') failed. ERR=ERROR: > duplicate key value violates unique constraint "fileset_pkey" > DETAIL: Key (filesetid)=(1) already exists. > > 13-Jan 22:13 XXX-dir JobId 1: Error: Could not create FileSet "YYY root" > record. ERR=sql_create.c:741 Create DB FileSet record INSERT INTO FileSet > (FileSet,MD5,CreateTime) VALUES ('YYY > root','zD/PtXx6xx/IEHZH8X5OJB','2014-01-13 22:13:59') failed. ERR=ERROR: > duplicate key value violates unique constraint "fileset_pkey" > DETAIL: Key (filesetid)=(1) already exists. > > > Not all jobs are faliling like this, only some. > > > Is there a way to check the DB for consistence (or, even better, to repair > it)? > > What could cause such issues, and what could be done to fix these? > > > > I don;t know if it's related, but maybe I should note that in the old > setup (with a MySQL DB) I had occasionally jobs failing with errors > like this: > > 30-Dec 00:05 XXX-dir JobId 70535: Start Backup JobId 70535, > Job=AAA-Root.2013-12-30_00.05.02_02 > 30-Dec 00:05 XXX-dir JobId 70535: Using Device "LTO3-1" to write. > 30-Dec 00:19 ZZZ-sd JobId 70535: Fatal error: askdir.c:340 NULL Volume name. > This shouldn't happen!!! > 30-Dec 00:19 ZZZ-sd JobId 70535: Spooling data ... > 30-Dec 00:06 AAA-fd JobId 70535: /work is a different filesystem. Will > not descend from / into it. > 30-Dec 00:21 ZZZ-sd JobId 70535: Elapsed time=00:01:13, Transfer rate=0 > Bytes/second > 30-Dec 00:06 AAA-fd JobId 70535: Error: bsock.c:429 Write error sending 8 > bytes to Storage daemon:ZZZ:9103: ERR=Connection reset by peer > 30-Dec 00:06 AAA-fd JobId 70535: Fatal error: xattr.c:98 Network send error > to SD. ERR=Connection reset by peer > > Out of 30+ jobs running each night, only one would fail about once > per week, and this was one out of 2 candidates - all others never > showed any such problem. I have been wondering if there was some DB > issue for these jobs, which is one of the reasons for switching to > PostgreSQL. But maybe this is totally unrelated... > > > Any help welcome. Thanks in advance. > > Best regards, > > Wolfgang Denk > ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users