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

Error on Activity Log #2828

Closed
brusilva84 opened this issue Oct 30, 2023 · 7 comments
Closed

Error on Activity Log #2828

brusilva84 opened this issue Oct 30, 2023 · 7 comments
Assignees
Labels
Milestone

Comments

@brusilva84
Copy link

Expected Behavior

View a list of changes

Current Behavior

Oops, an error occurred!
datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR (LocalDateFormat.php:29)
#0 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/format/src/LocalDateFormat.php(29): IntlDateFormatter->__construct()
#1 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/format/src/LocalDateFormat.php(20): gipfl\Format\LocalDateFormat->formatter()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Table/ActivityLogTable.php(111): gipfl\Format\LocalDateFormat->getFullDay()
#3 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/QueryBasedTable.php(135): Icinga\Module\Director\Web\Table\ActivityLogTable->renderDayIfNew()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Table/ActivityLogTable.php(86): gipfl\IcingaWeb2\Table\QueryBasedTable->splitByDay()
#5 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/QueryBasedTable.php(180): Icinga\Module\Director\Web\Table\ActivityLogTable->renderRow()
#6 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/QueryBasedTable.php(115): gipfl\IcingaWeb2\Table\QueryBasedTable->fetchRows()
#7 /usr/share/icinga-php/ipl/vendor/ipl/html/src/BaseHtmlElement.php(365): gipfl\IcingaWeb2\Table\QueryBasedTable->renderContent()
#8 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(568): ipl\Html\BaseHtmlElement->renderUnwrapped()
#9 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(390): ipl\Html\HtmlDocument->render()
#10 /usr/share/icinga-php/ipl/vendor/ipl/html/src/BaseHtmlElement.php(297): ipl\Html\HtmlDocument->renderUnwrapped()
#11 /usr/share/icinga-php/ipl/vendor/ipl/html/src/BaseHtmlElement.php(365): ipl\Html\BaseHtmlElement->renderContent()
#12 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(568): ipl\Html\BaseHtmlElement->renderUnwrapped()
#13 /usr/share/icinga-php/ipl/vendor/ipl/html/src/HtmlDocument.php(420): ipl\Html\HtmlDocument->render()
#14 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Zf1/SimpleViewRenderer.php(65): ipl\Html\HtmlDocument->__toString()
#15 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Zf1/SimpleViewRenderer.php(104): gipfl\IcingaWeb2\Zf1\SimpleViewRenderer->render()
#16 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action/HelperBroker.php(277): gipfl\IcingaWeb2\Zf1\SimpleViewRenderer->postDispatch()
#17 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#18 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#19 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
#20 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch()
#21 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#22 /usr/share/icingaweb2/public/index.php(4): require_once('...')
#23 {main}

Possible Solution

Steps to Reproduce (for bugs)

Do a change and go to Actitivy Log

Your Environment

Loaded Libraries
icinga/icinga-php-library 0.13.0
icinga/icinga-php-thirdparty 0.12.0
Loaded Modules
director 1.11.0
icingadb 1.1.0
graphite 1.2.4
incubator 0.20.0
ipl v0.5.0
nagvis 1.1.1
pdfexport 0.10.2
reactbundle 0.9.0
reporting 0.10.0
x509 1.3.1

@adriangalbincea
Copy link

adriangalbincea commented Oct 30, 2023

I have the same error. The same error shows up on the deployment page too for me

@brusilva84
Copy link
Author

Seems to be related with php 8.1.25 update
see here php/php-src#12561

@axelhahn
Copy link

axelhahn commented Nov 7, 2023

On Debian 12 with PHP 8.2 - it was broken after updating PHP from 8.2.10 --> 8.2.12.

Loaded Libraries
icinga/icinga-php-library 0.13.0
icinga/icinga-php-thirdparty 0.12.0

Loaded Modules
director master
graphite 1.2.4
incubator 0.20.0
ipl 0.0.0
monitoring 2.12.0
reactbundle 0.0.0
setup 2.12.0

when adding some debugging code into
/usr/share/icingaweb2/modules/incubator/vendor/gipfl/format/src/LocalDateFormat.php

    /**
     * @param $time
     * @return string
     */
    public function getFullDay($time)
    {
            echo "$time<br>";
            echo $this->getLocale().'<br>';
        return $this->formatter()->format($time);
    }

then it dumps

1699280318
C

... a unix timestamp and "C" from $this->getLocale().
If the error is "invalid locale" - how set a (any) correct locale to prevent the behavoiur?

@brusilva84
Copy link
Author

I think that if you can force the C to "en_US_POSIX" it should work. however according to phpsrc it should be fixed on next version

@brusilva84
Copy link
Author

Anyone found a way to fix this without waiting the a new version from php?

@axelhahn
Copy link

axelhahn commented Nov 15, 2023

This is my hack(*) until the next php update arrives.
*) not a general recommendation for everyone

(1)
Make a copy of these files (cp -p [file] [file]__orig) to have the original to restore:

  • /usr/share/icingaweb2/modules/incubator/vendor/gipfl/format/src/LocalDateFormat.php
  • /usr/share/icingaweb2/modules/incubator/vendor/gipfl/format/src/LocalTimeFormat.php

(2)
In both files search for "$this->getLocale()," - comment it and replace with a string "en_US_POSIX"

...
// $this->getLocale(),
"en_US_POSIX",
...

In each file is one replacement.

(3)
Then go to Icinga web ui --> director -> Activity Log - it should work again.
If not, maybe you enabled opcache caching ... maybe you need until your caching time is over or or restart php-fpm service.

If this did not work you should restore both files of (1). mv [file]__orig [file]

Good luck :-)

@adriangalbincea
Copy link

After the latest PHP update the error changed....
ice_screenshot_20231124-100726

This error is on the History side of Hosts/Services as last time.

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

Successfully merging a pull request may close this issue.

5 participants