Hi,

I revovered now the latest Backup of der catalog by importing
the sql file successfully.

Now I simply tried to update the newest record which has the failed state
after restarting bacula-director with the bsr file from the backup:

| 84,809 | mail_home           | 2026-06-01 01:00:08 | B    | D     |       383 
|    12,817,649,968 | T         |
| 84,813 | BackupCatalog       | 2026-06-01 01:16:28 | B    | F     |         0 
|                 0 | f         |


bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=1 Stream=20 
len=53952
bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=1 Stream=20 
len=16
bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=1 Stream=19 
len=322
bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=1 Stream=3 
len=16
bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=2 Stream=1 
len=82
bscan: bscan.c:440-0 Record: SessId=22 SessTim=1780252068 FileIndex=-5 
Stream=84813 len=194
bscan: bscan.c:1299-0 Could not create JobMedia record. ERR=sql_create.c:135 
Update Media record UPDATE Media SET EndFile=383, EndBlock=1266266991 WHERE 
MediaId=0 failed: ERR=

03-Jun 14:51 bscan JobId 0: End of Volume "DISK035" at addr=1646238741360 on device 
"DiskStorage1" (/media/baculadisk1).
bscan: bscan.c:1013-0 Could not update media record. ERR=bdb.h:140 Update 
failed: affected_rows=0 for UPDATE Media SET 
VolJobs=1,VolFiles=0,VolBlocks=0,VolBytes=27812130636,VolABytes=0,VolHoleBytes=0,VolHoles=0,VolMounts=0,VolErrors=0,VolWrites=0,MaxVolBytes=0,VolStatus='',Slot=0,InChanger=0,VolReadTime=0,VolWriteTime=0,VolType=0,VolParts=0,VolCloudParts=0,LastPartBytes=0,LabelType=0,StorageId=0,PoolId=0,VolRetention=0,VolUseDuration=0,MaxVolJobs=0,MaxVolFiles=0,Enabled=0,LocationId=0,ScratchPoolId=0,RecyclePoolId=0,RecycleCount=0,Recycle=0,ActionOnPurge=0,CacheRetention=0,EndBlock=0
 WHERE VolumeName=''

bscan: bscan.c:440-0 Record: SessId=0 SessTim=0 FileIndex=-6 Stream=0 len=0
bscan: bscan.c:1013-0 Could not update media record. ERR=bdb.h:140 Update 
failed: affected_rows=0 for UPDATE Media SET 
VolJobs=1,VolFiles=0,VolBlocks=0,VolBytes=27812130636,VolABytes=0,VolHoleBytes=0,VolHoles=0,VolMounts=1,VolErrors=0,VolWrites=0,MaxVolBytes=0,VolStatus='',Slot=0,InChanger=0,VolReadTime=0,VolWriteTime=0,VolType=0,VolParts=0,VolCloudParts=0,LastPartBytes=0,LabelType=0,StorageId=0,PoolId=0,VolRetention=0,VolUseDuration=0,MaxVolJobs=0,MaxVolFiles=0,Enabled=0,LocationId=0,ScratchPoolId=0,RecyclePoolId=0,RecycleCount=0,Recycle=0,ActionOnPurge=0,CacheRetention=0,EndBlock=0
 WHERE VolumeName=''

bscan: bscan.c:669-0 End of all Volumes. VolFiles=0 VolBlocks=0 
VolBytes=27,812,130,636
Records added or updated in the catalog:
      0 Media
      0 Pool
      1 Job
      2 File

After starting bacula-dir:

| 84,792 | BackupCatalog | 2026-05-31 20:58:26 | B    | F     |        2 | 
27,776,083,728 | T         |
| 84,813 | BackupCatalog | 2026-06-01 01:16:28 | B    | F     |        2 | 
27,807,038,876 | T         |
+--------+---------------+---------------------+------+-------+----------+----------------+-----------+

It got the T flag so it looks like the job itself has been updated.

It looks like one entry has been updated however but then the other two has to 
been failed.

