Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4515

PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string

Details

    • Help
    • Resolution: Not A Bug
    • Major
    • None
    • Professional Edition
    • Discovery

    Description

      After upgrading OS, the WebUI is blank and does not display anything, all PHP scripts are failing. Please assist me with getting things back up and running. Let me know what further information you require. Here are the errors that get returned when running some of the php scripts from cron, device rename / add for example.

       

      [root@crilobservium observium]# /opt/observium/discovery.php -u
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/discovery.php(19): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# /opt/observium/discovery.php -h all
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/discovery.php(19): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# /opt/observium/discovery.php -h all
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/discovery.php(19): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# /opt/observium/housekeeping.php -ysel
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/housekeeping.php(18): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# /opt/observium/housekeeping.php -yrptb
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/housekeeping.php(18): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# ./rename_device.php
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/rename_device.php(19): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]# ./add_device.php 
      PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /opt/observium/includes/functions.inc.php:2449
      Stack trace:
      #0 /opt/observium/includes/sql-config.inc.php(157): load_sqlconfig()
      #1 /opt/observium/add_device.php(21): include('...')
      #2 {main}
        thrown in /opt/observium/includes/functions.inc.php on line 2449
      [root@crilobservium observium]

       

       

      Attachments

        Activity

          [OBS-4515] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string

          PHP 8 is significantly stricter than PHP 7.

          adama Adam Armstrong added a comment - PHP 8 is significantly stricter than PHP 7.

          Might have narrowed this down to a bad or old configuration parameter in the config.php file that breaks things. By removing it or commenting it out fixes all the posted errors and the web page and php script work. I have had this line in my config for more than 5 years and not sure why it's an issue now but I can reproduce the issue with it for what ever reason.

          { $config['ping']           = "/usr/sbin/ping"; }

          I suppose you may close this ticket.

           

          Thank you,

           

          eric.anderson Eric Anderson added a comment - Might have narrowed this down to a bad or old configuration parameter in the config.php file that breaks things. By removing it or commenting it out fixes all the posted errors and the web page and php script work. I have had this line in my config for more than 5 years and not sure why it's an issue now but I can reproduce the issue with it for what ever reason. { $config['ping']           = "/usr/sbin/ping"; } I suppose you may close this ticket.   Thank you,  

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            landy Mike Stupalov
            eric.anderson Eric Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: