Bacula-users

Re: [Bacula-users] Jobs fail with "duplicate key value violates unique constraint" after upgrade to 7.0.5

2015-07-05 08:02:24
Subject: Re: [Bacula-users] Jobs fail with "duplicate key value violates unique constraint" after upgrade to 7.0.5
From: Kern Sibbald <kern AT sibbald DOT com>
To: Christian Manal <moenoel AT informatik.uni-bremen DOT de>, Bacula-users AT lists.sourceforge DOT net
Date: Sun, 05 Jul 2015 14:00:29 +0200
Hello,

It appears to me that for some reason you have duplicate filename
entries in the Filename table.  Perhaps you have a filename of NULL and
a filename of "", which perhaps PostgreSQL treats as equal in certain
operations (e.g. during an import).

The Bacula SQL statement is supposed to filter out duplicate names.  You
might list the Filename table and take a look if there are two entries
that seem to be identical (it seems like you already tried this). 
Another possibility for correcting it is to run the dbcheck program.  I
think it has an option to check for duplicate filenames, but I am not
100% certain since I have not used it in a long time.

Did you recently change the backend from MySQL to PostgreSQL or make
some other such modification or did your OS crash or PostgreSQL crash? 
Normally, the table should never get messed up as it appears to be.

Since reindexing the Filename table fails, most likely you really have
an PostgreSQL table corruption problem that probably can only be fixed
by some PostgreSQL repair command.

Best regards,
Kern

On 05.07.2015 12:43, Christian Manal wrote:
> Hi list,
>
> I recently upgraded my Bacula director and storage to 7.0.5 from 5.2.x
> and now some jobs fail with the following error:
>
> Fatal error: sql_create.c:851 Fill Filename table Query failed: INSERT
> INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM
> batch) as a WHERE NOT EXISTS (SELECT Name FROM Filename WHERE Name =
> a.Name): ERR=ERROR:  duplicate key value violates unique constraint
> "filename_name_idx"
>
> Platform is Solaris 10, database PostgreSQL 9.3.
>
> I tried reindexing the Filename table, which fails with a similar error,
> yet when I query the table for duplicate entries, I can't find any.
>
>
> Any help with this issue would be appreciated.
>
>
> Regards,
> Christian Manal
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users