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

Don't crash when failing to connect to the database #212

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

yhabteab
Copy link
Member

Before

root@debian12-yh:~# systemctl status icinga-reporting.service
× icinga-reporting.service - Icinga Reporting Scheduler
     Loaded: loaded (/lib/systemd/system/icinga-reporting.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-10-24 08:57:38 UTC; 2min 21s ago
   Duration: 76ms
    Process: 231208 ExecStart=/usr/bin/icingacli reporting schedule run (code=exited, status=255/EXCEPTION)
   Main PID: 231208 (code=exited, status=255/EXCEPTION)
        CPU: 72ms

Oct 24 08:57:38 debian12-yh icingacli[231208]: #1 /usr/share/icingaweb2/modules/reporting/application/clicommands/ScheduleCommand.php(89): Icinga\Module\Reporting\Cli\Command->getDb()
Oct 24 08:57:38 debian12-yh icingacli[231208]: #2 /usr/share/icingaweb2/modules/reporting/application/clicommands/ScheduleCommand.php(40): Icinga\Module\Reporting\Clicommands\ScheduleCommand->fetchSchedu>
Oct 24 08:57:38 debian12-yh icingacli[231208]: #3 /usr/share/icinga-php/ipl/vendor/react/event-loop/src/Tick/FutureTickQueue.php(46): Icinga\Module\Reporting\Clicommands\ScheduleCommand->Icinga\Module\Re>
Oct 24 08:57:38 debian12-yh icingacli[231208]: #4 /usr/share/icinga-php/ipl/vendor/react/event-loop/src/StreamSelectLoop.php(183): React\EventLoop\Tick\FutureTickQueue->tick()
Oct 24 08:57:38 debian12-yh icingacli[231208]: #5 /usr/share/icinga-php/ipl/vendor/react/event-loop/src/Loop.php(55): React\EventLoop\StreamSelectLoop->run()
Oct 24 08:57:38 debian12-yh icingacli[231208]: #6 [internal function]: React\EventLoop\Loop::React\EventLoop\{closure}()
Oct 24 08:57:38 debian12-yh icingacli[231208]: #7 {main}
Oct 24 08:57:38 debian12-yh icingacli[231208]:   thrown in /usr/share/php/Icinga/Data/ResourceFactory.php on line 49
Oct 24 08:57:38 debian12-yh systemd[1]: icinga-reporting.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 24 08:57:38 debian12-yh systemd[1]: icinga-reporting.service: Failed with result 'exit-code'.

After

root@2819b1155e37:/var/www/html# icingacli reporting schedule run --debug
Failed to fetch report schedules from the database: Icinga\Exception\ConfigurationError in /icingaweb2/library/Icinga/Data/ResourceFactory.php:49 with message: Cannot load resource config "reporting". Resource does not exist

@cla-bot cla-bot bot added the cla/signed label Oct 24, 2023
@yhabteab yhabteab self-assigned this Oct 24, 2023
@yhabteab yhabteab added the bug Something isn't working label Oct 24, 2023
@yhabteab yhabteab requested a review from nilmerg October 24, 2023 09:07
@yhabteab yhabteab added this to the 1.0.0 milestone Oct 24, 2023
@nilmerg
Copy link
Member

nilmerg commented Oct 24, 2023

Please make sure the updated configuration is actually read by the daemon. The Database trait uses Config::module and this caches configs by default.

@yhabteab yhabteab force-pushed the fix-schedule-command branch from 27bb4ee to 00348ef Compare October 24, 2023 15:14
@yhabteab yhabteab requested a review from nilmerg October 24, 2023 15:15
@yhabteab yhabteab force-pushed the fix-schedule-command branch from 00348ef to a98cc22 Compare October 25, 2023 07:36
@yhabteab yhabteab requested a review from nilmerg October 25, 2023 07:36
@yhabteab yhabteab merged commit ed544af into master Oct 25, 2023
6 checks passed
@yhabteab yhabteab deleted the fix-schedule-command branch October 25, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants