Bacula-users

Re: [Bacula-users] No Full backup before ${date} found (SOLVED)

2013-10-24 17:49:15
Subject: Re: [Bacula-users] No Full backup before ${date} found (SOLVED)
From: Bill Arlofski <waa-bacula AT revpol DOT com>
To: Bacula Users <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 24 Oct 2013 17:44:39 -0400
On 10/18/13 11:50, Bill Arlofski wrote:
> 
> I have an interesting issue that I am seeing on a few bacula servers which I
> manage.
> 
> When attempting to do a restore and choosing option 5:
> 
> 5: Select the most recent backup for a client
> 
> then the client is selected, then the fileset, I am presented with:
> 
> "No Full backup before 2013-10-18 11:40:14 found."
> 
> However, a "list jobs" shows a Full backup with subsequent incrementals and
> differentials following the full for the client.
> 
> 
> However, if I start a restore, and choose option 3:
> 
> 3: Enter list of comma separated JobIds to select
> 
> and enter the JobId of the last Full backup for the same client I am able to
> successfully restore any files I choose.
> 
> Because I can restore by specific JobId, I am pretty certain that there is
> nothing wrong with my Job, Files, Client, and Volume retention periods.
> 
> This happens for any/every client I choose.
> 
> Can anyone offer any insight to this issue? I'd really like to get to the
> bottom of this.
> 
> Using verison 5.2.13
> 
> Thanks!



Ok... I found the cause of this, and a solution, so I thought I would share.

When selecting restore, then option 5, "Select the most recent backup for a
client" the second built-in query submitted to the mysql db is:

--[snip]--
INSERT INTO temp1 SELECT Job.JobId,JobTdate FROM
Client,Job,JobMedia,Media,FileSet WHERE Client.ClientId=18 AND Job.ClientId=18
AND Job.StartTime < '2013-10-24 17:12:48' AND Level='F' AND JobStatus IN
('T','W') AND Type='B' AND JobMedia.JobId=Job.JobId AND Media.Enabled=1 AND
JobMedia.MediaId=Media.MediaId AND Job.FileSetId=FileSet.FileSetId AND
FileSet.FileSet='BaculaFullFileSet' ORDER BY Job.JobTDate DESC LIMIT 1
--[snip]--


The SELECT portion of this query returns zero rows. The reason?

"AND Media.Enabled=1"

>>From the following thread,

http://sourceforge.net/mailarchive/forum.php?thread_name=517064AE.2090809%40revpol.com&forum_name=bacula-users

I had written and shared that script to solve a problem, but the unintended
outcome was that I caused this restore problem.

I am using vchanger, and the script from the thread above DISABLES all volumes
not immediately available to Bacula, and enables only the file volumes on the
currently inserted vchanger magazine(s).

If I log into the mysql db, and issue:

UPDATE Media SET Enabled="1";

Then the built-in restore options work as expected.  This is an acceptible
work-around for me because restores are done very infrequently, and the script
to enable/disable available/not-availabe media is useful, and used daily. So
needing to issue one command to the db before a performing a restore is not to
worst thing in the world. :)



So, question for Kern and the devs:

Is the "AND Media.Enabled=1"  required in the built-in restore queries?

Could that be removed and instead, a separate check and warning be issued to
the operator if the media required for the restore is listed as disabled?

Thanks for any feedback!

-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users