View Issue Details

IDProjectCategoryView StatusLast Update
0001036bareos-core[All Projects] webuipublic2021-04-29 10:35
ReportereikeAssigned Tofrank 
Status assignedResolutionopen 
PlatformLinuxOSCentOSOS Version7
Product Version18.2.4-rc2 
Fixed in Version 
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
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action


There are no notes attached to this issue.

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