Re: [Bacula-users] Baculum Prado\Exceptions\TPhpFatalErrorException

2019-05-07 Thread Jose Alberto
Thanks Marcin.

I can solved   remove  php5   and  install php7.

all works fine now.

Regards.

Centos 7

On Mon, May 6, 2019 at 11:41 PM Marcin Haba  wrote:

> Hello Jose and Elias,
>
> Thanks for reporting this problem.
>
> It happens only with old PHP < 5.5 because in those versions empty()
> function doesn't support expressions. Usually CentOS 7 users can
> experience this bug as in this distribution is PHP 5.4.
>
> In attachment I am sending patch that fixes it for you and for other users.
>
> Best regards.
> Marcin Haba (gani)
>
> On Tue, 7 May 2019 at 04:47, Elias Pereira  wrote:
> >
> > Hello Jose,
> >
> > Happened to me too! The principle does not seem to be errors, but
> warnings.
> >
> > I added ~E_WARNING on line 445 (error_reporting = E_ALL & ~E_DEPRECATED
> & ~E_STRICT & ~E_WARNING) from the file /etc/php/7.0/apache2/php.ini and
> resolved.
> >
> > On Mon, May 6, 2019 at 5:50 PM Jose Alberto  wrote:
> >>
> >> Hi.
> >>
> >> i have  bacula 9.4.2  and baculum 9.4.3  on Centos 7 amd64.
> >>
> >> The Baculum problem  when Actions menu on Jobs
> >>
> >> Baculum Menu... Jobs.Colum Actions   "Details"
> >>
> >> the rest without problem
> >>
> >> Log:
> >>
> >> Prado\Exceptions\TPhpFatalErrorException
> >> Description
> >> [Compile Error] Can't use method return value in write context (@line 1
> in file
> /usr/share/baculum/htdocs/framework/pradosoft/prado/framework/TComponent.php(1229)
> : eval()'d code).
> >>
> >> Source File
> >>
> /usr/share/baculum/htdocs/framework/pradosoft/prado/framework/PradoBase.php
> (193)
> >>
> >> 0182:  * PHP shutdown function used to catch fatal errors.
> >> 0183:  * This method should be registered as PHP error handler using
> >> 0184:  * {@link register_shutdown_function}. The method throws an
> exception that
> >> 0185:  * contains the error information.
> >> 0186:  */
> >> 0187: public static function phpFatalErrorHandler()
> >> 0188: {
> >> 0189: $error = error_get_last();
> >> 0190: if ($error &&
> >> 0191: TPhpErrorException::isFatalError($error) &&
> >> 0192: error_reporting() & $error['type']) {
> >> 0193: self::exceptionHandler(new
> TPhpFatalErrorException($error['type'], $error['message'], $error['file'],
> $error['line']));
> >> 0194: }
> >> 0195: }
> >> 0196:
> >> 0197: /**
> >> 0198:  * Default exception handler.
> >> 0199:  * This method should be registered as default exception
> handler using
> >> 0200:  * {@link set_exception_handler}. The method tries to use the
> errorhandler
> >> 0201:  * module of the Prado application to handle the exception.
> >> 0202:  * If the application or the module does not exist, it simply
> echoes the
> >> 0203:  * exception.
> >> 0204:  * @param Exception $exception exception that is not caught
> >> 0205:  */
> >>
> >> Stack Trace
> >> #0 [internal function]: Prado\PradoBase::phpFatalErrorHandler()
> >> #1 {main}
> >>
> >> --
> >> #
> >> #   Sistema Operativo: Debian  #
> >> #Caracas, Venezuela  #
> >> #
> >> ___
> >> Bacula-users mailing list
> >> Bacula-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/bacula-users
> >
> >
> >
> > --
> > Elias Pereira
> > ___
> > Bacula-users mailing list
> > Bacula-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
>
>
>
> --
> "Greater love hath no man than this, that a man lay down his life for
> his friends." Jesus Christ
>
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
> za przyjaciół swoich." Jezus Chrystus
>


-- 
#
#   Sistema Operativo: Debian  #
#Caracas, Venezuela  #
#
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Autochanger not working?

2019-05-07 Thread Robert Minvielle
I labeled the tapes in bconsole, it said it worked (I ejected them and mounted
them with mtx). However, I still get:


*mount
Automatically selected Storage: File1
3905 Device ""Drive-1" (/dev/nst0)" open but no Bacula volume is mounted.
If this is not a blank tape, try unmounting and remounting the Volume.
*unmount
Automatically selected Storage: File1
3002 Device ""Drive-1" (/dev/nst0)" unmounted.
*mount
Automatically selected Storage: File1
3902 Cannot mount Volume on Storage Device ""Drive-1" (/dev/nst0)" because:
Could not unserialize Volume label: ERR=label.c:873 Expecting Volume Label, got 
FI=0 Stream=0 len=64412

3905 Device ""Drive-1" (/dev/nst0)" open but no Bacula volume is mounted.
If this is not a blank tape, try unmounting and remounting the Volume.

