Skip to content

Consolidate error with "empty" incrementals with strip #2336

@SamuelBoerlin

Description

@SamuelBoerlin

Bareos component version

  1. bareos-fd --version
    24.0.4~pre30.dd9a00734
  2. bareos-dir --version
    24.0.4~pre30.dd9a00734
  3. bareos-sd --version
    24.0.4~pre30.dd9a00734

Steps to reproduce

Not sure what exactly is the cause, but it seems probable that you need a consolidation containing only empty incrementals and possibly usage of Strip (numeric or prefix) in the fileset.

Expected results

Consolidate should either purge incrementals if they're actually empty or else consolidate them.

Actual results

Consolidate vfull fails with an error.

It seems that the empty incremental backup purging mechanism that should take place before the consolidate vfull is launched doesn't work in my case for some reason. Perhaps this has to do with the usage of Strip = "1" in the fileset. When I query the files associated with these "empty" incrementals I see that there are some changes for the root file/path / (see below). Maybe this isn't handled consistently during the empty backup purging step and during the writing of the bootstrap (https://github.com/bareos/bareos/blob/master/core/src/dird/vbackup.cc#L574), hence leading to a discrepancy and the error.

Environment

- OS: `Ubuntu 20.04.6 LTS`
- component: dir

Relevant log output

Consolidate backup logs and error (note: I reran the exact run command created by the Consolidate job here so I could obtain cleaner debug output. The error was exactly the same for the original vfull job created by the Consolidate job.):
*run job="Backup-nfs-dasch-drive" jobid=216550,215183,215478,215788 level=VirtualFull priority=10 accurate=yes spooldata=no ignoreduplicatecheck=yes consolidatejob=Consolidate yes
Job queued. JobId=217413
05-Aug 11:25 bareos-dir JobId 217413: Version: 24.0.4~pre30.dd9a00734 (11 June 2025) Ubuntu 20.04.6 LTS
05-Aug 11:25 bareos-dir JobId 217413: shell command: run BeforeJob "/usr/local/bin/bareos/dispatch_event.sh 'start' '0' 'bareos-fd' 'Unknown term code' 'nfs-dasch-drive' '0' '217413' 'Virtual Full' 'Backup-nfs-dasch-drive' 'AI-Consolidated' 'Backup'"
05-Aug 11:25 bareos-dir JobId 217413: Start Virtual Backup JobId 217413, Job=Backup-nfs-dasch-drive.2025-08-05_11.25.20_58
05-Aug 11:25 bareos-dir JobId 217413: Unable to get Job record. ERR=cats/sql_get.cc:267 No Job found for JobName ''

05-Aug 11:25 bareos-dir JobId 217413: No files found to read. No bootstrap file written.
05-Aug 11:25 bareos-dir JobId 217413: Fatal error: Could not create bootstrap file
05-Aug 11:25 bareos-dir JobId 217413: Replicating deleted files from jobids 216550,215183,215478,215788 to jobid 217413
05-Aug 11:25 bareos-dir JobId 217413: Error: Bareos bareos-dir 24.0.4~pre30.dd9a00734 (11Jun25):
  Build OS:               Ubuntu 20.04.6 LTS
  JobId:                  217413
  Job:                    Backup-nfs-dasch-drive.2025-08-05_11.25.20_58
  Backup Level:           Virtual Full
  Client:                 "bareos-fd" 24.0.4~pre30.dd9a00734 (11Jun25) Ubuntu 20.04.6 LTS,ubuntu
  FileSet:                "nfs-dasch-drive" 2024-07-26 09:56:23
  Pool:                   "AI-Consolidated" (From Job Pool's NextPool resource)
  Catalog:                "Catalog" (From Client resource)
  Storage:                "File-C" (From Storage from Pool's NextPool resource)
  Scheduled time:         05-Aug-2025 11:25:20
  Start time:             30-Jul-2025 00:01:21
  End time:               30-Jul-2025 00:10:30
  Elapsed time:           9 mins 9 secs
  Priority:               10
  Allow Mixed Priority:   yes
  SD Files Written:       0
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Volume name(s):         
  Volume Session Id:      0
  Volume Session Time:    0
  Last Volume Bytes:      0 (0 B)
  SD Errors:              0
  SD termination status:  
  Accurate:               yes
  Bareos binary info:     Bareos community build (UNSUPPORTED): Get professional support from https://www.bareos.com
  Job triggered by:       User
  Termination:            *** Backup Error ***

05-Aug 11:25 bareos-dir JobId 217413: shell command: run AfterJob "/usr/local/bin/bareos/dispatch_event.sh 'failure' '0' 'bareos-fd' 'Fatal Error' 'nfs-dasch-drive' '0' '217413' 'Virtual Full' 'Backup-nfs-dasch-drive' 'AI-Consolidated' 'Backup'"


Files of the "empty" incremental backups:
Enter SQL query: SELECT * FROM File JOIN Path USING (PathId) WHERE JobId=216550;
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
| pathid | fileid        | fileindex | jobid  | deltaseq | markid | fhinfo | fhnode | lstat                                                      | md5  | name | path |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
|    173 | 1,210,151,620 |         1 | 216550 |        0 |      0 |      0 |      0 | 3 hwAAAD EH4 X H4 U A BAA IAA B BohMBX BohMBU BohMBU A A C | 0    |      | /    |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
Enter SQL query: SELECT * FROM File JOIN Path USING (PathId) WHERE JobId=215183;
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
| pathid | fileid        | fileindex | jobid  | deltaseq | markid | fhinfo | fhnode | lstat                                                      | md5  | name | path |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
|    173 | 1,203,869,400 |         1 | 215183 |        0 |      0 |      0 |      0 | 3 hwAAAD EH4 X H4 U A BAA IAA B Bohe4w Bohe4t Bohe4t A A C | 0    |      | /    |
|    173 | 1,203,869,401 |         0 | 215183 |        0 |      0 |      0 |      0 | A A A A A A A A A A A BohMBU BohMBU A A C                  | 0    |      | /    |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
Enter SQL query: SELECT * FROM File JOIN Path USING (PathId) WHERE JobId=215478;
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
| pathid | fileid        | fileindex | jobid  | deltaseq | markid | fhinfo | fhnode | lstat                                                      | md5  | name | path |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
|    173 | 1,205,608,243 |         1 | 215478 |        0 |      0 |      0 |      0 | 3 hwAAAD EH4 X H4 U A BAA IAA B Boh0Kl Boh0Ki Boh0Ki A A C | 0    |      | /    |
|    173 | 1,205,608,244 |         0 | 215478 |        0 |      0 |      0 |      0 | A A A A A A A A A A A Bohe4t Bohe4t A A C                  | 0    |      | /    |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
Enter SQL query: SELECT * FROM File JOIN Path USING (PathId) WHERE JobId=215788;
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
| pathid | fileid        | fileindex | jobid  | deltaseq | markid | fhinfo | fhnode | lstat                                                      | md5  | name | path |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+
|    173 | 1,205,619,754 |         1 | 215788 |        0 |      0 |      0 |      0 | 3 hwAAAD EH4 X H4 U A BAA IAA B BoiNpg BoiNpc BoiNpc A A C | 0    |      | /    |
|    173 | 1,205,619,755 |         0 | 215788 |        0 |      0 |      0 |      0 | A A A A A A A A A A A Boh0Ki Boh0Ki A A C                  | 0    |      | /    |
+--------+---------------+-----------+--------+----------+--------+--------+--------+------------------------------------------------------------+------+------+------+

Relevant traces output

bareos-dir (10): dird/ua_audit.cc:134-0 : Console [default] from [::1] cmdline run job="Backup-nfs-dasch-drive" jobid=216550,215183,215478,215788 level=VirtualFull priority=10 accurate=yes spooldata=no ignoreduplicatecheck=yes consolidatejob=Consolidate yes
bareos-dir (10): dird/jcr_util.cc:35-0 NewDirectorJcr: configuration_resources_ is at 7fa2d8030a70 2025-08-04_18:00:03
bareos-dir (10): dird/vbackup.cc:155-0 Read pool=AI-Incremental (From Job resource)
bareos-dir (10): dird/vbackup.cc:207-0 Write pool=AI-Consolidated read rpool=AI-Incremental
bareos-dir (10): dird/vbackup.cc:106-217413 jobids=216550,215183,215478,215788
bareos-dir (10): dird/vbackup.cc:289-217413 Previous JobId=216550
bareos-dir (10): dird/vbackup.cc:299-217413 Level of first consolidated job 216550: Incremental
bareos-dir (10): dird/vbackup.cc:309-217413 Previous JobId=215788
bareos-dir (10): dird/vbackup.cc:575-217413 Found 0 files to consolidate.
bareos-dir (10): dird/ua_audit.cc:134-0 : Console [default] from [::1] cmdline setdebug level=10000 trace=0 dir

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugThis addresses a bug

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions