View Issue Details

IDProjectCategoryView StatusLast Update
0000828bareos-coredirectorpublic2023-12-13 13:53
Reporterjjonghyo Assigned Tobruno-at-bareos  
PriorityimmediateSeverityblockReproducibilityalways
Status closedResolutionwon't fix 
PlatformLinuxOSDebianOS Version8
Product Version16.2.4 
Summary0000828: Bareos restores empty files of MS SQL backup
DescriptionI've tried to restore files on bareos-server:

# du -h --max-depth=1 /tmp/bareos-restores/\@MSSQL/default/
4.0K /tmp/bareos-restores/@MSSQL/default/taxi_MSCRM
4.0K /tmp/bareos-restores/@MSSQL/default/Org_MSCRM
4.0K /tmp/bareos-restores/@MSSQL/default/Demo_MSCRM
4.0K /tmp/bareos-restores/@MSSQL/default/karl_MSCRM
4.0K /tmp/bareos-restores/@MSSQL/default/Verd_MSCRM
24K /tmp/bareos-restores/@MSSQL/default/

# ls -lah /tmp/bareos-restores/\@MSSQL/default/taxi_MSCRM/
total 8.0K
drwxrwxrwx 2 root root 4.0K Jun 22 16:26 .
drwxrwxrwx 7 root bareos 4.0K Jun 22 16:29 ..
-rwx------ 1 root root 0 Jun 4 04:41 db-20170604-044103-full.bak

And their size is equal to 0!!!!!!!!!!!!!!!!
Steps To Reproduce1) backup MS SQL
2) run bareos restore jobid
Additional InformationIt shows that files have size and were restored without problem:

22-Jun 16:26 bareos-dir JobId 10541: Start Restore Job RestoreFiles.2017-06-22_16.26.55_21
22-Jun 16:26 bareos-dir JobId 10541: Using Device "FileStorage" to read.
22-Jun 16:26 bareos-sd JobId 10541: Ready to read from volume "Full-0001" on device "FileStorage" (/media/storage).
22-Jun 16:26 bareos-fd JobId 10541: Warning: fd_plugins.c:1181 Plugin=mssqlvdi:instance=default:database=... not found.
22-Jun 16:26 bareos-sd JobId 10541: Forward spacing Volume "Full-0001" to file:block 6:2807413155.
22-Jun 16:26 bareos-fd JobId 10541: Warning: fd_plugins.c:1181 Plugin=mssqlvdi:instance=default:database... not found.
22-Jun 16:28 bareos-fd JobId 10541: Warning: fd_plugins.c:1181 Plugin=mssqlvdi:instance=default:database... not found.
22-Jun 16:28 bareos-fd JobId 10541: Warning: fd_plugins.c:1181 Plugin=mssqlvdi:instance=default:database... not found.
22-Jun 16:29 bareos-fd JobId 10541: Warning: fd_plugins.c:1181 Plugin=mssqlvdi:instance=default:database... not found.
22-Jun 16:29 bareos-dir JobId 10541: Bareos bareos-dir 16.2.4 (01Jul16):
  Build OS: x86_64-pc-linux-gnu debian Debian GNU/Linux 8.0 (jessie)
  JobId: 10541
  Job: RestoreFiles.2017-06-22_16.26.55_21
  Restore Client: bareos-fd
  Start time: 22-Jun-2017 16:26:57
  End time: 22-Jun-2017 16:29:48
  Elapsed time: 2 mins 51 secs
  Files Expected: 1
  Files Restored: 5
  Bytes Restored: 43,384,700,928
  Rate: 253711.7 KB/s
  FD Errors: 0
  FD termination status: OK
  SD termination status: OK
  Termination: Restore OK

TagsNo tags attached.

Activities

jjonghyo

jjonghyo

2017-06-23 09:15

reporter   ~0002677

There is no difference where to restore backups: windows agent, ubuntu, freebsd and centos have zero size files.
eschneider

eschneider

2017-07-06 05:30

reporter   ~0002679

I also have this problem. I have backups for MySQL and MSSQL performed by different Python plugin scripts. The MySQL backups can restore using the Python script OR a generic restore job. The MSSQL backups can restore using the Python script but NOT a generic restore job. When restoring using a generic job on a BSD FD, the restore job reports as successful with the correct number of the files and file sizes. The files are actually empty. When restored using a generic job on Windows the finishes in error after throwing this error message MANY times:

05-Jul 22:25 [CLIENT] JobId 79: Error: filed/restore.c:1231 Write error on [FILE PATH]: The data is invalid.

The FD, SD and Directory are all version 16.2.4
eschneider

eschneider

2017-07-07 04:47

reporter   ~0002680

Last edited: 2017-07-07 04:48

I looked into this more. It seems like the Windows client uses its own special filestream format by default. The trouble is that plugins don't necessarily produce a stream in that format... but it seems to be assumed that they do. You can force the backup to be marked appropriated by adding "Portable = yes" to the file set configuration. This will allow the files produced by the plugin to be restored by clients without the plugin installed.

Here's an example of a FileSet configuration:

FileSet {
  Name = "SelfTest"
  Enable VSS = no
  Include {
    Options {
      Signature = MD5
      Portable = yes
    }
    Plugin = "python:module_path=C\\:/Program Files/Bareos/Plugins:module_name=bareos-fd-eric-mssql:backuppath=C\\:/bareos-dumps:mssqlserver=(LOCAL)/SQLEXPRESS:mssqluser=bareos:mssqlpassword=bareos:db=example"
  }
}

I'm not knowledgeable enough about Bareos to know if this would be considered a bug or if it's assumed that you would know to configure your file set appropriately.

There's more information on the topic of data stream portability here:
http://www.bacula.org/5.1.x-manuals/fr/main/main/Windows_Version_Bacula.html

bruno-at-bareos

bruno-at-bareos

2023-12-13 13:53

manager   ~0005628

plugin backup need plugin restore

Issue History

Date Modified Username Field Change
2017-06-22 17:13 jjonghyo New Issue
2017-06-23 09:15 jjonghyo Note Added: 0002677
2017-07-06 05:30 eschneider Note Added: 0002679
2017-07-07 04:47 eschneider Note Added: 0002680
2017-07-07 04:48 eschneider Note Edited: 0002680
2017-07-07 04:48 eschneider Note Edited: 0002680
2023-12-13 13:53 bruno-at-bareos Assigned To => bruno-at-bareos
2023-12-13 13:53 bruno-at-bareos Status new => closed
2023-12-13 13:53 bruno-at-bareos Resolution open => won't fix
2023-12-13 13:53 bruno-at-bareos Note Added: 0005628