Details

    • Bug
    • Resolution: Not A Bug
    • Major
    • None
    • Professional Edition
    • Web Interface
    • None

    Description

      upgraded to revision 10951 

      login page giving 500 error

      error.log reporting:

      [Sun Jan 17 12:28:36.578518 2021] [:error] [pid 29389] [client x.x.x.x:51108] PHP Fatal error:  Call to undefined function random_int() in /opt/observium/includes/defaults.inc.php on line 768

      Found in defaults.inc.php:

      $config['irc_nick'] = "Observium" . random_int(1, 99999);

       

       

       

      Attachments

        Activity

          [OBS-3612] latest SVN up broke login page

          indeed, that was the issue. somehow apache had reverted to using 5.x through some debian update. once forced back to 7, svn head works fine.

          Thanks!!

          hoyosa Andrew Hoyos added a comment - indeed, that was the issue. somehow apache had reverted to using 5.x through some debian update. once forced back to 7, svn head works fine. Thanks!!

          Hrm, probably I know how that possible:

          • your apache still use old php (5.x), check it in About page (https://<observium>/about/). While poller/discovery used new php (7.x).

          Check your packages and remove old ones:

          dpkg -l | grep apache2-mod-php | grep ii

          landy Mike Stupalov added a comment - Hrm, probably I know how that possible: your apache still use old php (5.x), check it in About page (https://<observium>/about/). While poller/discovery used new php (7.x). Check your packages and remove old ones: dpkg -l | grep apache2-mod-php | grep ii

          I checked php.ini files, they are default from debian9. No mention of this function being blocked.

          Confirming that mt_rand() fix works fine.

           

          root@nm:/opt/observium# svn revert includes/defaults.inc.php

          Reverted 'includes/defaults.inc.php'

          root@nm:/opt/observium# svn up

          Updating '.':

          U    includes/defaults.inc.php

          Updated to revision 10952.

           

           

           

          hoyosa Andrew Hoyos added a comment - I checked php.ini files, they are default from debian9. No mention of this function being blocked. Confirming that mt_rand() fix works fine.   root@nm:/opt/observium# svn revert includes/defaults.inc.php Reverted 'includes/defaults.inc.php' root@nm:/opt/observium# svn up Updating '.': U    includes/defaults.inc.php Updated to revision 10952.      

          Not a bug, but temporary fixed in r10952.

          landy Mike Stupalov added a comment - Not a bug, but temporary fixed in r10952.

          Use random_int() function in this place completely not neccesary, I replace it with mt_rand().

          But this is completelly impossible that this is function not exist on any php7.x.
          This is native function, not loaded as module!

          Only way - if function blocked by php.ini config.

          landy Mike Stupalov added a comment - Use random_int() function in this place completely not neccesary, I replace it with mt_rand(). But this is completelly impossible that this is function not exist on any php7.x. This is native function, not loaded as module! Only way - if function blocked by php.ini config.

          Yep, just some additional information after looking at this a bit more - this is a Debian 9 machine, which doesn't natively have php 7.1 or 7.2 in repo. 

          The install guide still seems to suggest that Debian 9 is supported, but I see the software requirements have been updated to list 7.1 as min. 

          So, I'd suggest you either need to say Debian 9 no longer supported (because lack of php 7.1/7.2 natively) or include library for backwards compatibility.

           

           

          hoyosa Andrew Hoyos added a comment - Yep, just some additional information after looking at this a bit more - this is a Debian 9 machine, which doesn't natively have php 7.1 or 7.2 in repo.  The install guide still seems to suggest that Debian 9 is supported, but I see the software requirements have been updated to list 7.1 as min.  So, I'd suggest you either need to say Debian 9 no longer supported (because lack of php 7.1/7.2 natively) or include library for backwards compatibility.    

          Mike might work around this by loading the library (i guess it's only loading for 5.6, and almost no one used 7.0, so it's not been noticed), but you should definitely upgrade this install anyways.

          adama Adam Armstrong added a comment - Mike might work around this by loading the library (i guess it's only loading for 5.6, and almost no one used 7.0, so it's not been noticed), but you should definitely upgrade this install anyways.

          Yeah, 7.0 was a dumb release, missing a bunch of things that you'd otherwise associate with 7.x. it was never really one that we supported, we skipped straight to 7.1, which is the current minimum.

          adama Adam Armstrong added a comment - Yeah, 7.0 was a dumb release, missing a bunch of things that you'd otherwise associate with 7.x. it was never really one that we supported, we skipped straight to 7.1, which is the current minimum.

          root@nm:/opt/observium# find . -name '*.php' -type f -exec grep -l 'random_int' {} \;
          ./includes/common.inc.php
          ./libs/random_compat/random_int.php
          ./libs/random_compat/random.php
          ./libs/Uuid/Generator/DefaultTimeGenerator.php
           
          root@nm:/opt/observium# php -v
          PHP 7.0.33-0+deb9u10 (cli) (built: Oct  6 2020 17:08:28) ( NTS )
          Copyright (c) 1997-2017 The PHP Group
          Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
              with Zend OPcache v7.0.33-0+deb9u10, Copyright (c) 1999-2017, by Zend Technologies
          

          hoyosa Andrew Hoyos added a comment - root @nm :/opt/observium# find . -name '*.php' -type f -exec grep -l 'random_int' {} \; ./includes/common.inc.php ./libs/random_compat/random_int.php ./libs/random_compat/random.php ./libs/Uuid/Generator/DefaultTimeGenerator.php   root @nm :/opt/observium# php -v PHP 7.0 . 33 - 0 +deb9u10 (cli) (built: Oct  6 2020 17 : 08 : 28 ) ( NTS ) Copyright (c) 1997 - 2017 The PHP Group Zend Engine v3. 0.0 , Copyright (c) 1998 - 2017 Zend Technologies     with Zend OPcache v7. 0.33 - 0 +deb9u10, Copyright (c) 1999 - 2017 , by Zend Technologies

          It's possible we're no longer loading the back support parts of the library, landy would know.

          adama Adam Armstrong added a comment - It's possible we're no longer loading the back support parts of the library, landy would know.

          People

            adama Adam Armstrong
            hoyosa Andrew Hoyos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: