[Bacula-users] Bacula requesting un-needed tape for restore.

2020-11-26 Thread Rasmus Linden
Hi All fellow bacula fans and users :)

I have been running bacula for more that 10 years, and have always been very 
happy with it.
Especially troubleshooting and getting help when running into issues has been 
quite accessible.
And baculum is just great :)

Currently I am seeing an issue I have never encounter before, and thought I 
would ask on the group, if anybody has any idea on what could cause this.
I have roughly 1 year ago helped a client upgrade from bacula 5 to bacula 9.4.4.
The upgrade itself went fine, dumped the sql database, from one system, 
restored it on another updated one, and ran the database updater, no problems 
there at all.
However now, when they do a restore, bacula initially asks for a wrong tape, 
most often off by 1. When bacula mounts the tape with the unneeded number, it 
then requests the tape needed for the restore.

Does any of you have a good suggestion on how to go about troubleshooting this, 
have any of you seen anything similar ?

All the best

Rasmus



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


Re: [Bacula-users] Authentication at Baculum

2020-01-04 Thread Rasmus Linden
Hi Ricardo!
I have baculum ( or its actually apache doing the lifting) authenticate against 
my companies ldap server.
Works like a charm, highly recommendable solution.
All the best
Ras


> On 5 Jan 2020, at 5:47 am, Marcin Haba  wrote:
> 
> Hello Ricardo,
> 
> Yes, it is possible to disable Auth Basic in Baculum Web. To do that
> you need to disable Auth Basic in your web server config file for
> Baculum Web and then you need to do a workaround in code by defining
> default Baculum Web user in gui/baculum/protected/Web/Init.php file,
> somewhere at the beginning of this file, for example:
> 
> $_SERVER['PHP_AUTH_USER'] = 'admin';
> $_SERVER['PHP_AUTH_PW'] = 'admin';
> 
> This way Baculum Web will default use this user/pass to work without Auth 
> Basic.
> 
> For other methods, unfortunately HTML form nor OAuth2 for Baculum Web
> are not supported.
> 
> I hope it helps.
> 
> Best regards,
> Marcin Haba (gani)
> 
> On Sat, 4 Jan 2020 at 00:32, Ricardo Aragão da Silva
>  wrote:
>> 
>> Hi guys,
>> 
>> Someone knows if is possible disable Auth Basic of the Baculum or change for 
>> other Auth type, like HTML form, for example ? Or use oauth2 to auth to web?
>> 
>> Thanks
>> 
>> Ricardo
>> 
>> ___
>> 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
> 
> 
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users



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


[Bacula-users] Label Missing / Broken tape

2018-10-25 Thread Rasmus Linden
Hi List !
I have a pretty nasty issue here, we had a robot reboot itself while bacula 
believed the tape was parked at a n file, so bacula kept appending to the tape, 
even though the tape got rewound.
(We believe)
So when we try mounting the tape we get:
24-Oct 14:08 technicos.xxx-sd JobId 3001: Warning: acquire.c:279 Read acquire: 
Could not unserialize Volume label: ERR=label.c:977 Expecting Volume Label, got 
FI=16558 Stream=DATA len=36604

Does anybody here have any suggestions on how I could read the tape from the 
beginning, and see what data is salvageable  ?

Thanks for your time !

Ras



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


Re: [Bacula-users] Bacula9 label barcode into scratch pool crashes bacula-dir

2018-05-21 Thread Rasmus Linden
Martin you rock !

I took the cleaning tape definition out of the pool , and now i can label to 
the scratch pool.
Thanks so much.
I wonder if i misunderstood the cleaning prefix key.

All the best, and thanks again

Ras



POOL BEFORE EDIT
Pool {
  Name = ProjectsArchive
  Pool Type = Backup
  Recycle = no
  AutoPrune = no
  Cleaning Prefix = "CLN"
  Volume Retention = 30 years
  File Retention = 30 years
  Job Retention = 30 years
  ScratchPool = Scratch
}

> On 21 May 2018, at 13:02, Martin Simmons <mar...@lispworks.com> wrote:
> 
> The traceback suggests some problem in the is_cleaning_tape function.
> 
> It might be useful to do
> 
> gdb /opt/bacula/bin/bacula-dir
> disass is_cleaning_tape
> 
> __Martin
> 
> 
>>>>>> On Sun, 20 May 2018 17:15:40 +0200, Rasmus Linden said:
>> 
>> Hey All !!
>> 
>> I have a strange issue, I hope some of you can help me with. I am currently 
>> running bacula version: 9.0.7, recently migrated from mysql to postgres.
>> Everything is working as expected, except when i try to table a tape and 
>> stick it in our scratch pool, bacula-dir crashes with a bang !
>> I have set the debug level to 10, and pasted the traceback.
>> The last thing happening before the crash, according to the stack is a sql 
>> query :
>> 
>> SELECT 
>> MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,VolBytes,VolABytes,VolHoleBytes,VolHoles,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJ
>> obs,MaxVolFiles,Recycle,Slot,FirstWritten,LastWritten,InChanger,EndFile,EndBlock,VolType,VolParts,VolCloudParts,LastPartBytes,LabelType,LabelDate,StorageId,Enabled,LocationId,RecycleCount,InitialWrite,ScratchPoolId,RecyclePoolId
>> ,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention FROM Media WHERE 
>> VolumeName=‘B00110L6'
>> 
>> I have tried running the query by hand, and it does not fail *screenshot 
>> from pgadmin attached.
>> 
>> If i label the volume and stick it into a none scratch pool, it completes 
>> with no error.
>> 
>> Any suggestion on how to fix is mostly appreciated !
>> 
>> All the best
>> 
>> Ras
>> 
>> 
>> 
>> BCONSOLE FAILING IN SCRATCH POOL:
>> [root@technicos ~]# bconsole 
>> Connecting to Director technicos:9101
>> 1000 OK: 103 director.xxx.xxxVersion: 9.0.7 (18 April 2018)
>> Enter a period to cancel a command.
>> *label barcodes slots=3
>> Automatically selected Catalog: MyCatalog
>> Using Catalog "MyCatalog"
>> The defined Storage resources are:
>> 1: Autochanger
>> 2: LTO6-01
>> Select Storage resource (1-2): 1
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> 3306 Issuing autochanger "slots" command.
>> Device "Autochanger" has 48 slots.
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> 3306 Issuing autochanger "list" command.
>> The following Volumes will be labeled:
>> Slot  Volume
>> ==
>>   3  B00110L6
>> Do you want to label these Volumes? (yes|no): yes
>> Defined Pools:
>> 1: Archive
>> 2: Default
>> 3: File
>> 4: ProjectsArchive
>> 5: Scratch
>> Select the Pool (1-5): 5
>> [root@technicos ~]# 
>> 
>> 
>> CONSOLE SUCCESS WITH ANOTHER POOL:
>> *label barcodes slots=3
>> Automatically selected Catalog: MyCatalog
>> Using Catalog "MyCatalog"
>> The defined Storage resources are:
>> 1: Autochanger
>> 2: LTO6-01
>> Select Storage resource (1-2): 1
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> 3306 Issuing autochanger "slots" command.
>> Device "Autochanger" has 48 slots.
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> 3306 Issuing autochanger "list" command.
>> The following Volumes will be labeled:
>> Slot  Volume
>> ==
>>   3  B00110L6
>> Do you want to label these Volumes? (yes|no): yes
>> Defined Pools:
>> 1: Archive
>> 2: Default
>> 3: File
>> 4: ProjectsArchive
>> 5: Scratch
>> Select the Pool (1-5): 4
>> Connecting to Storage daemon Autochanger at technicos.xxx:9103 ...
>> Sending label command for Volume "B00110L6" Slot 3 ...
>> 3307 Issuing autochanger "unload Volume *Unknown*, S

Re: [Bacula-users] Bacula9 label barcode into scratch pool crashes bacula-dir

