Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 203 forks source link

Director 1.10.1 cannot create database schema #2625

Closed redbob365 closed 2 years ago

redbob365 commented 2 years ago

Describe the bug

Hi,

I'm trying to install director module in Icinga2 Web, but I cannot create database schema. I have tried several times, but not successfully at all;

To Reproduce

1. drop database director;
2. CREATE DATABASE director CHARACTER SET 'utf8';
3. GRANT ALL ON director.* TO director@localhost;
4. Application / Resources / Create a New Resource: Director DB (Successfully validated) - Saved;

when I go to Icinga Director Setup: Create Schema and click on Create Schema button, this error ocurrs:

 Migration 0 failed (SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'imports') while running CREATE TABLE branched_icinga_service_set ( uuid VARBINARY(16) NOT NULL, branch_uuid VARBINARY(16) NOT NULL, branch_created ENUM('y', 'n') NOT NULL DEFAULT 'n', branch_deleted ENUM('y', 'n') NOT NULL DEFAULT 'n', object_name VARCHAR(128) DEFAULT NULL, object_type ENUM('object', 'template', 'external_object') DEFAULT NULL, host VARCHAR(255) DEFAULT NULL, description TEXT DEFAULT NULL, assign_filter TEXT DEFAULT NULL, imports TEXT DEFAULT NULL, imports TEXT DEFAULT NULL, set_null TEXT DEFAULT NULL, PRIMARY KEY (branch_uuid, uuid), INDEX search_object_name (object_name), CONSTRAINT icinga_service_set_branch FOREIGN KEY branch (branch_uuid) REFERENCES director_branch (uuid) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8

What I cannot undestand is why these duplicated columns, because before the Creating Schema command, I go to mysql > use director; > show tables; the output is Empty set (0.00 sec);

Your Environment

lippserd commented 2 years ago

Hi,

This is a duplicate of #2609.

All the best, Eric

Thomas-Gelf commented 2 years ago

Thank you @lippserd! Just remove that duplicate line from mysql.sql, and it will work. v1.10.1 with this fix will be released within this week

redbob365 commented 2 years ago

Thank you @lippserd! Just remove that duplicate line from mysql.sql, and it will work. v1.10.1 with this fix will be released within this week

Ok, @Thomas-Gelf. Could you send a warning when this fix willl arrive? Because I'm using Director v.1.9.1 I receive this warning:

Your DB schema (migration #180) is newer than your code base. 
Downgrading Icinga Director is not supported and might lead to unexpected problems.

But everything is running fine, because I deleted duplicated line as you told.

Thomas-Gelf commented 2 years ago

@redbob365: no need to downgrade, existing installations are not affected by this issue

redbob365 commented 2 years ago

@redbob365: no need to downgrade, existing installations are not affected by this issue

Yep, I understood. But I wanna upgrade Director to 1.10.1 when this fix will be released. Thanks

C0rn3j commented 2 years ago

1.10.1 still has an issue with this that .2 fixes, see https://github.com/Icinga/icingaweb2-module-director/issues/2630