Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Phil Stracchino

On 12/26/21 12:59, Josip Deanovic wrote:

When using MySQL roles and grant statement to change privileges, the
command "flush privileges" is not necessary but it doesn't hurt.
When modifying mysql/user and similar tables then it is necessary to
issue "flush privileges" in order to re-read and apply changes made to
the tables.



Never hurts to be sure.  You will never cause a problem by calling FLUSH 
PRIVILEGES when you didn't need to.




Unfortunately, many years ago KDE PIM application suite moved to
akonadi which uses and manages its own mysql instance. That made
it awfully slow and unstable, hard to debug and understand and even
harder to trace the problem and fix but the wheel of "progress"
doesn't care much about functionality.


I totally hear you.  Prime case in point:  systemd.



Also, you mentioned "embedded instance" but I am not sure if this
can be called embedded instance because the there is an actual
mysql daemon running. It just uses dedicated config file and datadir.


Embedded as in "the application sets up its own dedicated mysql instance 
that it assumes nothing else will use".



--
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Josip Deanovic

On 2021-12-26 18:19, Phil Stracchino wrote:

If so:

mysql> GRANT ALL PRIVILEGES ON bacula.* TO 'bacula'@'localhost' (or
whatever DB user you want bacula to connect as) IDENTIFIED BY 'bacula
password goes here';

mysql> FLUSH PRIVILEGES;


When using MySQL roles and grant statement to change privileges, the
command "flush privileges" is not necessary but it doesn't hurt.
When modifying mysql/user and similar tables then it is necessary to
issue "flush privileges" in order to re-read and apply changes made to
the tables.


