View Issue Details

IDProjectCategoryView StatusLast Update
0001036bareos-coredirectorpublic2024-02-13 10:33
Reportereike Assigned Tobruno-at-bareos  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformLinuxOSCentOSOS Version7
Product Version18.2.4-rc2 
Summary0001036: webui restore (and console (l)list) do not list all backups for a given client if fileset is no longer defined (bat-regression)
DescriptionOn http://bareoswebhost/bareos-webui/restore/, when selecting a client a list of available backup jobs is produced to choose from or enter manually. This list is incomplete if and when the fileset for said job is no longer defined in the Bareos configuration. Otherwise valid catalog entries can thus not be found or selected for restore this way.

This is a regression of the webui to bat (at least on 14.2.x), which lists all available backup jobs in the catalog in this view.

The root cause is that the console (l)list backups command produces a somewhat weird SQL query:

SELECT DISTINCT Job.JobId, Job.Job, Job.Name, Job.PurgedFiles, Job.Type, Job.Level, Job.ClientId, Client.Name as Client, Job.JobStatus, Job.SchedTime, Job.StartTime, Job.EndTime, Job.RealEndTime, Job.JobTDate, Job.VolSessionId, Job.VolSessionTime, Job.JobFiles, Job.JobBytes, Job.JobErrors, Job.JobMissingFiles, Job.PoolId, Pool.Name as PoolName, Job.PriorJobId, Job.FileSetId, FileSet.FileSet FROM Job LEFT JOIN Client ON Client.ClientId=Job.ClientId LEFT JOIN Pool ON Pool.PoolId=Job.PoolId LEFT JOIN JobMedia ON JobMedia.JobId=Job.JobId LEFT JOIN Media ON JobMedia.MediaId=Media.MediaId LEFT JOIN FileSet ON FileSet.FileSetId=Job.FileSetId WHERE Job.JobId > 0 AND Job.Type='B' AND Client.Name='CLIENTNAME-fd' AND JobStatus IN ('T','W') AND (FileSet='fileset1' OR FileSet='fileset2' OR FileSet='fileset3' .....)

Where the final set of OR clauses comprises as many ORed FileSet statements as there are defined for this Catalog.

bat (14.2.x, sorry I don't have another version handy) uses a similar SQL query, but without the constraint on ORed fileset names.

If one specifies a jobid for the restore screen, files from a job for a fileset no longer defined can be restored. The only way to find such a job with the webui is to find the specific volume the backup job was saved to and start a restore from there. In this case, the left of the restore screen does not indicate the name of the job that is being restored, either.

This is a problem if one needs to restore old backups for which the catalog was purposefully not pruned, but fileset definitions have been removed since no new backups of those filesets would be made.
Steps To Reproduce- create a client A/job B/fileset C
- create a backup of fileset C with job B of client A
- remove job B / fileset C definitions from Bareos
- Navigate to webui/restore or use bconsole list backups client="A"
- Notice the job does not appear for a restore

(-navigate to the Volume the job was saved to in the webui, a restore from here is "possible" but misleading ui-wise).
Tagsbroken, director, webui

Activities

bruno-at-bareos

bruno-at-bareos

2024-02-06 09:40

manager   ~0005736

Is this still the case with newer version like 23?
bruno-at-bareos

bruno-at-bareos

2024-02-13 10:33

manager   ~0005769

Closing no feedback

Issue History

Date Modified Username Field Change
2019-01-18 19:37 eike New Issue
2019-01-18 19:37 eike Tag Attached: broken
2019-01-18 19:37 eike Tag Attached: director
2019-01-18 19:37 eike Tag Attached: webui
2021-04-29 10:35 frank Assigned To => frank
2021-04-29 10:35 frank Status new => assigned
2021-08-03 14:10 frank Assigned To frank =>
2021-08-03 14:10 frank Status assigned => new
2021-08-03 14:10 frank Category webui => director
2024-02-06 09:40 bruno-at-bareos Assigned To => bruno-at-bareos
2024-02-06 09:40 bruno-at-bareos Status new => feedback
2024-02-06 09:40 bruno-at-bareos Note Added: 0005736
2024-02-13 10:33 bruno-at-bareos Status feedback => closed
2024-02-13 10:33 bruno-at-bareos Resolution open => no change required
2024-02-13 10:33 bruno-at-bareos Note Added: 0005769