PHP Fatal error: Uncaught Error: Cannot use string offset as an array



  • Hello @ all,

    i am new to pfsense and started to setup a new install on a hardware machine.
    Additionally i have installed the pfblockerng-devel, nmap and snort packages.

    Randomly access to WAN or the webinterface stops working until i reboot the device.
    On the dashboard i am getting the hint to the specific error which hints do to something with the vlan config.
    VLANs are set up through the console.
    PFsense is up to date.

    [10-Jun-2019 07:52:19 Europe/Berlin] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /etc/inc/config.console.inc:499
    Stack trace:
    #0 /etc/inc/config.console.inc(103): vlan_setup()
    #1 /etc/rc.initial.setports(37): set_networking_interfaces_ports()
    #2 {main}
    thrown in /etc/inc/config.console.inc on line 499
    [10-Jun-2019 07:52:39 Europe/Berlin] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in /etc/inc/config.console.inc:499
    Stack trace:
    #0 /etc/inc/config.console.inc(103): vlan_setup()
    #1 /etc/rc.initial.setports(37): set_networking_interfaces_ports()
    #2 {main}
    thrown in /etc/inc/config.console.inc on line 499

    Does anyone know what to do to stop this behaviour?



  • @faib_x said in PHP Fatal error: Uncaught Error: Cannot use string offset as an array:

    to do to stop this behaviour?

    Yep.
    Redo your VLAN config - or post your settings here for more advice.
    A fact is that some user input related to VLAN isn't correct, and the parsing complains now. this should have been flagged as an error as soon as you entered it.
    No body knows what you did ...

    @faib_x said in PHP Fatal error: Uncaught Error: Cannot use string offset as an array:

    nmap and snort packages.

    Not what I call beginner packages ^^



  • Thank you for your answer.
    There is not much i have entered in VLAN config over console. Just the VLAN tag to interface - no errors.
    I completly removed the snort package from pfsense and the issue seems gone.
    Maybe a missconfiguration i have made in the snort package itself or an error while installation.
    Strange.


  • Rebel Alliance Developer Netgate

    What version of pfSense?

    If that is not on pfSense 2.4.4-p3, upgrade to 2.4.4-p3.

    Next, look in a backup of your config.xml and post what you have in your <vlans>...</vlans> section. There might be an empty tag inside there somewhere like <vlan/> or similar that is tripping up some code.



  • My pfSense is on version 2.4.4-p3.
    In my backup config.xml i have an empty <vlans></vlans> between </revision> and <cert>.
    On installation i had set up the vlans in console > 1) Assign Interfaces > Should VLANs be set up now [y | n]? y > Interface Name > VLAN number.
    So the VLANs should be listed in config.xml or something went wrong on installation?


  • Rebel Alliance Developer Netgate

    I have not been able to reproduce the problem here, but I can see how it might happen. I opened https://redmine.pfsense.org/issues/9582 to track it and committed a fix: https://github.com/pfsense/pfsense/commit/45f95753963e497b5ce14493f9cca05336d75c7b

    You can install the System Patches package and then create an entry for 45f95753963e497b5ce14493f9cca05336d75c7b to apply the fix.

    Alternately, you can use viconfig to edit the config and remove that <vlans></vlans> line, or download a backup, edit it out, then restore.