If there is not an existing user for bacula, run the same command, but
make up a new username.  (For sanity's sake I suggest using 'bacula',
then you'll never be in any doubt what it is.)


Then go back into your Bacula director config, set the mysql
credentials to what you just set above, restart the Director, and try
again.



KMail/akonadi is a separate issue.  I'm not a fan of services that set
up their own embedded mysql instances.  Multiple mysql (or most other
database) instances running on the same host will ALWAYS, *ALWAYS*,
perform worse, for all services, than a single properly tuned instance
utilizing the same resources.


Unfortunately, many years ago KDE PIM application suite moved to
akonadi which uses and manages its own mysql instance. That made
it awfully slow and unstable, hard to debug and understand and even
harder to trace the problem and fix but the wheel of "progress"
doesn't care much about functionality.

Also, you mentioned "embedded instance" but I am not sure if this
can be called embedded instance because the there is an actual
mysql daemon running. It just uses dedicated config file and datadir.

MySQL used to support embedded instance which meant that you could
access your data without daemon running. This was a long time ago
and I don't know if such support still exists in MySQL. I remember
that the data file needed to be preallocated to about 32MB which was
too much for my purposes.
That's when I learned about SQLite and moved in different direction.


Regards!

--
Josip Deanovic


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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Josip Deanovic

On 2021-12-26 13:47, Graham Dicker wrote:

Thank you Josip this is very helpful. I have restored everything I had
tinkered with back to what it was, that is:

Removed specification of port and socket from /etc/my.cnf
Removed specification of port and socket from bacula-dir.conf

both of this were previously specifying the akonadi socket and port 
3306


now './bacula' start from a console as root puts this message in the 
log:


26-Dec 09:40 bacula-dir JobId 0: Fatal error: Could not open Catalog
"MyCatalog", database "bacula".

If I run mysql from a console as root then 'use bacula' succeeds and I 
can

access the tables but if i try the same thing as a normal user I get:

MariaDB [(none)]> use bacula;

KMail/akonadi behaviour is still not normal. I have to click the Kmail 
icon,
then the desktop, then KMail icon again to get it to start, and at 
least
the first time of collecting my POP3 email takes a lot longer than 
usual.


Graham


I see that my attempts to paste messages copied from a console window 
into an
email are not working as I expect. Trying again...The message above 
should

have read:

26-Dec 09:39 bacula-dir JobId 0: Fatal error: Could not open Catalog
"MyCatalog", database "bacula".
26-Dec 09:39 bacula-dir JobId 0: Fatal error: mysql.c:293 Unable to 
connect to

MySQL server.
Database=bacula User=bacula
MySQL connect failed either server not running or your authorization is
incorrect.
26-Dec 09:39 bacula-dir ERROR TERMINATION
Please correct configuration file: /opt/bacula/etc/bacula-dir.conf


Ok. So, leave akonadi to use its own mysql instance and don't use it
for anything else. This is the default setup on the Centos/RHEL and
I assume that Suse is doing the same in that regards.

So, you need to configure your separate (I would say normal) mysql 
service

which you can use for all your purposes (including bacula).

That would mean that you would need to configure your /etc/my.cnf
to point to the correct mysql data directory (e.g. 
datadir=/var/lib/mysql),
you would need to define either some socket (e.g. 
socket=/var/lib/mysql/mysql.sock)

or IP and port.

Then you would need to enable and start that service using the the
usual procedure that applies for you OS (probably using systemctl tool
as this is the most common thing these days, on Linux distributions).

Then you would need to create the database you plan to use for
bacula and its database user. After that you will need to populate
it with the bacula tables.
Be careful to use the correct credentials when connecting to the
database (make sure you are using the correct mysql service and
not the one dedicated to akonadi).

After that, you will need to reconfigure your bacula-dir.conf
the way it uses correct connection info and user credentials.


Regards!

--
Josip Deanovic


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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Phil Stracchino

On 12/26/21 07:47, Graham Dicker wrote:


I see that my attempts to paste messages copied from a console window into an
email are not working as I expect. Trying again...The message above should
have read:

26-Dec 09:39 bacula-dir JobId 0: Fatal error: Could not open Catalog
"MyCatalog", database "bacula".
26-Dec 09:39 bacula-dir JobId 0: Fatal error: mysql.c:293 Unable to connect to
MySQL server.
Database=bacula User=bacula
MySQL connect failed either server not running or your authorization is
incorrect.
26-Dec 09:39 bacula-dir ERROR TERMINATION
Please correct configuration file: /opt/bacula/etc/bacula-dir.conf



From all of the above it appears that your MySQL credentials are 
incorrectly configured.


You say you can log into the mysql instance as root.  Do this:

mysql> select user, host from mysql.user;

See if there is a bacula user or another such user that you created for 
your catalog database.  You should see something like:


+-+-+
| User| Host|
+-+-+
| alaric  | 10.24.32.%  |
| bacula  | 10.24.32.%  |
| books   | 10.24.32.%  |
...

If so:

mysql> GRANT ALL PRIVILEGES ON bacula.* TO 'bacula'@'localhost' (or 
whatever DB user you want bacula to connect as) IDENTIFIED BY 'bacula 
password goes here';


mysql> FLUSH PRIVILEGES;


If there is not an existing user for bacula, run the same command, but 
make up a new username.  (For sanity's sake I suggest using 'bacula', 
then you'll never be in any doubt what it is.)



Then go back into your Bacula director config, set the mysql credentials 
to what you just set above, restart the Director, and try again.




KMail/akonadi is a separate issue.  I'm not a fan of services that set 
up their own embedded mysql instances.  Multiple mysql (or most other 
database) instances running on the same host will ALWAYS, *ALWAYS*, 
perform worse, for all services, than a single properly tuned instance 
utilizing the same resources.



--
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Graham Dicker
On Sunday, 26 December 2021 10:42:58 GMT Graham Dicker wrote:
> On Saturday, 25 December 2021 17:18:56 GMT Josip Deanovic wrote:
> > On Friday 2021-12-24 13:32:42 Graham Dicker wrote:
> > > Thanks for the tip Phil, which I will bear in mind if I ever get Bacula
> > > working again as it should (and has done for the past 10 years or more).
> > > Up until about a year ago my workstation would boot itself up when
> > > woken by the motherboard timer and Bacula would start running as a
> > > service and do the necessary backups. The first thing that stopped
> > > working was the service. There seemed to be some problem with timing
> > > between Bacula and mysql. I got around it by dropping the service and
> > > using crontab to start mysql and Bacula in that order. Then a few
> > > months ago that started failing due to some disagreement between
> > > akonadi, Bacula and mysql as to where the mysql socket was and which
> > > port was to be used. I solved that by total surrender to akonadi and
> > > told Bacula to use the socket created by akonadi. Now I don't know
> > > what's gone wrong. KMail behaviour has also changed in the last few day
> > > also; I have to click on it twice to make it start up. I think OpenSuse
> > > 15.3 must have had some dodgy updates recently.
> > 
> > That would explain why your database disappeared. It seems that you
> > have been using mysql instance dedicated to akonadi service.
> > 
> > I don't know how things are setup on Suse but on Centos/RHEL, akonadi
> > service would by default bring up its own mysql instance, with its own
> > mysql config file and data directory. It would also use its own socket.
> > 
> > I wouldn't use that mysql instance for anything else but akonadi.
> > 
> > I strongly suggest that you configure and bring up normal mysql service
> > which can safely be used for bacula and other services as you se fit.
> > If configured correctly you will not lose your databases any more.
> > 
> > The timing between mysql and Bacula you have mentioned is likely caused
> > by the akonadi which starts its mysql instance and that happens only
> > during the graphical login or even after you start the "kontact" or
> > similar application such as "kmail".
> > 
> > 
> > Regards!
> 
> Thank you Josip this is very helpful. I have restored everything I had
> tinkered with back to what it was, that is:
> 
> Removed specification of port and socket from /etc/my.cnf
> Removed specification of port and socket from bacula-dir.conf
> 
> both of this were previously specifying the akonadi socket and port 3306
> 
> now './bacula' start from a console as root puts this message in the log:
> 
> 26-Dec 09:40 bacula-dir JobId 0: Fatal error: Could not open Catalog
> "MyCatalog", database "bacula".
> 
> If I run mysql from a console as root then 'use bacula' succeeds and I can
> access the tables but if i try the same thing as a normal user I get:
> 
> MariaDB [(none)]> use bacula;
> 
> KMail/akonadi behaviour is still not normal. I have to click the Kmail icon,
> then the desktop, then KMail icon again to get it to start, and at least
> the first time of collecting my POP3 email takes a lot longer than usual.
> 
> Graham

I see that my attempts to paste messages copied from a console window into an 
email are not working as I expect. Trying again...The message above should 
have read:

26-Dec 09:39 bacula-dir JobId 0: Fatal error: Could not open Catalog 
"MyCatalog", database "bacula".
26-Dec 09:39 bacula-dir JobId 0: Fatal error: mysql.c:293 Unable to connect to 
MySQL server.
Database=bacula User=bacula
MySQL connect failed either server not running or your authorization is 
incorrect.
26-Dec 09:39 bacula-dir ERROR TERMINATION
Please correct configuration file: /opt/bacula/etc/bacula-dir.conf





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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Graham Dicker
On Sunday, 26 December 2021 10:42:58 GMT Graham Dicker wrote:
> On Saturday, 25 December 2021 17:18:56 GMT Josip Deanovic wrote:
> > On Friday 2021-12-24 13:32:42 Graham Dicker wrote:
> > > Thanks for the tip Phil, which I will bear in mind if I ever get Bacula
> > > working again as it should (and has done for the past 10 years or more).
> > > Up until about a year ago my workstation would boot itself up when
> > > woken by the motherboard timer and Bacula would start running as a
> > > service and do the necessary backups. The first thing that stopped
> > > working was the service. There seemed to be some problem with timing
> > > between Bacula and mysql. I got around it by dropping the service and
> > > using crontab to start mysql and Bacula in that order. Then a few
> > > months ago that started failing due to some disagreement between
> > > akonadi, Bacula and mysql as to where the mysql socket was and which
> > > port was to be used. I solved that by total surrender to akonadi and
> > > told Bacula to use the socket created by akonadi. Now I don't know
> > > what's gone wrong. KMail behaviour has also changed in the last few day
> > > also; I have to click on it twice to make it start up. I think OpenSuse
> > > 15.3 must have had some dodgy updates recently.
> > 
> > That would explain why your database disappeared. It seems that you
> > have been using mysql instance dedicated to akonadi service.
> > 
> > I don't know how things are setup on Suse but on Centos/RHEL, akonadi
> > service would by default bring up its own mysql instance, with its own
> > mysql config file and data directory. It would also use its own socket.
> > 
> > I wouldn't use that mysql instance for anything else but akonadi.
> > 
> > I strongly suggest that you configure and bring up normal mysql service
> > which can safely be used for bacula and other services as you se fit.
> > If configured correctly you will not lose your databases any more.
> > 
> > The timing between mysql and Bacula you have mentioned is likely caused
> > by the akonadi which starts its mysql instance and that happens only
> > during the graphical login or even after you start the "kontact" or
> > similar application such as "kmail".
> > 
> > 
> > Regards!
> 
> Thank you Josip this is very helpful. I have restored everything I had
> tinkered with back to what it was, that is:
> 
> Removed specification of port and socket from /etc/my.cnf
> Removed specification of port and socket from bacula-dir.conf
> 
> both of this were previously specifying the akonadi socket and port 3306
> 
> now './bacula' start from a console as root puts this message in the log:
> 
> 26-Dec 09:40 bacula-dir JobId 0: Fatal error: Could not open Catalog
> "MyCatalog", database "bacula".
> 
> If I run mysql from a console as root then 'use bacula' succeeds and I can
> access the tables but if i try the same thing as a normal user I get:
> 
> MariaDB [(none)]> use bacula;
> 
> KMail/akonadi behaviour is still not normal. I have to click the Kmail icon,
> then the desktop, then KMail icon again to get it to start, and at least
> the first time of collecting my POP3 email takes a lot longer than usual.
> 
> Graham

That should have read:

If I run mysql from a console as root then 'use bacula' succeeds and I can
access the tables but if i try the same thing as a normal user I get:

MariaDB [(none)]> use bacula;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'bacula'

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


Re: [Bacula-users] make_catalog_backup stopped working

2021-12-26 Thread Graham Dicker
On Saturday, 25 December 2021 17:18:56 GMT Josip Deanovic wrote:
> On Friday 2021-12-24 13:32:42 Graham Dicker wrote:
> > Thanks for the tip Phil, which I will bear in mind if I ever get Bacula
> > working again as it should (and has done for the past 10 years or more).
> > Up until about a year ago my workstation would boot itself up when
> > woken by the motherboard timer and Bacula would start running as a
> > service and do the necessary backups. The first thing that stopped
> > working was the service. There seemed to be some problem with timing
> > between Bacula and mysql. I got around it by dropping the service and
> > using crontab to start mysql and Bacula in that order. Then a few
> > months ago that started failing due to some disagreement between
> > akonadi, Bacula and mysql as to where the mysql socket was and which
> > port was to be used. I solved that by total surrender to akonadi and
> > told Bacula to use the socket created by akonadi. Now I don't know
> > what's gone wrong. KMail behaviour has also changed in the last few day
> > also; I have to click on it twice to make it start up. I think OpenSuse
> > 15.3 must have had some dodgy updates recently.
> 
> That would explain why your database disappeared. It seems that you
> have been using mysql instance dedicated to akonadi service.
> 
> I don't know how things are setup on Suse but on Centos/RHEL, akonadi
> service would by default bring up its own mysql instance, with its own
> mysql config file and data directory. It would also use its own socket.
> 
> I wouldn't use that mysql instance for anything else but akonadi.
> 
> I strongly suggest that you configure and bring up normal mysql service
> which can safely be used for bacula and other services as you se fit.
> If configured correctly you will not lose your databases any more.
> 
> The timing between mysql and Bacula you have mentioned is likely caused
> by the akonadi which starts its mysql instance and that happens only
> during the graphical login or even after you start the "kontact" or
> similar application such as "kmail".
> 
> 
> Regards!

Thank you Josip this is very helpful. I have restored everything I had tinkered 
with back to 
what it was, that is:

Removed specification of port and socket from /etc/my.cnf
Removed specification of port and socket from bacula-dir.conf

both of this were previously specifying the akonadi socket and port 3306

now './bacula' start from a console as root puts this message in the log:

26-Dec 09:40 bacula-dir JobId 0: Fatal error: Could not open Catalog 
"MyCatalog", 
database "bacula". 

If I run mysql from a console as root then 'use bacula' succeeds and I can 
access the tables 
but if i try the same thing as a normal user I get:

MariaDB [(none)]> use bacula; 

KMail/akonadi behaviour is still not normal. I have to click the Kmail icon, 
then the 
desktop, then KMail icon again to get it to start, and at least the first time 
of collecting my 
POP3 email takes a lot longer than usual.

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