2018-05-20 Thread Rasmus Linden
Hi Heitor !
Yes i did, but for good measure, just did it again, no success :(
All the best
Ras
[root@technicos /]# /opt/bacula/etc/bacula restart
Stopping the Bacula File daemon
Stopping the Bacula Storage daemon
Stopping the Bacula Director daemon
Starting the Bacula Storage daemon
Starting the Bacula File daemon
Starting the Bacula Director daemon
[root@technicos /]# bcons
bash: bcons: command not found...
[root@technicos /]# bconsole
Connecting to Director technicos:9101
1000 OK: 103 director.x Version: 9.0.7 (18 April 2018)
Enter a period to cancel a command.
*label barcodes slot=4
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
The defined Storage resources are:
 1: Autochanger
 2: LTO6-01
Select Storage resource (1-2): 1
Connecting to Storage daemon Autochanger at technicos.x:9103 ...
Connecting to Storage daemon Autochanger at technicos.x:9103 ...
3306 Issuing autochanger "slots" command.
Device "Autochanger" has 48 slots.
Connecting to Storage daemon Autochanger at technicos.x:9103 ...
3306 Issuing autochanger "list" command.
The following Volumes will be labeled:
Slot  Volume
==
   4  B00111L6
Do you want to label these Volumes? (yes|no): yes
Defined Pools:
 1: Archive
 2: Default
 3: File
 4: ProjectsArchive
 5: Scratch
Select the Pool (1-5): 5

And boom :(

> On 20 May 2018, at 17:37, Heitor Faria  wrote:
> 
> Hey All !!
> Hello Rasmus,
> I have a strange issue, I hope some of you can help me with. I am currently 
> running bacula version: 9.0.7, recently migrated from mysql to postgres.
> Everything is working as expected, except when i try to table a tape and 
> stick it in our scratch pool, bacula-dir crashes with a bang !
> I have set the debug level to 10, and pasted the traceback.
> Did you restart the storage daemon after the upgrade?
> Running Director and Storage with different versions usually provokes crashes 
> like this one.
> 
> Regards,
> -- 
> Heitor Medrado de Faria | EB-1 Visa | LPIC-III | ITIL-F | EMC 05-001
> • Check my Bacula Book at Amazon.com http://bacula.us/book 
> 
> • Do you need Bacula training? http://bacula.us/video-classes/ 
> 
> • USA +1 (323) 300-5387 | Brazil  +55 (61) 98268-4220 | http://bacula.us 
> 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Baculum - Grouping error: 7 ERROR: column "media.volumename" ...

2018-05-16 Thread Rasmus Linden
Hi Marcin !
Thanks a bunch, works a charm 
A quick note, I’m currently in German, on timezone Europe/Berlin.
If i do not set a timezone definition in php.ini, the java script for choosing 
files does not work, and logs a error to console warning about having to set a 
timezone, and not relying on default.

And a big thanks again for helping me out, very very much appreciated.

All the best

Ras

 
> On 15 May 2018, at 21:46, Marcin Haba <ganius...@gmail.com> wrote:
> 
> Hello Rasmus,
> 
> Thanks for reporting this problem.
> 
> It is a bug that will be fixed in the next Baculum version.
> 
> In attachment I added patch that fixes it.
> 
> Best regards.
> Marcin Haba (gani)
> 
> On 14 May 2018 at 15:07, Rasmus Linden <rasmus.linden...@gmail.com> wrote:
>> Hey All!
>> Im a long time bacula user, and finally got myself updated to v9.0.7, and i
>> have run into a issue with baculum i just cannot figure out how to solve.
>> I have everything working, except restoring using baculm. -bat and bconsole
>> works with no issues.
>> 
>> When i have chosen files to restore, and click next, i get a sql error :
>> 
>> Baculum problem
>> Error 100 - Problem with connection to remote host. cURL error 0: .
>> 
>> SQLSTATE[42803]: Grouping error: 7 ERROR: column "media.volumename" must
>> appear in the GROUP BY clause or be used in an aggregate function LINE 2:
>> SELECT VolumeName, InChanger, MIN(FirstIndex) as first_in... ^
>> 
>> 
>> 0083: $connection = VolumeRecord::finder()->getDbConnection();
>> 0084: $connection->setActive(true);
>> 0085: $sql = sprintf('SELECT first_index, last_index, VolumeName AS
>> volname, InChanger AS inchanger FROM (
>> 0086:  SELECT VolumeName, InChanger, MIN(FirstIndex) as first_index,
>> MAX(LastIndex) as last_index
>> 0087:  FROM JobMedia JOIN Media ON (JobMedia.MediaId =
>> Media.MediaId)
>> 0088:  WHERE JobId = %d GROUP BY (VolumeName, InChanger)
>> 0089: ) AS gv, File
>> 0090:  WHERE FileIndex >= first_index
>> 0091:  AND FileIndex <= last_index
>> 0092:  AND File.FileId = %d', $jobid, $fileid);
>> 0093: $pdo = $connection->getPdoInstance();
>> 0094: $result = $pdo->query($sql);
>> 0095: $ret = $result->fetchAll();
>> 0096: $pdo = null;
>> 0097: $volumes = array();
>> 0098: if (is_array($ret)) {
>> 0099: for ($i = 0; $i < count($ret); $i  ) {
>> 0100: $volumes[] = array(
>> 0101: 'first_index' => $ret[$i]['first_index'],
>> 0102: 'last_index' => $ret[$i]['last_index'],
>> 0103: 'volume' => $ret[$i]['volname'],
>> 0104: 'inchanger' => $ret[$i]['inchanger']
>> 0105: );
>> 0106: }
>> 
>> 
>> I started out with a quite large MySql database, but for troubleshooting, i
>> am running a clean posgress database.
>> Os is CentOS Linux release 7.5.1804 (Core)
>> 
>> Anybody got any good ideas ??
>> 
>> All the best
>> 
>> Ras
>> 
>> 
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> 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
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Baculum - Grouping error: 7 ERROR: column "media.volumename" ...

2018-05-14 Thread Rasmus Linden
Hey All!
Im a long time bacula user, and finally got myself updated to v9.0.7, and i 
have run into a issue with baculum i just cannot figure out how to solve.
I have everything working, except restoring using baculm. -bat and bconsole 
works with no issues.

When i have chosen files to restore, and click next, i get a sql error :

Baculum problem
Error 100 - Problem with connection to remote host. cURL error 0: .

SQLSTATE[42803]: Grouping error: 7 ERROR: column "media.volumename" must appear 
in the GROUP BY clause or be used in an aggregate function LINE 2: SELECT 
VolumeName, InChanger, MIN(FirstIndex) as first_in... ^


0083: $connection = VolumeRecord::finder()->getDbConnection();
0084: $connection->setActive(true);
0085: $sql = sprintf('SELECT first_index, last_index, VolumeName AS 
volname, InChanger AS inchanger FROM (
0086:  SELECT VolumeName, InChanger, MIN(FirstIndex) as first_index, 
MAX(LastIndex) as last_index
0087:  FROM JobMedia JOIN Media ON (JobMedia.MediaId = Media.MediaId)
0088:  WHERE JobId = %d GROUP BY (VolumeName, InChanger)
0089: ) AS gv, File
0090:  WHERE FileIndex >= first_index
0091:  AND FileIndex <= last_index
0092:  AND File.FileId = %d', $jobid, $fileid);
0093: $pdo = $connection->getPdoInstance();
0094: $result = $pdo->query($sql);
0095: $ret = $result->fetchAll();
0096: $pdo = null;
0097: $volumes = array();
0098: if (is_array($ret)) {
0099: for ($i = 0; $i < count($ret); $i  ) {
0100: $volumes[] = array(
0101: 'first_index' => $ret[$i]['first_index'],
0102: 'last_index' => $ret[$i]['last_index'],
0103: 'volume' => $ret[$i]['volname'],
0104: 'inchanger' => $ret[$i]['inchanger']
0105: );
0106: }

I started out with a quite large MySql database, but for troubleshooting, i am 
running a clean posgress database.
Os is CentOS Linux release 7.5.1804 (Core) 

Anybody got any good ideas ??

All the best

Ras
 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users