Hello,

It looks to me like MySQL 4.0 has changed the way they deal with indexing and 
keys since version 3.23.51.  It appears as if they are using *only* the index 
to decide if the key is unique or not. The index was setup on the first 50 
characters of the path. Previously, the index was used for indexing only and 
not to determine uniqueness.

Did you recently upgrade to MySQL 4.0?  The solution I can see is to drop the 
index on Path and the index on Filename, then recreate them but create them 
on the full Path and the full Name rather than limiting it as is currently 
the case in the make_mysql_tables file.

On Sunday 20 March 2005 20:11, Michael Joyner wrote:
> Hi!
>
> I am getting the following errors on backup.
> Using bacula-mysql for SuSE 9.1
> I ran the dbcheck, and all it does is delete "orphaned" files and
> insists there are no duplicate records anywhere.
> So now what do I do?
>
> ========================
> =====ENVIRONMENT========
> ========================
>
> office:~ # uname -a
> Linux office 2.6.5-7.135-smp #1 SMP Wed Dec 15 21:30:01 UTC 2004 i686
> i686 i386 GNU/Linux
> office:~ #
>
> office:~ # rpm -qa | grep bacula
> rpmkey-bacula-0.1-2
> bacula-mysql-1.36.2-1
> bacula-bimagemgr-1.36.1-1
> office:~ #
>
> office:~ # rpm -qa | grep sql
> postgresql-libs-7.4.2-36.3
> mysql-client-4.0.18-32
> mysql-4.0.18-32.9
> bacula-mysql-1.36.2-1
> mysql-shared-4.0.18-32.1
> perl-DBD-mysql-2.9003-22
> office:~ #
>
> =============================
> =====Mysql Table Defs========
> =============================
> mysql> show databases;
> +----------+
>
> | Database |
>
> +----------+
>
> | bacula   |
> | mysql    |
> | test     |
>
> +----------+
> 3 rows in set (0.03 sec)
>
> mysql> use bacula;
> Database changed
> mysql> show tables;
> +------------------+
>
> | Tables_in_bacula |
>
> +------------------+
>
> | BaseFiles        |
> | CDImages         |
> | Client           |
> | Counters         |
> | File             |
> | FileSet          |
> | Filename         |
> | Job              |
> | JobMedia         |
> | Media            |
> | Path             |
> | Pool             |
> | UnsavedFiles     |
> | Version          |
>
> +------------------+
> 14 rows in set (0.00 sec)
>
> mysql>
>
> mysql> Describe Path;
> +--------+------------------+------+-----+---------+----------------+
>
> | Field  | Type             | Null | Key | Default | Extra          |
>
> +--------+------------------+------+-----+---------+----------------+
>
> | PathId | int(10) unsigned |      | PRI | NULL    | auto_increment |
> | Path   | blob             |      | MUL |         |                |
>
> +--------+------------------+------+-----+---------+----------------+
> 2 rows in set (0.01 sec)
>
> mysql>
> mysql> select max(PathId) from Path;
> +-------------+
>
> | max(PathId) |
>
> +-------------+
>
> |       47945 |
>
> +-------------+
> 1 row in set (0.00 sec)
>
> mysql> select count(PathId) from Path;
> +---------------+
>
> | count(PathId) |
>
> +---------------+
>
> |         47933 |
>
> +---------------+
> 1 row in set (0.00 sec)
>
>
> mysql> select count(distinct(Path)) from Path;
> +-----------------------+
>
> | count(distinct(Path)) |
>
> +-----------------------+
>
> |                 47933 |
>
> +-----------------------+
> 1 row in set (5.83 sec)
>
> mysql> select count(Path) from Path;
> +-------------+
>
> | count(Path) |
>
> +-------------+
>
> |       47933 |
>
> +-------------+
> 1 row in set (0.00 sec)
>
> mysql>
>
>
> mysql> select PathId, Path from Path where Path like
> '%C:/WINDOWS/system32/config/systemprofile/Local Settings/Application
> Data/Microsoft/Windows NT/%';
> Empty set (0.12 sec)
>
> mysql>
> mysql> select PathId, Path from Path where Path like
> '%C:/WINDOWS/system32/config/systemprofile/Local Settings/Application
> Data/Microsoft/%';
> +--------+-----------------------------------------------------------------
>--------------------------------------+
>
> | PathId |
>
> Path
>
> +--------+-----------------------------------------------------------------
>--------------------------------------+
>
> |  17245 | C:/WINDOWS/system32/config/systemprofile/Local
>
> Settings/Application Data/Microsoft/Windows Media/9.0/ |
>
> |  17246 | C:/WINDOWS/system32/config/systemprofile/Local
>
> Settings/Application Data/Microsoft/Windows Media/     |
>
> |  17247 | C:/WINDOWS/system32/config/systemprofile/Local
>
> Settings/Application Data/Microsoft/                   |
> +--------+-----------------------------------------------------------------
>--------------------------------------+ 3 rows in set (0.12 sec)
>
> mysql>
> mysql> select PathId, Path from Path where Path=47946;
> Empty set (0.15 sec)
>
> mysql>
>
> mysql> select max(PathId) from Path;
> +-------------+
>
> | max(PathId) |
>
> +-------------+
>
> |       47945 |
>
> +-------------+
> 1 row in set (0.00 sec)
>
> mysql> select PathID, Path from Path where PathId=47945;
> +--------+--------------+
>
> | PathID | Path         |
>
> +--------+--------------+
>
> |  47945 | /lost+found/ |
>
> +--------+--------------+
> 1 row in set (0.01 sec)
>
> mysql> select PathID, Path from Path where PathId=47946;
> Empty set (0.00 sec)
>
> mysql>
>
> ===========================
> =====ERROR MESSAGES========
> ===========================
>
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Error: Catalog error updating MD5/SHA1. sql_update.c:65 Update problem:
> affected_rows=0
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Fatal error: sql_create.c:628 sql_create.c:628 insert INSERT INTO Path
> (Path) VALUES ('C:/WINDOWS/system32/config/systemprofile/Local
> Settings/Application Data/Microsoft/Windows NT/') failed:
> Duplicate entry '47946' for key 1
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Fatal error: sql_create.c:630 Create db Path record INSERT INTO Path
> (Path) VALUES ('C:/WINDOWS/system32/config/systemprofile/Local
> Settings/Application Data/Microsoft/Windows NT/') failed. ERR=Duplicate
> entry '47946' for key 1
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Fatal error: catreq.c:346 Attribute create error. sql_create.c:630
> Create db Path record INSERT INTO Path (Path) VALUES
> ('C:/WINDOWS/system32/config/systemprofile/Local Settings/Application
> Data/Microsoft/Windows NT/') failed. ERR=Duplicate entry '47946' for key 1
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Error: Catalog error updating MD5/SHA1. sql_update.c:65 Update problem:
> affected_rows=0
> 20-Mar 01:31 office.vbservices.net-dir: winserver.2005-03-20_01.05.08
> Error: Bacula 1.36.2 (28Feb05): 20-Mar-2005 01:31:38
>   JobId:                  138
>   Job:                    winserver.2005-03-20_01.05.08
>   Backup Level:           Differential, since=2005-03-13 01:07:50
>   Client:                 winserver
>   FileSet:                "C" 2005-03-12 18:05:47
>   Pool:                   "CDR"
>   Storage:                "File"
>   Start time:             20-Mar-2005 01:17:48
>   End time:               20-Mar-2005 01:31:38
>   FD Files Written:       17,286
>   SD Files Written:       17,286
>   FD Bytes Written:       400,581,881
>   SD Bytes Written:       404,461,244
>   Rate:                   482.6 KB/s
>   Software Compression:   53.7 %
>   Volume name(s):         CDR-2005-03-20-01-05-36|CDR-2005-03-20-01-19-11
>   Volume Session Id:      17
>   Volume Session Time:    1111093815
>   Last Volume Bytes:      394,113,455
>   Non-fatal FD errors:    22
>   SD Errors:              0
>   FD termination status:  OK
>   SD termination status:  OK
>   Termination:            *** Backup Error ***
>
>
>
> -------------------------------------------------------
> 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

-- 
Best regards,

Kern


-------------------------------------------------------
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