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)
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.
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.
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.