All of my Bacula backups started failing over the weekend with the following MySQL error:
Fatal error: sql_create.c:XXX Fill File table Query failed: INSERT INTO File (FileIndex, JobId, PathId, FilenameId, LStat, MD5)SELECT batch.FileIndex, batch.JobId, Path.PathId, Filename.FilenameId,batch.LStat, batch.MD5 FROM batch JOIN Path ON (batch.Path = Path.Path) JOIN Filename ON (batch.Name = Filename.Name): ERR=Duplicate entry '375086058' for key 'PRIMARY'
It was fairly sudden: it seems to have happened between 3.05am and 3.11am this morning with no other hints as to what happen.
A quick look at the database agrees that 375086058 is the highest numbered FileId field (which is the Primary Index for the File Table), but I don't know what to do to fix it without corrupting my Bacula database.
Any ideas?