Also it looks like the file table has been filled:
*que
Available queries:
     1: List up to 20 places where a File is saved regardless of the directory
     2: List where the most recent copies of a file are saved
     3: List last 20 Full Backups for a Client
     4: List all backups for a Client after a specified time
     5: List all backups for a Client
     6: List Volume Attributes for a selected Volume
     7: List Volumes used by selected JobId
     8: List Volumes to Restore All Files
     9: List Pool Attributes for a selected Pool
    10: List total files/bytes by Job
    11: List total files/bytes by Volume
    12: List Files for a selected JobId
    13: List Jobs stored on a selected MediaId
    14: List Jobs stored for a given Volume name
    15: List Volumes Bacula thinks are in changer
    16: List Volumes likely to need replacement from age or errors
    17: List Volumes Bacula thinks are eligible for the changer
    18: List Volumes by Volume:
    19: List Volumes by Jobs:
    20: List Volumes for a jobname:
    21: List all backups for a Client before a specified time
    22: List Jobs which have no files in DB
    23: List jobs which have no files in db and are possible failed
    24: List volumes which have no files in db
    25: List media from a pool ordered by lastwritten
    26: List jobs from a pool ordered by job endtime
    27: Count files of a specified job id
    28: Show oldest to newst contained volumes in changer
    29: Show migrated volumes
    30: Search pathes for a file for a job
Choose a query (1-30): 12
Enter JobId: 84813
+------------------+----------------+
| path             | name           |
+------------------+----------------+
| /var/lib/bacula/ |                |
| /var/lib/bacula/ | bacula.sql.lz4 |
+------------------+----------------+

restore aborts after *done:
*que
Available queries:
     1: List up to 20 places where a File is saved regardless of the directory
     2: List where the most recent copies of a file are saved
     3: List last 20 Full Backups for a Client
     4: List all backups for a Client after a specified time
     5: List all backups for a Client
     6: List Volume Attributes for a selected Volume
     7: List Volumes used by selected JobId
     8: List Volumes to Restore All Files
     9: List Pool Attributes for a selected Pool
    10: List total files/bytes by Job
    11: List total files/bytes by Volume
    12: List Files for a selected JobId
    13: List Jobs stored on a selected MediaId
    14: List Jobs stored for a given Volume name
    15: List Volumes Bacula thinks are in changer
    16: List Volumes likely to need replacement from age or errors
    17: List Volumes Bacula thinks are eligible for the changer
    18: List Volumes by Volume:
    19: List Volumes by Jobs:
    20: List Volumes for a jobname:
    21: List all backups for a Client before a specified time
    22: List Jobs which have no files in DB
    23: List jobs which have no files in db and are possible failed
    24: List volumes which have no files in db
    25: List media from a pool ordered by lastwritten
    26: List jobs from a pool ordered by job endtime
    27: Count files of a specified job id
    28: Show oldest to newst contained volumes in changer
    29: Show migrated volumes
    30: Search pathes for a file for a job
Choose a query (1-30): 12
Enter JobId: 84813
+------------------+----------------+
| path             | name           |
+------------------+----------------+
| /var/lib/bacula/ |                |
| /var/lib/bacula/ | bacula.sql.lz4 |
+------------------+----------------+

In the jobmedia table I see only one entry:

bacula=> select * from jobmedia where jobid=84813;
 jobmediaid | jobid | mediaid | firstindex | lastindex | startfile | endfile | 
startblock |  endblock  | volindex
------------+-------+---------+------------+-----------+-----------+---------+------------+------------+----------
     628090 | 84813 |       0 |          1 |         2 |         0 |     383 |  
        0 | 1266266991 |        1
(1 row)

Maybe it is also a problem that the start and endblock known is not enough to 
update the
entry. I'm unsure but mean it must be 3 like in the bsr file.

So I starting now the bscan over the whole volume:
bacula@backup:~$ time /usr/sbin/bscan -s -m  /media/baculadisk1 -V DISK035
bscan: butil.c:292-0 Using device: "/media/baculadisk1" for reading.
03-Jun 15:17 bscan JobId 0: Ready to read from volume "DISK035" on File device 
"DiskStorage1" (/media/baculadisk1).
bscan: bscan.c:519-0 VOL_LABEL: OK for Volume: DISK035

Will see how it has been worked after view hours running.

By the way I'm not sure if I allready told it is still bacula 9.6 running (from 
Debian 12).
I'm failed to upgrade to Debian 13 with Bacula 15 because of some trouble, 
which is not
related to bacula. I will try again after made some cleanup.

My next steps are now reinsert the missing successfull run jobs to the catalog.
Make sure I have a full backup for fast recovering (here it would be nice if I 
can use the bsr files.)
Upgrade to Debian 13 (with Migration to Bacula 15).

I'll add more information after the running bscan will be finished.

Cheers,




_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to