• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137

Scheduled Pinned Locked Moved General pfSense Questions
33 Posts 5 Posters 7.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    stephenw10 Netgate Administrator
    last edited by Feb 19, 2023, 4:21 PM

    It's in the config file in /cf/conf/config.xml:

    	<switches>
    		<switch>
    			<device>/dev/etherswitch0</device>
    			<vlanmode>PORT</vlanmode>
    ==>			<vlangroups></vlangroups>
    			<swports>
    				<swport>
    					<port>1</port>
    					<state><![CDATA[forwarding]]></state>
    				</swport>
    

    Removing that line and rebooting should be sufficient.

    F B 2 Replies Last reply Feb 19, 2023, 4:34 PM Reply Quote 1
    • F
      furom @stephenw10
      last edited by furom Feb 19, 2023, 4:42 PM Feb 19, 2023, 4:34 PM

      @stephenw10 Thanks! Will try that asap. When trying just now I realized that sudo was missing so went into packages to verify and - none of my packages are there. In fact, no packages are available for install either... Sorry for the hassle, am a bit eager to try 23.01 again after this...

      The package management tool is not yet installed on your system.
      Do you want to fetch and install it now? [y/N]: y
      Bootstrapping pkg from pkg+https://repo.netgate.com/pkg/pfSense_plus-v23_01_aarch64-pfSense_plus_v23_01, please wait...
      Could not load client key /etc/thoth/key.pem
      Could not load client key /etc/thoth/key.pem
      Could not load client key /etc/thoth/key.pem
      Could not load client key /etc/thoth/key.pem
      Could not load client key /etc/thoth/key.pem
      Could not load client key /etc/thoth/key.pem
      pkg: Error fetching https://repo.netgate.com/pkg/pfSense_plus-v23_01_aarch64-pfSense_plus_v23_01/Latest/pkg.txz: Authentication error
      A pre-built version of pkg could not be found for your system.
      Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.
      

      It seems it tries to get packages for 23.01 even though I am on 22.05 now... Uh.. What should I do, really? Fix this before flashing or ?

      1 Reply Last reply Reply Quote 0
      • S
        stephenw10 Netgate Administrator
        last edited by stephenw10 Feb 19, 2023, 7:17 PM Feb 19, 2023, 7:16 PM

        Upgrades for aarch64 (1100 and 2100) are disabled temporarily whist we fix the upgrade bug hitting systems with older installs. https://redmine.pfsense.org/issues/13967

        Should be back soon. We have a good handle on what's happening there now.

        So if you want to test that now you can install 23.01 clean and import the config with that line removed.

        Steve

        F 2 Replies Last reply Feb 19, 2023, 9:56 PM Reply Quote 1
        • F
          furom @stephenw10
          last edited by furom Feb 19, 2023, 10:17 PM Feb 19, 2023, 9:56 PM

          @stephenw10 said in PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137:

          Upgrades for aarch64 (1100 and 2100) are disabled temporarily whist we fix the upgrade bug hitting systems with older installs. https://redmine.pfsense.org/issues/13967

          Should be back soon. We have a good handle on what's happening there now.

          So if you want to test that now you can install 23.01 clean and import the config with that line removed.

          Steve

          Hi, sorry for being so quiet, but have struggled with the device all evening.. :/ I had somehow managed to turn off some DNS rules I needed and never thought of checking. I went ahead and did a clean install of 23.01 and imported my saved config. After removing the line you suggested, the interface issue was gone. But instead checking the 'System / Update / branch' it was empty, and I had no packages available to install. So am back on 22.05 again. Getting a little tired jumping back and forth, always something I miss that complicates things a bit. Come to think of it, when logging in to 23.01 for the first time it gave a yellow banner that it was loading packages... But if my DNS was borked, that may well explain why it failed and none were available. But still, should the branch be empty?

          Nevertheless, I'm happy to hear you are homing in on the issues with the 1100 & 2100.

          1 Reply Last reply Reply Quote 0
          • S
            Superpaul209
            last edited by Feb 22, 2023, 8:05 AM

            Hello again,

            @stephenw10 Do you need more information to resolve the issue https://redmine.pfsense.org/issues/13981 ? Is it planned to be resolved soon ? Thank you

            F 1 Reply Last reply Feb 22, 2023, 11:13 AM Reply Quote 0
            • F
              furom @stephenw10
              last edited by Feb 22, 2023, 11:09 AM

              @stephenw10 said in PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137:

              install 23.01 clean and import the config with that line removed

              Stubborn as I am, I did this once more yesterday, and had great result this time. I haven't found anything malfunctioning this time, other than the restored backup contains the tags that needs to be removed after upgrade/restore (or by modifying the xml file prior restoring)

              1 Reply Last reply Reply Quote 0
              • F
                furom @Superpaul209
                last edited by furom Feb 22, 2023, 11:14 AM Feb 22, 2023, 11:13 AM

                @superpaul209 said in PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137:

                Is it planned to be resolved soon

                It seems to be planned for the May release; https://redmine.pfsense.org/versions/71

                1 Reply Last reply Reply Quote 0
                • S
                  stephenw10 Netgate Administrator
                  last edited by Feb 22, 2023, 12:42 PM

                  It's marked as 23.05 for the target but it will likely be fixed much sooner than that and when that happens it can be added via the system patches package.

                  J 1 Reply Last reply Feb 22, 2023, 2:50 PM Reply Quote 2
                  • J
                    jimp Rebel Alliance Developer Netgate @stephenw10
                    last edited by Feb 22, 2023, 2:50 PM

                    You can install the System Patches package and then create an entry for the diff below to apply the patch:

                    diff --git a/src/usr/local/www/status_interfaces.php b/src/usr/local/www/status_interfaces.php
                    index 77a0071870..2dd1d7fa16 100644
                    --- a/src/usr/local/www/status_interfaces.php
                    +++ b/src/usr/local/www/status_interfaces.php
                    @@ -134,8 +134,8 @@ foreach ($ifdescrs as $ifdescr => $ifname):
                     
                     	$ifhwinfo = $ifinfo['hwif'];
                     	$vlan = interface_is_vlan($ifinfo['hwif']);
                    -	if ($vlan && is_array($config['switches']['switch'][0]['vlangroups']['vlangroup'])) {
                    -		foreach ($config['switches']['switch'][0]['vlangroups']['vlangroup'] as $vlangroup) {
                    +	if ($vlan) {
                    +		foreach (config_get_path('switches/switch/0/vlangroups/vlangroup', []) as $vlangroup) {
                     			if ($vlangroup['vlanid'] == $vlan['tag']) {
                     				$ifhwinfo .= ', switchports: ' . $vlangroup['members'];
                     				break;
                    

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    S 1 Reply Last reply Feb 22, 2023, 3:39 PM Reply Quote 4
                    • S
                      Superpaul209 @jimp
                      last edited by Feb 22, 2023, 3:39 PM

                      @jimp This patch has been applied successfully on my SG-3100. I can look the interfaces page again without a fatal error, thank you ! 😀

                      1 Reply Last reply Reply Quote 2
                      • B
                        BB_aviator @stephenw10
                        last edited by Apr 17, 2023, 10:35 PM

                        @stephenw10 said in PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137:

                        <vlangroups></vlangroups>

                        Hi, I got the same PHP python reference error upgrading to 23.01 on SG-3100. I looked at the config file I was successfully using under 22.05 and couldn't find the exact line above you note that should be deleted.

                        23.01-RELEASE (arm)
                        

                        built on Fri Feb 10 20:06:58 UTC 2023
                        FreeBSD 14.0-CURRENT

                        The system is on the latest version.
                        Version information updated at Mon Apr 17 17:29:10 EDT 2023

                        Here is what I found in the config file - can you advise whether I should delete one or more lines in this file?
                        Thanks....

                        <switches>
                        <switch>
                        <device>/dev/etherswitch0</device>
                        <vlanmode>DOT1Q</vlanmode>
                        <vlangroups>
                        <vlangroup>
                        <vgroup>1</vgroup>
                        <vlanid>4081</vlanid>
                        <descr><![CDATA[Display port 1]]></descr>
                        <members>1 5t</members>

                        1 Reply Last reply Reply Quote 0
                        • S
                          stephenw10 Netgate Administrator
                          last edited by Apr 17, 2023, 11:08 PM

                          You have at least 1 vlan group defined so whatever you're hitting it's not the same bug.
                          Are you seeing exactly the same php error?
                          Can we see your complete switches section from the config?

                          Steve

                          B 2 Replies Last reply Apr 18, 2023, 12:41 AM Reply Quote 0
                          • B
                            BB_aviator @stephenw10
                            last edited by Apr 18, 2023, 12:41 AM

                            @stephenw10

                            Steve, I didn't save the crash or php files, thinking they would be available inside the pfsense GUI as a selection, so don't have. But the error had to do with loss of a string reference and might have been in the PFBlockerNG application. Sorry to be vague. Although I configured the gateway and vLANS myself, I am still pretty much a newbie at this stuff.

                            I have been running this config of pfSense for 2+ years and didn't have any problems with three releases of pFSense until this one. Despite the fatal error, things seem to be working, but unless there maybe a fix in the near term, I will revert to the previous release of pfsense.

                            The file below is a cutout of the switches section of the config file I was using at the time of the system upgrade.

                            Thanks so much for your assistance.
                            Bill

                            sample config file.20030417.xml

                            1 Reply Last reply Reply Quote 0
                            • B
                              BB_aviator @stephenw10
                              last edited by Apr 18, 2023, 2:33 AM

                              @stephenw10

                              Steve,
                              Couldn't access the Crash report.

                              here are the contents of the PHP file:

                              [17-Apr-2023 17:25:59 US/Eastern] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng.inc:1475
                              Stack trace:
                              #0 /usr/local/pkg/pfblockerng/pfblockerng.inc(7241): pfb_build_if_list(true, false)
                              #1 /usr/local/pkg/pfblockerng/pfblockerng.inc(10790): sync_package_pfblockerng()
                              #2 /etc/inc/pkg-utils.inc(781) : eval()'d code(1): pfblockerng_php_pre_deinstall_command()
                              #3 /etc/inc/pkg-utils.inc(781): eval()
                              #4 /etc/inc/pkg-utils.inc(1093): eval_once('pfblockerng_php...')
                              #5 /etc/rc.packages(80): delete_package_xml('pfBlockerNG-dev...', 'deinstall')
                              #6 {main}
                              thrown in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 1475

                              -Bill

                              1 Reply Last reply Reply Quote 0
                              • S
                                stephenw10 Netgate Administrator
                                last edited by Apr 18, 2023, 12:22 PM

                                @bb_aviator said in PHP Fatal error : Cannot access offset of type string on string /usr/local/www/status_interfaces.php:137:

                                pfblockerng.inc:1475

                                Ah that's a completely different error. But you can see that's in the deinstall script that runs during the upgrade. It's almost certainly due to the php change at that point and would not be present after upgrading. If you clear the error(s) does it return?

                                Is that switch config actually from your file? It's invalid xml because there are missing ]s from several lines. Fort example:
                                <descr><![CDATA[test_net]></descr>
                                Should be
                                <descr><![CDATA[test_net]]></descr>

                                Steve

                                B 1 Reply Last reply Apr 18, 2023, 1:32 PM Reply Quote 0
                                • B
                                  BB_aviator @stephenw10
                                  last edited by Apr 18, 2023, 1:32 PM

                                  @stephenw10
                                  Steve,
                                  Thanks for your review of the error message and my misunderstanding of what happened.. PFsense and PFBlocker seem to be working fine.

                                  I cleared the message from pfsense and will see if it recurs.

                                  The missing "]" s was simply a transcription error on my part in extracting from the config file.

                                  I confess I don't understand PHP, but wonder why this 'fatal error' never occurred in previous upgrades of PFsense. Could it be that there was a patch to PFblockerNG that occurred since the version I had, and perhaps the fatal error occurred because PFsense had to remove the version previously installed??

                                  Bill

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    stephenw10 Netgate Administrator
                                    last edited by Apr 18, 2023, 1:37 PM

                                    It didn't happen in previous releases because php didn't change major versions.

                                    The same thing (or similar) did happen when we moved from php5 to php7 a few years ago. We mitigated numerous php issues in testing but with a major version change like that there were always going to be some we didn't find.

                                    Steve

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post
                                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                      This community forum collects and processes your personal information.
                                      consent.not_received