Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Director manual sync broken since 1.10 for us #2636

Closed
sebasdoes opened this issue Oct 13, 2022 · 3 comments
Closed

Director manual sync broken since 1.10 for us #2636

sebasdoes opened this issue Oct 13, 2022 · 3 comments
Assignees
Labels
Milestone

Comments

@sebasdoes
Copy link

Expected Behavior

When we press "Trigger this sync" on a sync rule, it should sync

Current Behavior

When we press "Trigger this sync" on a sync rule, the syncing fails with the attached error message.
image

Possible Solution

The error is in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObjectStore.php lines:

 69         foreach ($db->fetchAll($query) as $row) {
 70             $result[$row->uuid] = $class::create((array) $row, $this->connection);
 71             $result[$row->uuid]->setBeingLoadedFromDb();
 72         }

A quick fix that's working fine here, is:

 foreach ($db->fetchAll($query) as $row) {
            $row_uuid = (string) $row->uuid;
            $result[$row_uuid] = $class::create((array) $row, $this->connection);
            $result[$row_uuid]->setBeingLoadedFromDb();
        }

Refactor as you see fit to something proper.

Steps to Reproduce (for bugs)

  1. Go to Director, Automation, Sync rule
  2. Select a rule
  3. Press Trigger this sync or Preview

Your Environment

  • Director version (System - About): 1.10.1
  • Icinga Web 2 version and modules (System - About): 2.11.1
  • Icinga 2 version (icinga2 --version):
  • Operating System and version:
# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.5-1)

Copyright (c) 2012-2022 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: Ubuntu
  Platform version: 20.04.5 LTS (Focal Fossa)
  Kernel: Linux
  Kernel version: 5.13.0-1019-aws
  Architecture: x86_64
  • Webserver, PHP versions:
# dpkg -l | grep apache
ii  apache2                              2.4.41-4ubuntu3.12                amd64        Apache HTTP Server
ii  apache2-bin                          2.4.41-4ubuntu3.12                amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                         2.4.41-4ubuntu3.12                all          Apache HTTP Server (common files)
ii  apache2-utils                        2.4.41-4ubuntu3.12                amd64        Apache HTTP Server (utility programs for web servers)
ii  libapache2-mod-auth-openidc          2.4.1-1                           amd64        OpenID Connect authentication module for Apache
ii  libapache2-mod-php                   2:7.4+75                          all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii  libapache2-mod-php7.4                7.4.3-4ubuntu2.13                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)


# dpkg -l | grep php
hi  icinga-php-common                    1.0.0-1.focal                     all          Icinga PHP Common for Icinga Web 2
hi  icinga-php-library                   0.10.0-1+ubuntu20.04              amd64        Icinga PHP Library - IPL
hi  icinga-php-thirdparty                0.11.0-1.focal                    amd64        Icinga PHP Thirdparty for Icinga Web 2
ii  libapache2-mod-php                   2:7.4+75                          all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii  libapache2-mod-php7.4                7.4.3-4ubuntu2.13                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php                                  2:7.4+75                          all          server-side, HTML-embedded scripting language (default)
ii  php-common                           2:75                              all          Common files for PHP packages
ii  php-curl                             2:7.4+75                          all          CURL module for PHP [default]
ii  php-gd                               2:7.4+75                          all          GD module for PHP [default]
hi  php-icinga                           2.11.1-1.focal                    all          PHP library to communicate with and use Icinga
ii  php-imagick                          3.4.4-4                           amd64        Provides a wrapper to the ImageMagick library
ii  php-intl                             2:7.4+75                          all          Internationalisation module for PHP [default]
ii  php-json                             2:7.4+75                          all          JSON module for PHP [default]
ii  php-ldap                             2:7.4+75                          all          LDAP module for PHP [default]
ii  php-mbstring                         2:7.4+75                          all          MBSTRING module for PHP [default]
ii  php-pgsql                            2:7.4+75                          all          PostgreSQL module for PHP [default]
ii  php-soap                             2:7.4+75                          all          SOAP module for PHP [default]
ii  php-xml                              2:7.4+75                          all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php7.4                               7.4.3-4ubuntu2.13                 all          server-side, HTML-embedded scripting language (metapackage)
ii  php7.4-cli                           7.4.3-4ubuntu2.13                 amd64        command-line interpreter for the PHP scripting language
ii  php7.4-common                        7.4.3-4ubuntu2.13                 amd64        documentation, examples and common module for PHP
ii  php7.4-curl                          7.4.3-4ubuntu2.13                 amd64        CURL module for PHP
ii  php7.4-gd                            7.4.3-4ubuntu2.13                 amd64        GD module for PHP
ii  php7.4-intl                          7.4.3-4ubuntu2.13                 amd64        Internationalisation module for PHP
ii  php7.4-json                          7.4.3-4ubuntu2.13                 amd64        JSON module for PHP
ii  php7.4-ldap                          7.4.3-4ubuntu2.13                 amd64        LDAP module for PHP
ii  php7.4-mbstring                      7.4.3-4ubuntu2.13                 amd64        MBSTRING module for PHP
ii  php7.4-opcache                       7.4.3-4ubuntu2.13                 amd64        Zend OpCache module for PHP
ii  php7.4-pgsql                         7.4.3-4ubuntu2.13                 amd64        PostgreSQL module for PHP
ii  php7.4-readline                      7.4.3-4ubuntu2.13                 amd64        readline module for PHP
ii  php7.4-soap                          7.4.3-4ubuntu2.13                 amd64        SOAP module for PHP
ii  php7.4-xml                           7.4.3-4ubuntu2.13                 amd64        DOM, SimpleXML, XML, and XSL module for PHP
@Thomas-Gelf
Copy link
Contributor

Hi @sebasdoes,

thanks for reporting this! Are you running on PostgreSQL?

@Thomas-Gelf Thomas-Gelf self-assigned this Oct 13, 2022
@Thomas-Gelf Thomas-Gelf added this to the v1.10.2 milestone Oct 13, 2022
@sebasdoes
Copy link
Author

Hi @Thomas-Gelf , indeed we are!

@Thomas-Gelf
Copy link
Contributor

Thanks for letting me know. This is definitively a bug affecting PostgreSQL-based installations. Has been fixed, will be part of the next patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants