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

    Help debugging PHP Errors

    Scheduled Pinned Locked Moved General pfSense Questions
    13 Posts 3 Posters 942 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.
    • U
      underqualifieditguy
      last edited by underqualifieditguy

      Good evening,

      I could use some help debugging a crash dump that I received after I’ve had to recover my system from backup two times now after a simple reboot.

      I’ve already reviewed this thread which at first appeared to be related but now I am not sure as the resolution there seemed to be applying a patch when errors are seen with the config cache.

      https://forum.netgate.com/topic/182610/php-error-after-reboot

      [27-Mar-2024 21:21:21 EST] PHP Fatal error:  Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, null given, called in /etc/inc/config.lib.inc on line 1250 and defined in /etc/inc/util.inc:3662
      Stack trace:
      #0 /etc/inc/config.lib.inc(1250): array_path_enabled(NULL, 'notifications/s...', 'disable')
      #1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable')
      #2 /etc/inc/notices.inc(662): notify_via_smtp('No config.xml f...')
      #3 /etc/inc/notices.inc(151): notify_all_remote('No config.xml f...')
      #4 /etc/inc/config.lib.inc(95): file_notice('config.xml', 'No config.xml f...', 'pfSenseConfigur...', '')
      #5 /etc/inc/config.inc(137): parse_config()
      #6 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...')
      #7 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...')
      #8 /etc/rc.ecl(25): require_once('/etc/inc/functi...')
      #9 {main}
        thrown in /etc/inc/util.inc on line 3662
      [27-Mar-2024 21:21:21 EST] PHP Fatal error:  Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, null given, called in /etc/inc/config.lib.inc on line 1250 and defined in /etc/inc/util.inc:3662
      Stack trace:
      #0 /etc/inc/config.lib.inc(1250): array_path_enabled(NULL, 'notifications/s...', 'disable')
      #1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable')
      #2 /etc/inc/notices.inc(662): notify_via_smtp('PHP ERROR: Type...')
      #3 /etc/inc/notices.inc(151): notify_all_remote('PHP ERROR: Type...')
      #4 /etc/inc/config.lib.inc(1154): file_notice('phperror', 'PHP ERROR: Type...', 'PHP errors')
      #5 [internal function]: pfSense_clear_globals()
      #6 {main}
        thrown in /etc/inc/util.inc on line 3662
      [27-Mar-2024 21:21:22 EST] PHP Fatal error:  Uncaught ValueError: Path cannot be empty in /etc/inc/notices.inc:135
      Stack trace:
      #0 /etc/inc/notices.inc(135): fopen('', 'w')
      #1 /etc/inc/config.lib.inc(95): file_notice('config.xml', 'No config.xml f...', 'pfSenseConfigur...', '')
      #2 /etc/inc/config.inc(137): parse_config()
      #3 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...')
      #4 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...')
      #5 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...')
      #6 /etc/inc/config.gui.inc(39): require_once('/etc/inc/notice...')
      #7 /etc/inc/auth.inc(34): require_once('/etc/inc/config...')
      #8 /etc/inc/captiveportal.inc(29): require_once('/etc/inc/auth.i...')
      #9 /etc/inc/service-utils.inc(25): require_once('/etc/inc/captiv...')
      #10 /etc/inc/pkg-utils.inc(26): require_once('/etc/inc/servic...')
      #11 /etc/rc.bootup(27): require_once('/etc/inc/pkg-ut...')
      #12 {main}
        thrown in /etc/inc/notices.inc on line 135
      

      I am not sure if I’m analyzing this correctly but it appears to be complaining about an issue in the config.xml file, this is the result of looking for that file on my system and it’s permissions.

      [2.7.2-RELEASE][admin@pfSense]/root: find / -iname config.xml
      /usr/local/share/pear/PEAR/Command/Config.xml
      /conf.default/config.xml
      /cf/conf/config.xml
      
      [2.7.2-RELEASE][admin@pfSense]/root: ls -la /conf.default/
      total 16
      drwxr-xr-x   2 root wheel  512 Feb 20 09:41 .
      drwxr-xr-x  23 root wheel 1024 Mar  9 14:31 ..
      -rw-r--r--   1 root wheel 6220 Dec  8 11:48 config.xml]
      
      [2.7.2-RELEASE][admin@pfSense]/cf/conf: ls -la config.xml
      -rw-r--r--  1 root wheel 124427 Mar 28 11:40 config.xml
      

      I can post the full error log if necessary, I just want to be able to reboot the router without having to recover from backup every time.

      Many thanks in advance!

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @underqualifieditguy
        last edited by

        @underqualifieditguy said in Help debugging PHP Errors:

        but it appears to be complaining about an issue in the config.xml file

        That's a way to put it.

        It's trying to tell you that :

        5a590954-f3a5-49e1-a11c-f0570a0ccf0b-image.png

        and that's massive show stopper.

        If that file can not be created, and it's often updated, things go bad.
        The most obvious reason is : bad file system, or file system full.

        @underqualifieditguy said in Help debugging PHP Errors:

        https://forum.netgate.com/topic/182610/php-error-after-reboot

        That was 2.7.0 so if it had issues, they are gone.

        Still, I advise you to Run a pfSense Software File System Check (5/2020).

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Mmm, there are two errors there. The first is in importing the config. The second is in trying to show the notice about being unable to open the config file.

          What version are you importing that config into? What version was the config backed up from?

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Hmm actually both are from the notice but the fact it's throwing a notice of 'no config' is indeed alarming. Like it failed to import the config or is unable to open the file.

            Other than the crash report does the restored config appear to be there?

            U 1 Reply Last reply Reply Quote 0
            • U
              underqualifieditguy @stephenw10
              last edited by

              @stephenw10 yes, once I restore the backup it comes up with all of the config as normal. I will run the filesystem check when I get back home today but it operates normally once it’s fully booted. The backup should be from the same version, the initial crash happened a few weeks after I upgraded and I only found out when I went to do maintenance on it and it hung on boot so when I restored the backup, it was from only a couple of days before (well after the upgrade).

              I don’t have any problem reinstalling or even changing out the SSD as long as I’ll be able to get my configuration back :)

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                It's running 2.7.2 currently?

                GertjanG U 2 Replies Last reply Reply Quote 0
                • GertjanG
                  Gertjan @stephenw10
                  last edited by

                  @stephenw10

                  Copied from his initial post :

                  afb3ac41-a86d-450f-835e-690d4fc610f7-image.png

                  So : yes .... (?!)

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  1 Reply Last reply Reply Quote 1
                  • U
                    underqualifieditguy @stephenw10
                    last edited by

                    @stephenw10 said in Help debugging PHP Errors:

                    It's running 2.7.2 currently?

                    Yep!

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      Does the imported config have a <notifications> section?

                      U 1 Reply Last reply Reply Quote 0
                      • U
                        underqualifieditguy @stephenw10
                        last edited by

                        @stephenw10 Nope! I searched the config and there is no notifications section :(

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          Hmm, are you able to upload that config to us to test/review?

                          U 1 Reply Last reply Reply Quote 0
                          • U
                            underqualifieditguy @stephenw10
                            last edited by underqualifieditguy

                            @stephenw10 let me check what needs to be scrubbed tonight and then I can. Also planning on running the filesystem check tonight, the wife and I both WFH so wasn’t able to take it down during the day.

                            I honestly wouldn’t be surprised if there are bad blocks, it’s a cheap SSD I bought years ago and I think I want to switch to ZFS anyway which just means I’d have to grab a couple of more robust new SSD’s.

                            1 Reply Last reply Reply Quote 1
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              Ok you're hitting this but with a slightly different underlying error: https://redmine.pfsense.org/issues/15157

                              In both cases the config file is somehow unreadable and the error/notice generated is calling badly creating those PHP errors. That's masking the real problem.

                              Try resaving the Sys > Adv > Notifications page so the config does have a notifications section if you can. That may workaround the error so you can see the real issue.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.