variable expansion uses outdated data

Bug #459573 reported by Aidan Furlan
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bacula
Invalid
Undecided
Unassigned
bacula (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: bacula

I use "$Client-$Year-$Month-$Day" as my LabelFormat. Recently I tried to backup a server called ralph (this was a scheduled job). The Volume was created with the correct name but the job failed as the FileDaemon was not running, as below:

24-Oct 08:17 floyd-dir JobId 65: Created new Volume "ralph-fd-2009-10-24" in catalog.
24-Oct 08:17 floyd-dir JobId 65: Using Device "FileStorage"
24-Oct 08:17 floyd-dir JobId 65: Warning: bsock.c:123 Could not connect to Client: ralph-fd on 192.168.1.254:9102. ERR=Connection refused

The job eventually terminated itself. Subsequently I tried to run a job manually to backup a different server (benson) and got the following output:

24-Oct 13:43 floyd-dir JobId 66: No prior Full backup Job record found.
24-Oct 13:43 floyd-dir JobId 66: No prior or suitable Full backup found in catalog. Doing FULL backup.
24-Oct 13:43 floyd-dir JobId 66: Start Backup JobId 66, Job=benson.2009-10-24_13.43.03
24-Oct 13:43 floyd-dir JobId 66: Using Device "FileStorage"
24-Oct 13:43 floyd-sd JobId 66: Labeled new Volume "ralph-fd-2009-10-24" on device "FileStorage" (/bacula-volumes).
24-Oct 13:43 floyd-sd JobId 66: Wrote label to prelabeled Volume "ralph-fd-2009-10-24" on device "FileStorage" (/bacula-volumes)
24-Oct 13:43 floyd-dir JobId 66: Volume used once. Marking Volume "ralph-fd-2009-10-24" as Used.

Note that the Volume name is again "ralph-fd-2009-10-24". It should have been "benson-fd-2009-10-24". It looks like the variable expansion has retained the client name "ralph-fd" from the failed job. Either that or bacula is not trying to create a new volume at all, but instead reusing the volume created previously but not labelled or written to.

root@floyd:~# lsb_release -rd
Description: Ubuntu 8.04.3 LTS
Release: 8.04

root@floyd:~# apt-cache policy bacula
bacula:
  Installed: (none)
  Candidate: 2.2.8-5ubuntu7.2
  Version table:
     2.2.8-5ubuntu7.2 0
        500 http://mirror.internode.on.net hardy-updates/main Packages
     2.2.8-5ubuntu7 0
        500 http://mirror.internode.on.net hardy/main Packages

Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for your bug report. This bug has been reported to the developers of the software. You can track it and make comments at:

http://bugs.bacula.org/view.php?id=1396

Changed in bacula (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Chuck Short (zulcss) wrote :

According to kern:

This seems to me to be a normal behavior for Bacula rather than a bug.

As far as I can determine, the first job actually created the Volume in the catalog before it failed, thus any subsequent job is going to use that Volume without invoking any variable expansion, which apparently is what happened because the second job found the volume, labeled it, then continued as you indicated.

Changed in bacula (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Aidan Furlan (aidan-epochlabs) wrote :

I would certainly consider this a bug. It makes variable expansion worse than useless because I can no longer trust it to label volumes with the correct client or date, so that all the volume names are potentially misleading. To avoid misleading data I have gone back to using LabelFormat="Vol".

Revision history for this message
Kern Sibbald (kern) wrote : Re: [Bug 459573] Re: variable expansion uses outdated data

One of the reasons for using Bacula is so that you don't have to track what
Volumes it is using. It does all the work for you, and if you trust it, you
won't need particular Volume labels.

That said, If you really want to use Client based Volume labels, you can, but
to do so, the only reasonable way is to work with Pools and either prelabel
your Volumes, or use some labeling scheme such as you did. If you do not use
Pools, there is no way to absolutely guarantee that Bacula will write on a
Volume you have just created. With Pools, at least you can guarantee that it
will write on a Volume within a given Pool. There is a whole chapter in the
manual describing this for Full, Differential, and Incremental backups, which
can be easily extrapolated to Clients.

So, in my opinion, it isn't so much a question of a feature being "worse than
useless", but rather learning which features will accomplish what you want.

On Monday 02 November 2009 04:38:38 Aidan Furlan wrote:
> I would certainly consider this a bug. It makes variable expansion worse
> than useless because I can no longer trust it to label volumes with the
> correct client or date, so that all the volume names are potentially
> misleading. To avoid misleading data I have gone back to using
> LabelFormat="Vol".

Revision history for this message
Aidan Furlan (aidan-epochlabs) wrote :

Fair enough, obviously I have misunderstood the use case for variable expansion. My apologies.

Revision history for this message
Kern Sibbald (kern) wrote :

> Fair enough, obviously I have misunderstood the use case for variable
> expansion. My apologies.

No need to appologize. Bacula is very complicated, and it is not always
obvious what features to use to do what you want (even for me sometimes).
Unfortunately, for lots of reasons variable expansion never really worked
out in Bacula. Some day, it will be removed once I find something better
(probably plugins).

Kern

>
> --
> variable expansion uses outdated data
> https://bugs.launchpad.net/bugs/459573
> You received this bug notification because you are subscribed to Bacula.
>
> Status in Bacula the Network Backup Solution: New
> Status in “bacula” package in Ubuntu: Invalid
>
> Bug description:
> Binary package hint: bacula
>
> I use "$Client-$Year-$Month-$Day" as my LabelFormat. Recently I tried to
> backup a server called ralph (this was a scheduled job). The Volume was
> created with the correct name but the job failed as the FileDaemon was not
> running, as below:
>
>
> 24-Oct 08:17 floyd-dir JobId 65: Created new Volume "ralph-fd-2009-10-24"
> in catalog.
> 24-Oct 08:17 floyd-dir JobId 65: Using Device "FileStorage"
> 24-Oct 08:17 floyd-dir JobId 65: Warning: bsock.c:123 Could not connect to
> Client: ralph-fd on 192.168.1.254:9102. ERR=Connection refused
>
>
> The job eventually terminated itself. Subsequently I tried to run a job
> manually to backup a different server (benson) and got the following
> output:
>
>
> 24-Oct 13:43 floyd-dir JobId 66: No prior Full backup Job record found.
> 24-Oct 13:43 floyd-dir JobId 66: No prior or suitable Full backup found in
> catalog. Doing FULL backup.
> 24-Oct 13:43 floyd-dir JobId 66: Start Backup JobId 66,
> Job=benson.2009-10-24_13.43.03
> 24-Oct 13:43 floyd-dir JobId 66: Using Device "FileStorage"
> 24-Oct 13:43 floyd-sd JobId 66: Labeled new Volume "ralph-fd-2009-10-24"
> on device "FileStorage" (/bacula-volumes).
> 24-Oct 13:43 floyd-sd JobId 66: Wrote label to prelabeled Volume
> "ralph-fd-2009-10-24" on device "FileStorage" (/bacula-volumes)
> 24-Oct 13:43 floyd-dir JobId 66: Volume used once. Marking Volume
> "ralph-fd-2009-10-24" as Used.
>
>
> Note that the Volume name is again "ralph-fd-2009-10-24". It should have
> been "benson-fd-2009-10-24". It looks like the variable expansion has
> retained the client name "ralph-fd" from the failed job. Either that or
> bacula is not trying to create a new volume at all, but instead reusing
> the volume created previously but not labelled or written to.
>
>
> root@floyd:~# lsb_release -rd
> Description: Ubuntu 8.04.3 LTS
> Release: 8.04
>
> root@floyd:~# apt-cache policy bacula
> bacula:
> Installed: (none)
> Candidate: 2.2.8-5ubuntu7.2
> Version table:
> 2.2.8-5ubuntu7.2 0
> 500 http://mirror.internode.on.net hardy-updates/main Packages
> 2.2.8-5ubuntu7 0
> 500 http://mirror.internode.on.net hardy/main Packages
>

Best regards, Kern

Kern Sibbald (kern)
Changed in bacula:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.