It ended up being an inconsistency with the table.  Apparently, 345 had
already been assigned, but not yet written to the table (if I'm
understanding things correctly).  Checking the table resulted in this
output:


mysql> check table JobMedia;
+-----------------+-------+----------+--------------------------------------------------------+
| Table           | Op    | Msg_type | Msg_text
                      |
+-----------------+-------+----------+--------------------------------------------------------+
| bacula.JobMedia | check | warning  | 1 clients is using or hasn't
|                 |       |          | closed the table properly
| bacula.JobMedia | check | warning  | Size of datafile is: 14145
|                 |       |          | Should be: 14104
| bacula.JobMedia | check | error    | Found 345 keys of 344
                      |
| bacula.JobMedia | check | error    | Corrupt
                      |
+-----------------+-------+----------+--------------------------------------------------------+
4 rows in set (0.01 sec)


So the repair was:

mysql> repair table JobMedia;
+-----------------+--------+----------+----------------------------------------+
| Table           | Op     | Msg_type | Msg_text
       |
+-----------------+--------+----------+----------------------------------------+
| bacula.JobMedia | repair | warning  | Number of rows changed from 344
|                 |        |          | to 345
| bacula.JobMedia | repair | status   | OK
       |
+-----------------+--------+----------+----------------------------------------+
2 rows in set (0.02 sec)

I don't know why this showed up, but my guess is that it was something I
did, perhaps rebooting the system at the wrong time, or killing Bacula.

Thanks for the help.

--Brennon

Michael Joyner wrote:
> Hello MySQL 4.x user (I strongly suspect), do a search for
> 
>             Help! "Duplicate entry" dbcheck doesn't fix it?!?
> 
> in the subject line, it is a very recent thread.
> 
> End result: I dropped the indexes on two DB columns to eliminate the
> error. It seems to be MySQL specific.
> 
> Just curious. Are you by chance running SuSE 9.x and using the
> pre-packaged bacula-mysql via apt-get ?
> 
> Brennon Church wrote:
> 
>> Hello all,
>>
>> I'm getting some new error messages on my backups.  They just started
>> this morning.  Following is an example:
>>
>> 30-Mar 09:45 enki-dir: Start Backup JobId 43,
>> Job=enki.2005-03-30_09.45.00
>> 30-Mar 09:45 enki-dir: Recycled volume "Inc-0003"
>> 30-Mar 09:45 enki-sd: Recycled volume "Inc-0003" on device
>> "/export/home/bacula", all previous data lost.
>> 30-Mar 09:45 enki-sd: Spooling data ...
>> 30-Mar 09:47 enki-sd: Committing spooled data to Volume. Despooling
>> 117,801,577 bytes ...
>> 30-Mar 09:47 enki-dir: enki.2005-03-30_09.45.00 Fatal error:
>> sql_create.c:132 sql_create.c:132 insert INSERT INTO JobMedia
>> (JobId,MediaId,FirstIndex,LastIndex,StartFile,EndFile,StartBlock,EndBlock,VolIndex)
>>
>> VALUES (43,20,1,213,0,0,201,117734571,345) failed:
>> Duplicate entry '345' for key 1
>> 30-Mar 09:47 enki-dir: enki.2005-03-30_09.45.00 Error: Catalog error
>> creating JobMedia record. sql_create.c:134 Create JobMedia record INSERT
>> INTO JobMedia
>> (JobId,MediaId,FirstIndex,LastIndex,StartFile,EndFile,StartBlock,EndBlock,VolIndex)
>>
>> VALUES (43,20,1,213,0,0,201,117734571,345) failed: ERR=Duplicate entry
>> '345' for key 1
>> 30-Mar 09:47 enki-sd: enki.2005-03-30_09.45.00 Fatal error: Error
>> creating JobMedia record: 1991 Update JobMedia error
>>
>> 30-Mar 09:47 enki-sd: enki.2005-03-30_09.45.00 Fatal error: Could not
>> create JobMedia record for Volume="Inc-0003" Job=enki.2005-03-30_09.45.00
>> 30-Mar 09:47 enki-dir: Max Volume jobs exceeded. Marking Volume
>> "Inc-0003" as Used.
>> 30-Mar 09:47 enki-sd: Sending spooled attrs to the Director. Despooling
>> 42,590 bytes ...
>> 30-Mar 09:47 enki-fd: enki.2005-03-30_09.45.00 Fatal error: Bad status
>> 102 returned from Storage Daemon.
>> 30-Mar 09:47 enki-dir: enki.2005-03-30_09.45.00 Error: Bacula 1.36.2
>> (28Feb05): 30-Mar-2005 09:47:05
>>
>> It seems to me that this is saying that there is some issue with a
>> database entry.  I could probably go in and delete the entry manually,
>> but I'm not sure that doing so would be appropriate.
>>
>> Has anyone had this happen before?  Or can anyone point me to what might
>> have caused this?
>>
>> I'm running Bacula version 1.36.2.
>>
>> Thanks for any help you can provide.
>>
>> --Brennon
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by Demarc:
>> A global provider of Threat Management Solutions.
>> Download our HomeAdmin security software for free today!
>> http://www.demarc.com/info/Sentarus/hamr30
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by Demarc:
> A global provider of Threat Management Solutions.
> Download our HomeAdmin security software for free today!
> http://www.demarc.com/Info/Sentarus/hamr30



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to