<---- template headericclude ----->
Bacula error with F17 upgrade
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Location
    milan
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bacula error with F17 upgrade

    I get the following error form bacula-dir:

    31-mag 16:41 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
    31-mag 16:41 bacula-dir JobId 0: Fatal error: postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
    Possible causes: SQL server not running; password incorrect; max_connections exceeded.
    31-mag 16:41 bacula-dir ERROR TERMINATION
    Please correct configuration file: bacula-dir.conf


    I am using bacula with MySQL database (in F16 I installed bacula-director-mysql & bacula-libs-mysql).
    In F17 I cannot find the mysql rpms.
    It seems that during the update the bacula server has 'switched' from mysql to postgresql database.

    Can anyone help me to switch back to mysql database?

    Thanks,

  2. #2
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    216
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Re: Bacula error with F17 upgrade

    Just confirming the same problem.
    My bacula-dir.conf has

    Catalog {
    Name = bacula
    # dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula; dbaddress = "192.168.1.183"; dbport = "3306"
    dbname = bacula
    user = bacula
    password = bacula
    DB address = falcon
    DB port = 3306
    }

    No issues with mysql itself using that userid and password to connect to mysql and query tables.

    [root@falcon bacula]# mysql -u bacula -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 629
    Server version: 5.5.23 MySQL Community Server (GPL)

    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> use bacula;
    Database changed
    mysql> select * from Version;
    +-----------+
    | VersionId |
    +-----------+
    | 12 |
    +-----------+
    1 row in set (0.16 sec)

    mysql>

    But the error logs are full of
    02-Jun 12:15 bacula-dir JobId 0: Fatal error: Could not open Catalog "bacula", database "bacula".
    02-Jun 12:15 bacula-dir JobId 0: Fatal error: postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
    Possible causes: SQL server not running; password incorrect; max_connections exceeded.
    02-Jun 12:15 bacula-dir ERROR TERMINATION
    Please correct configuration file: /etc/bacula/bacula-dir.conf

    After using preupgrade to get from f16 to f17 I have these rpms
    [root@falcon bacula]# rpm -qa | grep -i bacula
    bacula-console-bat-5.2.6-2.fc17.i686
    bacula-console-5.2.6-2.fc17.i686
    bacula-libs-5.2.6-2.fc17.i686
    bacula-traymonitor-5.2.6-2.fc17.i686
    webacula-5.0.3-3.fc17.noarch
    bacula-director-5.2.6-2.fc17.i686
    bacula-storage-5.2.6-2.fc17.i686
    bacula-docs-5.2.6-1.fc17.noarch
    bacula-common-5.2.6-2.fc17.i686
    bacula-libs-sql-5.2.6-2.fc17.i686
    bacula-client-5.2.6-2.fc17.i686
    [root@falcon bacula]#

    The f17 version seems to have been compiled with only postgress support.

  3. #3
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    216
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Re: Bacula error with F17 upgrade

    That seems to have been it. The f17 rpm seems to have been compiled only for postgress. You would appear to be stuffed if using the rpm version now. I guess now MySQL is an Oracle product its not seen as a future supported direction by RedHat ?.

    As I use bacula I banged away at this for quite a bit; and ended up getting it working from source which at least I could configure to use MySQL.

    I downloaded the latest source (5.2.6) from http://www.bacula.org/en/ and compiled it into /usr/local with (note: even though the configure help says the default is /usr/local, it doesn't seem to be so specify) And you may need to yum install mysql-devel if you don't already have it.

    ./configure --prefix=/usr/local --with-mysql
    make
    make install

    I had to copy my *conf scripts from /etc/bacula over the supplied ones in /usr/local/etc; and used the "/usr/local/etc/bacula start" to start it.
    The message changes to unable to connect to MySQL database which was an improvement. That seems to have been just table changes.

    Used the contents of /usr/local/etc/update_mysql_tables to upgrade from version 12 (which is what the rpm version in f16 provided) to 14 which is what this version wanted. Which took just ages as I had a lot of data in File table being altered, but better than losing data. The update of the version value in the Version table failed as I had MySQL configured for safe mode; fixed manually by just dropping the version table and recreating it with the correct version based on the section for that in /usr/local/etc/make_mysql_tables (kust the bit that created the Version table and put the value in).

    After that all was ok. Everything worked again ok.

    [root@falcon etc]# uname -a
    Linux falcon 3.3.7-1.fc17.i686 #1 SMP Mon May 21 22:50:24 UTC 2012 i686 i686 i386 GNU/Linux
    [root@falcon etc]# ./bacula start
    Starting the Bacula Storage daemon
    Starting the Bacula File daemon
    Starting the Bacula Director daemon
    [root@falcon etc]# netstat -an | grep 910
    tcp 0 0 0.0.0.0:9101 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:9102 0.0.0.0:* LISTEN
    tcp 0 0 0.0.0.0:9103 0.0.0.0:* LISTEN
    tcp 0 0 192.168.1.183:22 192.168.1.187:4910 ESTABLISHED
    [root@falcon etc]# bconsole
    Connecting to Director falcon:9101
    1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
    Enter a period to cancel a command.
    *status dir
    bacula-dir Version: 5.2.6 (21 February 2012) i686-pc-linux-gnu redhat Miracle)
    Daemon started 04-Jun-12 11:40. Jobs: run=0, running=0 mode=0,0
    Heap: heap=135,168 smbytes=52,701 max_bytes=53,898 bufs=292 max_bufs=302

    Scheduled Jobs:
    Level Type Pri Scheduled Name Volume
    ================================================== =================================
    (lots of jobs displayed)
    ====

    Running Jobs:
    Console connected at 04-Jun-12 11:40
    No Jobs running.
    ====

    Terminated Jobs:
    JobId Level Files Bytes Status Finished Name
    ================================================== ==================
    (lots of jobs displayed)

    ====
    *quit

    Also... I did a file restore from a backup taken from the server that has bacula-dir running on it from when it was still on f16. All good; so no data lost.

    My next steps are to delete all the rpms for bacula (as using rpms is what caused this upgrade to break f17 bacula for existing users that used mysql); try and install it from source somewhere else (as I can see having eveything in /usr/local (including logs in /usr/local/var/bacula/working instead of /var/log/bacula) is going to confuse me at some point) and put them into systemctl rather than having to use /usr/local/etc/bacula to stop/start things. But thats what I'll play with.

    How to get a working bacula install on f17 using MySQL without losing any data after upgrading from f16 to f17 is just to go back to using source.
    And maybe reviewing any other apps that use MySQL and getting the source for those in case the rpm versions of those stop working in a later update.

  4. #4
    Join Date
    May 2012
    Location
    milan
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Bacula error with F17 upgrade

    I found a solution (the new bacula release come with the postgresql driver set as default).

    If you do
    ll /etc/alternatives/libbac*
    you see two symbolic links pointing to the 'postgresql' modules (/usr/lib/libbaccats-postgresql-5.2.6.so & /usr/lib/libbaccats-postgresql.so).

    Stop the bacula services.

    Remove these two links from /etc/alternatives and create two new links to the 'mysql' modules:
    lrwxrwxrwx 1 root root 34 1 giu 11.17 /etc/alternatives/libbaccats-5.2.6.so -> /usr/lib/libbaccats-mysql-5.2.6.so
    lrwxrwxrwx 1 root root 28 1 giu 11.18 /etc/alternatives/libbaccats.so -> /usr/lib/libbaccats-mysql.so

    cd /usr/libexec/bacula

    change default_db_type from 'postgres' to 'mysql' in files:
    create_bacula_database
    drop_bacula_database
    drop_bacula_tables
    grant_bacula_privileges
    make_bacula_tables
    update_bacula_tables
    make_catalog_backup

    Restart the bacula servies.

    If you get an error like this one:
    01-giu 12:44 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
    01-giu 12:44 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
    01-giu 12:44 bacula-dir JobId 0: Fatal error: Version error for database "bacula". Wanted 14, got 12
    01-giu 12:44 bacula-dir ERROR TERMINATION
    Please correct configuration file: /etc/bacula/bacula-dir.conf

    stop the bacula services, execute the script 'update_bacula_tables', restart the services.

Similar Threads

  1. Replies: 2
    Last Post: 20th September 2009, 07:41 AM
  2. Bacula
    By shahdharmit in forum Using Fedora
    Replies: 1
    Last Post: 12th July 2009, 05:28 PM
  3. 64 bit Fedora 8 does NOT upgrade (yum upgrade error)
    By ichudov in forum Using Fedora
    Replies: 1
    Last Post: 13th November 2007, 07:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]