Create Director DB Scheme fail

Hello all,

i´ve got the problem that the Director scheme creation fails.
My DB-System consists of a 3 Node Mariadb Galera-Cluster and 2 Proxysql-Nodes.
I´ve set the mysql-wait_timeout to 300 and the mysql-threshold_query_length to 1073741824, but the problem still exists.
The director creates 100 tables in the database.

  • Migration 0 failed (SQLSTATE[HY000]: General error: 2006 MySQL server has gone away) while running CREATE TABLE icinga_scheduled_downtime ( id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL, uuid VARBINARY(16) NOT NULL, object_name VARCHAR(255) NOT NULL, zone_id INT(10) UNSIGNED DEFAULT NULL, object_type ENUM(‘object’, ‘template’, ‘apply’) NOT NULL, disabled ENUM(‘y’, ‘n’) NOT NULL DEFAULT ‘n’, apply_to ENUM(‘host’, ‘service’) DEFAULT NULL, assign_filter TEXT DEFAULT NULL, author VARCHAR(255) DEFAULT NULL, comment TEXT DEFAULT NULL, fixed ENUM(‘y’, ‘n’) DEFAULT NULL, duration INT(10) UNSIGNED DEFAULT NULL, with_services ENUM(‘y’, ‘n’) NULL DEFAULT NULL, PRIMARY KEY (id), UNIQUE INDEX uuid (uuid), UNIQUE INDEX object_name (object_name), CONSTRAINT icinga_scheduled_downtime_zone FOREIGN KEY zone (zone_id) REFERENCES icinga_zone (id) ON DELETE RESTRICT ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 (Migration.php:60)
  • Director version (System - About): 1.9.1
  • Icinga Web 2 version and modules (System - About): 2.11.1
  • Icinga 2 version (icinga2 --version): r2.13.5-1
  • Operating System and version: Debian 11
  • Webserver, PHP versions: PHP Version 7.4.30, icingadb: 1.0.1

Short edit:
I´ve tried to import the mysql.sql manually (mysql -h 127.0.0.1 -u director -D director < mysql.sql -p) and got the following error:

ERROR 1060 (42S21) at line 2312: Duplicate column name ‘imports’

I´ve also copied the commands from the file and just pasted it in mariadb. This works, but the director is not functional at all.

I´ve installed the newest version of the director today (1.10.0) and used these settings (Galera MySQL cluster with VIPs and HAProxy for IDO-Mysql and more). And i also configured the Database directly as resource (so without Proxysql).

I´m really thankful for every hint.

Best Regards
Tom

EDIT:
I´ve installed mariadb on my web-server and it still won´t work. I get the following error now:

There is a duplicate line in mysql.sql causing this problem.

I reported the problem this morning and it was fixed few minutes later. So getting the updated file from github and give it another try should do the job. Maybe you want to delete already created tables in your director DB first.

2 Likes

@4L60 helped me on a fresh installation! Thanks.

I’m just tried it to day but same error with columns name ‘imports’

Maybe you want to check your directors mysql.sql manually. On my debian system mysql.sql is located at /usr/share/icingaweb2/modules/director/schema/

Open mysql.sql in your favourite text editor and look for the CREATE TABLE command that is mentioned in the error message (should be “CREATE TABLE branched_icinga_service_set”).

Within the create table statement look for a duplicate line starting with “imports”, delete the duplicate line and save the file.

Delete the already created tables in your director DB and try again. Worked for me.

1 Like

Just some additional comments and thoughts on the recent git branch of director. I’m doing a fresh install of Icinga2 and director on a Debian 10 system (the machine was installed two years ago hosting dokuwiki - just in case somebody is wondering at Debian 10 for a fresh install).

I installed director using git clone (cloning the master branch). After I solved this duplicate line problem discussed here, I ran into trouble running kickstart assistent. There was an error creating a record in director_activity_log table. Some folks solved this by changing the database charset but that didn’t work for me.

Finally I dropped and recreated my director database, removed my director module directory and git cloned support/1.9 branch instead of master branch (support/1.10 caused exactly the same problem as master branch did).

With director 1.9 creating database schema was no problem and running kickstart assistant was no problem, too. Even an upgrade to 1.10 seems to be no problem once 1.9 was used to create database and running kickstart assistant.

So my impression is that a fresh install of director 1.10 (or master branch) is not well tested currently and it may be the better idea to fresh install 1.9 and upgrade to 1.10.

2 Likes

Great advice i, this help me alot.

1 Like