And it still does not see the tapes. Am I using the wrong device??



- Original Message -
> From: "William Muriithi" 
> To: "Robert Minvielle" , 
> bacula-users@lists.sourceforge.net
> Sent: Tuesday, May 7, 2019 2:36:51 PM
> Subject: Re: Autochanger not working?
> 
> Hi Robert,
> 
> ===
> 
> Autochanger {
>   Name = LTO5
>   Device = Drive-1
>   Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>   Changer Device = /dev/sg3
> }
> 
> Be aware that /dev/sg3 can change when the system is rebooted.
> 
> ===
> Device {
>   Name = Drive-1
>   Drive Index = 0
>   Device Type = Tape
>   Media Type = LTO-5
>   Archive Device = /dev/nst0
>   Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>   Label Media = yes;   # lets Bacula label unlabeled media
>   Random Access = Yes;
>   Automatic Mount = yes;   # when device opened, read it
>   Removable Media = yes;
>   Always Open = yes;
>   Maximum Concurrent Jobs = 5
> }
> ==
> 
> Don't have "Drive Index = 0", think its only needed when your tape devices
> have multiple drives/head
> Use  "Random Access = no"  since you are using the tapes
> 
> 
> Device "Drive-1" (/dev/nst0) open but no Bacula volume is currently mounted.
> Total Bytes Read=64,512 Blocks Read=1 Bytes/block=64,512
> Positioned at File=0 Block=0
> ==
> You may not have labelled the tapes, so bacula didn't attempt loading them.
> 
> Try manually attempting to load them from bconsole and see what happens.
> 
> Sorry for the formatting, using a horrible mail client called outlook, hence
> the mess
> 
> Regards,
> William


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Autochanger not working?

2019-05-07 Thread William Muriithi
Hi Robert,

===

Autochanger {
  Name = LTO5
  Device = Drive-1
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/sg3
}

Be aware that /dev/sg3 can change when the system is rebooted.  

===
Device {
  Name = Drive-1
  Drive Index = 0
  Device Type = Tape
  Media Type = LTO-5
  Archive Device = /dev/nst0
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Label Media = yes;   # lets Bacula label unlabeled media
  Random Access = Yes;
  Automatic Mount = yes;   # when device opened, read it
  Removable Media = yes;
  Always Open = yes;
  Maximum Concurrent Jobs = 5
}
==

Don't have "Drive Index = 0", think its only needed when your tape devices have 
multiple drives/head
Use  "Random Access = no"  since you are using the tapes


Device "Drive-1" (/dev/nst0) open but no Bacula volume is currently mounted.
Total Bytes Read=64,512 Blocks Read=1 Bytes/block=64,512
Positioned at File=0 Block=0
==
You may not have labelled the tapes, so bacula didn't attempt loading them.

Try manually attempting to load them from bconsole and see what happens.

Sorry for the formatting, using a horrible mail client called outlook, hence 
the mess 

Regards,
William

___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Autochanger not working?

2019-05-07 Thread Robert Minvielle



I have a new bacula install using the ubuntu built in packages on ubuntu 16
with a new Dell EMC ML3 drive (an ibm 3573-TL)

I can get btape to work, and mt and mtx to work, but it seems the bconsole
will not work. I am not sure if I have something configured wrong or it does
not see the tape drive correctly. Any input would be appreciated. 

Below, I will show some configs, lsscsi and testing that I have 
performed. When I go to the console to test labels or the changer, it seems
to fail. 

my relevant portions from bacula-sd.conf:



Autochanger {
  Name = LTO5
  Device = Drive-1
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/sg3
}

Device {
  Name = Drive-1
  Drive Index = 0
  Device Type = Tape
  Media Type = LTO-5
  Archive Device = /dev/nst0
  Changer Command = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
  Label Media = yes;   # lets Bacula label unlabeled media
  Random Access = Yes;
  Automatic Mount = yes;   # when device opened, read it
  Removable Media = yes;
  Always Open = yes;
  Maximum Concurrent Jobs = 5
}



And  /etc/bacula# lsscsi -g
[0:2:0:0]diskDELL PERC H730 Mini   4.24  /dev/sda   /dev/sg0 
[0:2:1:0]diskDELL PERC H730 Mini   4.24  /dev/sdb   /dev/sg1 
[1:0:1:0]tapeIBM  ULT3580-HH6  J451  /dev/st0   /dev/sg2 
[1:0:1:1]mediumx IBM  3573-TL  1112  /dev/sch0  /dev/sg3 





/etc/bacula# btape -c bacula-sd.conf /dev/nst0
Tape block granularity is 1024 bytes.
btape: butil.c:287-0 Using device: "/dev/nst0" for writing.
btape: btape.c:469-0 open device "Drive-1" (/dev/nst0): OK
*test

=== Write, rewind, and re-read test ===

I'm going to write 1 records and an EOF
then write 1 records and an EOF, then rewind,
and re-read the data to verify that it is correct.

