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 Deployments are Stuck - DB is locked by a running daemon instance #2577

Closed iotaukm closed 2 years ago

iotaukm commented 2 years ago

Expected Behavior

I have made some changes, and have deployed them. Success or failure of deployment is expected.

Current Behavior

The deployments are stagnant, with no change over time. No success, no failure. The spinning discs continue to spin.

image

Possible Solution

I have considered other options mentioned online, such as looking at hostnames or endpoints, or the director service. All have been cleared, and i cannot tell why the deployments are still stuck. I have even purged the module, and reinstalled it (along with DB), and still no change. I have also browsed through potential solutions in https://github.com/Icinga/icingaweb2-module-director/issues/2305 and https://github.com/Icinga/icingaweb2-module-director/issues/1488, to no avail.

The closest i have gotten to a cause for the issue is the following error when i run "icingacli director daemon run --trace --debug": "RuntimeException in /usr/share/icingaweb2/modules/director/library/Director/Daemon/DaemonDb.php:161 with message: DB is locked by a running daemon instance, will retry"

Screenshot 2022-08-02 170005

Screenshot 2022-08-02 170110

Steps to Reproduce (for bugs)

I have just installed icinga2, director module, and required databases in mariadb. I also have grafana, graphite, and openshift running on the same server. All have been installed following the same installation instructions mentioned in the icinga documentation.

Your Environment

Thomas-Gelf commented 2 years ago

PHP 8.1 deprecation notices seem to be the problem here. Your output shows that the daemon is (currently) running fine, but some queries throw notifications and are probably failing. Please first check whether you're running the latest version of the incubator module. If it is outdated, please upgrade and try again.

In case it isn't please stop the daemon, switch to the icingadirector user and start it interactively with debug and trace mode on:

systemctl stop icingadirector.service
su - icingadirector -s /bin/bash
icingacli director daemon run --debug --trace

You can stop it at any time with CRTL-C, and exit brings you back to your root shell.

iotaukm commented 2 years ago

I am running version 0.17 of incubator, which seems to be the latest one.

I ran the code you provided, and i saw a different output (seen below). It didnt resolve the problem, as my deployments are still stagnant, but i did see the "Connected to the Database" prompt.

Screenshot 2022-08-03 111613

After waiting for a while, i just saw that the warnings (seen in the image below) were repeatedly being outputted, with no other result.

Screenshot 2022-08-03 111812

iotaukm commented 2 years ago

I found the problem. After various attempts (including reinstalling the entire stack on a different VM), the problem was the PHP version. Originally, i was having issues with PHP on icinga2 on ubuntu 20.04. PHP version 7.3 was the only version that would work. But, the director module doesnt work with that PHP version. Purging the PHP versions and installing PHP 8.1 (including re-installing director and icingaweb2) fixed the problem.

Thank you anyway.

Thomas-Gelf commented 2 years ago

Guess the problem was the Icinga Web 2 version, PHP 7.3 is not a problem at all for the Director. Anyway, glad to hear that it works for you