This is an *essential* feature ...

btape: btape.c:1152-0 Wrote 1 blocks of 64412 bytes.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:1168-0 Wrote 1 blocks of 64412 bytes.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:1210-0 Rewind OK.
1 blocks re-read correctly.
Got EOF on tape.
1 blocks re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===

btape: btape.c:1277-0 Block position test
btape: btape.c:1289-0 Rewind OK.
Reposition to file:block 0:4
Block 5 re-read correctly.
Reposition to file:block 0:200
Block 201 re-read correctly.
Reposition to file:block 0:
Block 1 re-read correctly.
Reposition to file:block 1:0
Block 10001 re-read correctly.
Reposition to file:block 1:600
Block 10601 re-read correctly.
Reposition to file:block 1:
Block 2 re-read correctly.
=== Test Succeeded. End Write, rewind, and re-read test ===



=== Append files test ===

This test is essential to Bacula.

I'm going to write one record  in file 0,
   two records in file 1,
 and three records in file 2

btape: btape.c:574-0 Rewound "Drive-1" (/dev/nst0)
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:469-0 open device "Drive-1" (/dev/nst0): OK
btape: btape.c:574-0 Rewound "Drive-1" (/dev/nst0)
btape: btape.c:1420-0 Now moving to end of medium.
btape: btape.c:625-0 Moved to end of medium.
We should be in file 3. I am at file 3. This is correct!

Now the important part, I am going to attempt to append to the tape.

btape: btape.c:1907-0 Wrote one record of 64412 bytes.
btape: btape.c:1909-0 Wrote block to device.
btape: btape.c:604-0 Wrote 1 EOF to "Drive-1" (/dev/nst0)
btape: btape.c:574-0 Rewound "Drive-1" (/dev/nst0)
Done appending, there should be no I/O errors

Doing Bacula scan of blocks:
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 bytes in file 3
End of File mark.
1 block of 64448 bytes in file 4
End of File mark.
Total files=4, blocks=7, bytes = 451,136
End scanning the tape.
We should be in file 4. I am at file 4. This is correct!

The above Bacula scan should have output identical to what follows.
Please double check it ...
=== Sample correct output ===
1 block of 64448 bytes in file 1
End of File mark.
2 blocks of 64448 bytes in file 2
End of File mark.
3 blocks of 64448 

Re: [Bacula-users] Bacula director error messages

2019-05-07 Thread Martin Simmons
Maybe there is an error message in the text you snipped?

__Martin


> On Mon, 6 May 2019 23:09:46 +0200, Andras Horvai said:
> 
> Dear List,
> 
> does anyone have any clue why I got director error after a tape change: (I
> am using copy job to copy full backups (from file storage) to tape.
> 
> Tape change message:
> 
> Subject: Bacula: Intervention needed for srv1-job.2019-05-06_09.00.01_21
> 
> 06-May 12:08 backup2-sd JobId 1038: Please mount append Volume "WORMW-1182"
> or label a new one for:
> Job:  srv1-job.2019-05-06_09.00.01_21
> Storage:  "LTO-6" (/dev/nst0)
> Pool: TapeArchive
> Media type:   LTO-6
> 
> 
> Then comes this:
> 
> 
> 06-May 09:00 backup2-dir JobId 1037: Copying using JobId=1016
> Job=srv1-job.2019-05-04_02.00.00_59
> 06-May 12:01 backup2-dir JobId 1037: Start Copying JobId 1037,
> Job=ArchiveJob.2019-05-06_09.00.01_20
> 06-May 12:01 backup2-dir JobId 1037: Using Device "FileStorage" to read.
> 
> ...snip...
> 
> 
> 06-May 12:56 backup2-sd JobId 1037: End of Volume "FILEW-1034" at
> addr=895179674 on device "FileStorage" (/backup).
> 06-May 12:56 backup2-sd JobId 1037: Elapsed time=00:54:40, Transfer
> rate=18.42 M Bytes/second
> 06-May 12:56 backup2-dir JobId 1037: Error: Bacula backup2-dir 9.4.1
> (20Dec18):
>   Build OS:   x86_64-pc-linux-gnu ubuntu 18.04
>   Prev Backup JobId:  1016
>   Prev Backup Job:srv1-job.2019-05-04_02.00.00_59
>   New Backup JobId:   1038
>   Current JobId:  1037
>   Current Job:ArchiveJob.2019-05-06_09.00.01_20
>   Backup Level:   Full
>   Client: Archiver
>   FileSet:"None" 2019-02-02 23:14:56
>   Read Pool:  "ServersWeeklyFullFile" (From Command input)
>   Read Storage:   "File" (From Pool resource)
>   Write Pool: "TapeArchive" (From Command input)
>   Write Storage:  "LTO-6" (From Command input)
>   Catalog:"MyCatalog" (From Client resource)
>   Start time: 06-May-2019 12:01:27
>   End time:   06-May-2019 12:56:13
>   Elapsed time:   54 mins 46 secs
>   Priority:   13
>   SD Files Written:   104,642
>   SD Bytes Written:   60,444,227,085 (60.44 GB)
>   Rate:   18394.5 KB/s
>   Volume name(s): WORMW-1181|WORMW-1182
>   Volume Session Id:  728
>   Volume Session Time:1551107460
>   Last Volume Bytes:  34,658,297,856 (34.65 GB)
>   SD Errors:  0
>   SD termination status:  OK
>   Termination:*** Copying Error ***
> 
> 
> Thanks for clarification!
> 
> Andras
> 


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Query for "most recent copies of a file"

2019-05-07 Thread Martin Simmons
I think option 2 should be fixed to ignore deleted files.  E.g.

# 2
:List where the most recent copies of a file are saved
*Enter path with trailing slash:
*Enter filename:
*Enter Client name:
SELECT DISTINCT Job.JobId,StartTime AS JobStartTime,VolumeName,Client.Name AS 
ClientName
 FROM Job,File,Path,Filename,Media,JobMedia,Client
 WHERE File.JobId=Job.JobId
 AND File.FileIndex > 0
 AND Path.Path='%1'
 AND Filename.Name='%2'
 AND Client.Name='%3'
 AND Path.PathId=File.PathId
 AND Filename.FilenameId=File.FilenameId
 AND JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 AND Client.ClientId=Job.ClientId
 ORDER BY Job.StartTime DESC LIMIT 5;

Queries 1 and 12 also need to be fixed.

__Martin


> On Tue, 7 May 2019 14:59:47 +0200, Christoph Litauer said:
> 
> Sorry for the long delay, had holidays ...
> 
> That seems to be the explanation. I use accurate for all my backups. Your 
> command lists cyrus.header as deleted. As a result "restore" doesn't list the 
> parent directory.
> 
> But 
> - should option 2 really find deleted files?
> - how do I find the last _not_ deleted version of a file?
> 
> > Am 25.04.2019 um 17:19 schrieb Martin Simmons :
> > 
> > Here's another possible problem: query 2 gives the wrong results if you are
> > using "accurate" backups and have deleted files.
> > 
> > Try
> > 
> > echo "list files type=deleted jobid=1100162" | bconsole | grep 
> > someuser/Transkriptionen
> > 
> > to see if that directory was deleted.
> > 
> > __Martin
> > 
> > 
> >> On Thu, 18 Apr 2019 13:13:20 +0100, Martin Simmons said:
> >> 
> >> Yes, I think commands 2 and 3 should be successful because command 1 is
> >> successful.
> >> 
> >> Is the path entirely ASCII?  Is "someuser" the real name?
> >> 
> >> You could try
> >> 
> >> (echo "restore"; echo 3; echo 1100162; echo "cd /var") | bconsole
> >> (echo "restore"; echo 3; echo 1100162; echo "cd /var/spool") | bconsole
> >> (echo "restore"; echo 3; echo 1100162; echo "cd /var/spool/imap") | 
> >> bconsole
> >> 
> >> etc to see which directory is invalid.
> >> 
> >> __Martin
> >> 
> >> 
> >> On Thu, 18 Apr 2019 13:43:11 +0200, Christoph Litauer said:
> >>> 
> >>> Dubious ...
> >>> 
> >>> # (echo "query"; echo 12; echo 1100162) | bconsole | grep someuser/ | 
> >>> grep cyrus.header
> >>> | /var/spool/imap/d/user/someuser/Transkriptionen/
> >>> | cyrus.header   |
> >>> 
> >>> # echo "list files jobid=1100162" | bconsole | grep 
> >>> someuser/Transkriptionen
> >>> 
> >>> 
> >>> # (echo "restore"; echo 3; echo 1100162; echo "cd 
> >>> /var/spool/imap/d/user/someuser/Transkriptionen") | bconsole
> >>> ...
> >>> Invalid path given.
> >>> ...
> >>> 
> >>> 
> >>> In my opinion all 3 commands should be successful? 
> >>> 
>  Am 18.04.2019 um 11:39 schrieb Martin Simmons :
>  
>  You could also check with query 12 (List Files for a selected JobId) to 
>  see if
>  that lists your files.
>  
>  __Martin
>  
> > On Wed, 17 Apr 2019 17:53:50 +0100, Martin Simmons said:
> 
> Ah, it looks like query 2 will list up to 5 lines for jobs that span more 
> than
> one volume, so that is not suspicious after all.
> 
> Do you have any non-ASCII characters in the path (I assume "someuser" is a
> manual edit)?
> 
> __Martin
> 
> 
> > On Wed, 17 Apr 2019 16:59:29 +0200, Christoph Litauer said:
> >> 
> >> Hi Martin,
> >> 
> >> thanks for the suggestions.
> >> The job is about 161GB and spans more than one "File"-volume. "list 
> >> jobmedia jobid=1100162" gives all the index numbers for all mentioned 
> >> volumes. And a query 7 gives:
> >> 
> >> Choose a query (1-20): 7
> >> Enter JobId: 1100162
> >> +---++
> >> | jobid | volumename |
> >> +---++
> >> | 1,100,162 | File-2110  |
> >> | 1,100,162 | File-2885  |
> >> | 1,100,162 | File-1828  |
> >> | 1,100,162 | File-2598  |
> >> | 1,100,162 | File-2188  |
> >> | 1,100,162 | File-1157  |
> >> | 1,100,162 | File-1500  |
> >> | 1,100,162 | File-1107  |
> >> | 1,100,162 | File-1995  |
> >> +---++ 
> >> 
> >> My retention time for differentials is about 3 month. I use postgres.
> >> 
> >> Everything seems to be ok. Will investigate further.
> >> 
> >>> Am 12.04.2019 um 16:21 schrieb Martin Simmons :
> >>> 
> >>> Thq query output looks suspicious to me -- do you expect the file to 
> >>> be stored
> >>> 5 times in the same job?
> >>> 
> >>> It might be interesting to see the output from "list jobmedia 
> >>> jobid=1100162" and
> >>> query 7 (List Volumes used by selected JobId) for 1100162.
> >>> 
> >>> If you are using mysql, then I suggest running mysqlcheck abd 
> >>> myisamchk if
> >>> appropriate.
> >>> 
> >>> Also, I assume 

Re: [Bacula-users] Is there a test for LTO-4 tapes or just pull them from service?

2019-05-07 Thread Dan Langille
On Mon, May 6, 2019, at 10:46 PM, John R Zoch wrote:
> I'm running Bacula 9.4.2 on an FreeNAS 11.2-U3 in an iocage jail. Attached is 
> an image from bat indicating a bunch of failed tapes. They passed the rewind 
> - write EOF test. 
> 

The rewind-write EOF test is more a test of Bacula and the tape drive, not of 
the tape itself.

That image from BAT shows the status of that tape in the Catalog. The Error 
could be for reasons other than a bad tape.

To know for sure, you need to look at the job email, or the bacula log on the 
system itself (provided there is one).

> 
> Is there something I should try to make them usable again (a test/format of 
> sorts) or is the Bacula error indication sufficient that I should just pull 
> them from service?
> 
> I've used "btape qfill" in the past but it only tests the first tape in the 
> library. I'm not certain qfill verifies the data it wrote to the tape to 
> provide some assurance that the tape is good.

Show us some of these errors and we'll know for sure if it's a tape error. It 
could be drive loading error. It wanted tape X but couldn't load it, for 
whatever reason.___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Fwd: Is there a test for LTO-4 tapes or just pull them from service?

2019-05-07 Thread Adam Nielsen
> They passed the rewind - write EOF test.   Is there something I should try
> to make them usable again (a test/format of sorts) or is the Bacula error
> indication sufficient that I should just pull them from service?

Normally LTO tapes don't get write errors as the drive rewrites any
failed blocks automatically, so all you see is your write speeds
dropping and in bad cases the total capacity of the tape decreasing.

Best thing would be to run the diagnostic utility from your tape drive
manufacturer, as these are extremely detailed and will tell you whether
the tape is at fault or if it's an issue with the drive.  Not sure
about the IBM utility but the HP one will let you test individual
tapes to confirm they are good and will even let you pull the log files
from the drive that the firmware writes, which can be quite useful in
diagnosing a fault.  (It was here I found messages about the head not
moving the expected distance which led me to disassemble a failing LTO5
drive[1] to clean the head mechanism and get the drive back in service).

I'm assuming you've done the obvious and used a cleaning tape recently
of course.

Cheers,
Adam.

[1]: Just in case anyone is curious, I took photos of the disassembly
and repair process: 
http://sbfmdrv.blogspot.com/2018/11/disassembling-and-cleaning-lto-tape.html


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Fwd: Is there a test for LTO-4 tapes or just pull them from service?

2019-05-07 Thread John R Zoch
 I'm running Bacula 9.4.2 on an FreeNAS 11.2-U3 in an iocage jail.   I'm
getting errors on several tapes.

| 338 | A00023 | Full  |   1 | 847,217,645,568 |   70
|   15,638,400 |   1 |   23 | 1 | LTO-4 |   2 |
0 | 2019-03-03 13:18:23 | 10,040,574 |
| 339 | A00024 | Error |   1 | 785,102,846,976 |  153
|   15,638,400 |   1 |   24 | 1 | LTO-4 |   2 |
0 | 2019-03-07 23:10:06 | 10,421,677 |
| 340 | A00025 | Full  |   1 | 848,304,156,672 |  213
|   15,638,400 |   1 |   25 | 1 | LTO-4 |   2 |
0 | 2019-03-19 01:04:24 | 11,378,935 |
| 341 | A00026 | Error |   1 |  12,471,266,304 |   16
|   15,638,400 |   1 |   26 | 1 | LTO-4 |   2 |
0 | 2019-03-07 19:56:07 | 10,410,038 |
| 342 | A00027 | Full  |   1 |  10,147,673,088 |9
|   15,638,400 |   1 |   27 | 1 | LTO-4 |   2 |
0 | 2019-03-10 19:24:46 | 10,667,357 |
| 343 | A00028 | Error |   1 |   4,322,304 |   12
|   15,638,400 |   1 |   28 | 1 | LTO-4 |   2 |
0 | 2019-03-10 19:58:52 | 10,669,403 |
| 344 | A00029 | Full  |   1 | 848,026,238,976 |  267
|   15,638,400 |   1 |   29 | 1 | LTO-4 |   2 |
0 | 2019-04-11 19:58:53 | 13,434,204 |
| 345 | A00030 | Full  |   1 | 848,468,210,688 |   75
|   15,638,400 |   1 |   30 | 1 | LTO-4 |   2 |
0 | 2019-03-19 02:44:48 | 11,384,959 |
| 346 | A00031 | Full  |   1 | 847,320,993,792 |  275
|   15,638,400 |   1 |   31 | 1 | LTO-4 |   2 |
0 | 2019-04-27 01:58:36 | 14,751,787 |
| 347 | A00032 | Error |   1 | 188,181,310,464 |  184
|   15,638,400 |   1 |   32 | 1 | LTO-4 |   2 |
0 | 2019-04-12 19:37:36 | 13,519,327 |
| 348 | A00033 | Error |   1 |  17,550,360,576 |9
|   15,638,400 |   1 |   33 | 1 | LTO-4 |   2 |
0 | 2019-04-17 00:07:39 | 13,881,130 |
| 349 | A00034 | Full  |   1 | 839,806,636,032 |  103
|   15,638,400 |   1 |   34 | 1 | LTO-4 |   2 |
0 | 2019-05-01 03:10:02 | 15,101,673 |

They passed the rewind - write EOF test.   Is there something I should try
to make them usable again (a test/format of sorts) or is the Bacula error
indication sufficient that I should just pull them from service?

I've used "btape qfill" in the past but it doesn't let me specify which
tape to fill.  It only tests the first tape in the library.   I'm not even
certain qfill verifies the data it wrote to the tape to provide some
assurance that the tape is good.

Thanks,

John Zoch
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Query for "most recent copies of a file"

2019-05-07 Thread Christoph Litauer
Sorry for the long delay, had holidays ...

That seems to be the explanation. I use accurate for all my backups. Your 
command lists cyrus.header as deleted. As a result "restore" doesn't list the 
parent directory.

But 
- should option 2 really find deleted files?
- how do I find the last _not_ deleted version of a file?

> Am 25.04.2019 um 17:19 schrieb Martin Simmons :
> 
> Here's another possible problem: query 2 gives the wrong results if you are
> using "accurate" backups and have deleted files.
> 
> Try
> 
> echo "list files type=deleted jobid=1100162" | bconsole | grep 
> someuser/Transkriptionen
> 
> to see if that directory was deleted.
> 
> __Martin
> 
> 
>> On Thu, 18 Apr 2019 13:13:20 +0100, Martin Simmons said:
>> 
>> Yes, I think commands 2 and 3 should be successful because command 1 is
>> successful.
>> 
>> Is the path entirely ASCII?  Is "someuser" the real name?
>> 
>> You could try
>> 
>> (echo "restore"; echo 3; echo 1100162; echo "cd /var") | bconsole
>> (echo "restore"; echo 3; echo 1100162; echo "cd /var/spool") | bconsole
>> (echo "restore"; echo 3; echo 1100162; echo "cd /var/spool/imap") | bconsole
>> 
>> etc to see which directory is invalid.
>> 
>> __Martin
>> 
>> 
>> On Thu, 18 Apr 2019 13:43:11 +0200, Christoph Litauer said:
>>> 
>>> Dubious ...
>>> 
>>> # (echo "query"; echo 12; echo 1100162) | bconsole | grep someuser/ | grep 
>>> cyrus.header
>>> | /var/spool/imap/d/user/someuser/Transkriptionen/  
>>>   | cyrus.header   |
>>> 
>>> # echo "list files jobid=1100162" | bconsole | grep someuser/Transkriptionen
>>> 
>>> 
>>> # (echo "restore"; echo 3; echo 1100162; echo "cd 
>>> /var/spool/imap/d/user/someuser/Transkriptionen") | bconsole
>>> ...
>>> Invalid path given.
>>> ...
>>> 
>>> 
>>> In my opinion all 3 commands should be successful? 
>>> 
 Am 18.04.2019 um 11:39 schrieb Martin Simmons :
 
 You could also check with query 12 (List Files for a selected JobId) to 
 see if
 that lists your files.
 
 __Martin
 
> On Wed, 17 Apr 2019 17:53:50 +0100, Martin Simmons said:
> 
> Ah, it looks like query 2 will list up to 5 lines for jobs that span more 
> than
> one volume, so that is not suspicious after all.
> 
> Do you have any non-ASCII characters in the path (I assume "someuser" is a
> manual edit)?
> 
> __Martin
> 
> 
> On Wed, 17 Apr 2019 16:59:29 +0200, Christoph Litauer said:
>> 
>> Hi Martin,
>> 
>> thanks for the suggestions.
>> The job is about 161GB and spans more than one "File"-volume. "list 
>> jobmedia jobid=1100162" gives all the index numbers for all mentioned 
>> volumes. And a query 7 gives:
>> 
>> Choose a query (1-20): 7
>> Enter JobId: 1100162
>> +---++
>> | jobid | volumename |
>> +---++
>> | 1,100,162 | File-2110  |
>> | 1,100,162 | File-2885  |
>> | 1,100,162 | File-1828  |
>> | 1,100,162 | File-2598  |
>> | 1,100,162 | File-2188  |
>> | 1,100,162 | File-1157  |
>> | 1,100,162 | File-1500  |
>> | 1,100,162 | File-1107  |
>> | 1,100,162 | File-1995  |
>> +---++ 
>> 
>> My retention time for differentials is about 3 month. I use postgres.
>> 
>> Everything seems to be ok. Will investigate further.
>> 
>>> Am 12.04.2019 um 16:21 schrieb Martin Simmons :
>>> 
>>> Thq query output looks suspicious to me -- do you expect the file to be 
>>> stored
>>> 5 times in the same job?
>>> 
>>> It might be interesting to see the output from "list jobmedia 
>>> jobid=1100162" and
>>> query 7 (List Volumes used by selected JobId) for 1100162.
>>> 
>>> If you are using mysql, then I suggest running mysqlcheck abd myisamchk 
>>> if
>>> appropriate.
>>> 
>>> Also, I assume you mean "list files jobid=1100162" (not job=1100162).
>>> 
>>> __Martin
>>> 
>>> 
>>> 
 On Fri, 12 Apr 2019 11:02:52 +0200, Christoph Litauer said:
>> 
>> Dear bacula users,
>> 
>> I am using bacula 9.0.4. I wonder about a strange effect:
>> 
>> Sometimes I get restore requests without a concrete timestamp. The users 
>> can't remember the time of removal. In these cases I use the bconsole 
>> query command, option 2 "List where the most recent copies of a file are 
>> saved". Example:
>> 
>> Choose a query (1-20): 2
>> /var/spool/imap/d/user/someuser/Transkriptionen/
>> Enter filename: cyrus.index
>> Enter Client name: imap1
>> +---+-+++
>> | jobid | jobstarttime| volumename | clientname |
>> +---+-+++
>> | 1,100,162 | 2019-03-27 00:07:01 | File-1107  | imap1  |
>> | 1,100,162 | 

Re: [Bacula-users] Baculum Prado\Exceptions\TPhpFatalErrorException

2019-05-07 Thread Elias Pereira
Hello Marcin,

Thanks for the feedback and the patch!!!

>> The purest truth in your signature!!! :D


On Tue, May 7, 2019 at 12:41 AM Marcin Haba  wrote:

> Hello Jose and Elias,
>
> Thanks for reporting this problem.
>
> It happens only with old PHP < 5.5 because in those versions empty()
> function doesn't support expressions. Usually CentOS 7 users can
> experience this bug as in this distribution is PHP 5.4.
>
> In attachment I am sending patch that fixes it for you and for other users.
>
> Best regards.
> Marcin Haba (gani)
>
> On Tue, 7 May 2019 at 04:47, Elias Pereira  wrote:
> >
> > Hello Jose,
> >
> > Happened to me too! The principle does not seem to be errors, but
> warnings.
> >
> > I added ~E_WARNING on line 445 (error_reporting = E_ALL & ~E_DEPRECATED
> & ~E_STRICT & ~E_WARNING) from the file /etc/php/7.0/apache2/php.ini and
> resolved.
> >
> > On Mon, May 6, 2019 at 5:50 PM Jose Alberto  wrote:
> >>
> >> Hi.
> >>
> >> i have  bacula 9.4.2  and baculum 9.4.3  on Centos 7 amd64.
> >>
> >> The Baculum problem  when Actions menu on Jobs
> >>
> >> Baculum Menu... Jobs.Colum Actions   "Details"
> >>
> >> the rest without problem
> >>
> >> Log:
> >>
> >> Prado\Exceptions\TPhpFatalErrorException
> >> Description
> >> [Compile Error] Can't use method return value in write context (@line 1
> in file
> /usr/share/baculum/htdocs/framework/pradosoft/prado/framework/TComponent.php(1229)
> : eval()'d code).
> >>
> >> Source File
> >>
> /usr/share/baculum/htdocs/framework/pradosoft/prado/framework/PradoBase.php
> (193)
> >>
> >> 0182:  * PHP shutdown function used to catch fatal errors.
> >> 0183:  * This method should be registered as PHP error handler using
> >> 0184:  * {@link register_shutdown_function}. The method throws an
> exception that
> >> 0185:  * contains the error information.
> >> 0186:  */
> >> 0187: public static function phpFatalErrorHandler()
> >> 0188: {
> >> 0189: $error = error_get_last();
> >> 0190: if ($error &&
> >> 0191: TPhpErrorException::isFatalError($error) &&
> >> 0192: error_reporting() & $error['type']) {
> >> 0193: self::exceptionHandler(new
> TPhpFatalErrorException($error['type'], $error['message'], $error['file'],
> $error['line']));
> >> 0194: }
> >> 0195: }
> >> 0196:
> >> 0197: /**
> >> 0198:  * Default exception handler.
> >> 0199:  * This method should be registered as default exception
> handler using
> >> 0200:  * {@link set_exception_handler}. The method tries to use the
> errorhandler
> >> 0201:  * module of the Prado application to handle the exception.
> >> 0202:  * If the application or the module does not exist, it simply
> echoes the
> >> 0203:  * exception.
> >> 0204:  * @param Exception $exception exception that is not caught
> >> 0205:  */
> >>
> >> Stack Trace
> >> #0 [internal function]: Prado\PradoBase::phpFatalErrorHandler()
> >> #1 {main}
> >>
> >> --
> >> #
> >> #   Sistema Operativo: Debian  #
> >> #Caracas, Venezuela  #
> >> #
> >> ___
> >> Bacula-users mailing list
> >> Bacula-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/bacula-users
> >
> >
> >
> > --
> > Elias Pereira
> > ___
> > Bacula-users mailing list
> > Bacula-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bacula-users
>
>
>
> --
> "Greater love hath no man than this, that a man lay down his life for
> his friends." Jesus Christ
>
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
> za przyjaciół swoich." Jezus Chrystus
>


-- 
Elias Pereira
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Does bacula schedule cleaning by default?

2019-05-07 Thread Adam Nielsen
> I am looking for a way the system can work with
> bacula so that clean up scheduling happen automatically.  IS it
> possible also to know if their has been cleaning in the past from
> bacula's perspective?   Would really appreciate any lead

I had to modify the autoloader script to enable LTO encryption after
loading each tape, so this script is already called every time Bacula
wants a tape loaded.

I imagine you could add some commands to this same script to check
whether the drive is requesting cleaning, and if so, load a cleaning
tape, wait until it's ejected, then load the tape originally requested
and continue.

This way Bacula wouldn't notice anything except once in a while it
takes much longer than normal to load a tape, but the cleaning tape
would be automatically used as needed.

Having said that, my library (an old HP unit that came with an LTO3
drive) can be set to automatically load a cleaning tape when the drive
requests one, so I imagine most tape libraries have this functionality
in them somewhere.

Cheers,
Adam.


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Does bacula schedule cleaning by default?

2019-05-07 Thread Gary R. Schmidt

On 07/05/2019 08:37, William Muriithi wrote:

Hello,

I noticed today that the tape hardware - Quantum Superloader 3 - had a warning 
that the tape head needs cleaning and that got me surprised.  We already have a 
cleaner tape on the system and had always assumed this is happening already.

How would one go about doing this?  Yes, I know I can kill all the jobs, umount 
the current tape and mount the cleaner tape but this looks a bit rough.  I am 
looking for a way the system can work with bacula so that clean up scheduling 
happen automatically.  IS it possible also to know if their has been cleaning 
in the past from bacula's perspective?   Would really appreciate any lead

You don't need to kill any jobs - unless they run 24/7 - wait until 
Bacula is idle, load the cleaning tape, then come back in a while and 
unload it.


You might be able to configure the autoloader to load the cleaning tape 
when necessary, as well.


You could schedule Bacula to load the cleaning tape every so often, but 
that's not considered a good idea, only clean the drive when the 
blinkenlight comes on  :-)


Cheers,
GaryB-)


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Does bacula schedule cleaning by default?

2019-05-07 Thread William Muriithi
Hello,

I noticed today that the tape hardware - Quantum Superloader 3 - had a warning 
that the tape head needs cleaning and that got me surprised.  We already have a 
cleaner tape on the system and had always assumed this is happening already.

How would one go about doing this?  Yes, I know I can kill all the jobs, umount 
the current tape and mount the cleaner tape but this looks a bit rough.  I am 
looking for a way the system can work with bacula so that clean up scheduling 
happen automatically.  IS it possible also to know if their has been cleaning 
in the past from bacula's perspective?   Would really appreciate any lead

*list volume=CLN005L1
+-++---+-+--+--+--+-+--+---+---+-+
| MediaId | VolumeName | VolStatus | Enabled | VolBytes | VolFiles | 
VolRetention | Recycle | Slot | InChanger | MediaType | LastWritten |
+-++---+-+--+--+--+-+--+---+---+-+
|  75 | CLN005L1   | Cleaning  |   1 |0 |0 |
3,456,000 |   1 |0 | 0 |   | -00-00 00:00:00 |
+-++---+-+--+--+--+-+--+---+---+-+
*
 
Regards,
William

___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users