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

Warning: Illegal string offset 'username' in /etc/inc/xmlparse.inc on line 77

Scheduled Pinned Locked Moved General pfSense Questions
7 Posts 3 Posters 2.2k 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.
  • R
    renaudManda
    last edited by Nov 16, 2015, 7:37 PM

    Hello,

    Since several days I can't save any config.xml using the GUI. I always get  the message:

    Warning: Illegal string offset 'username' in /etc/inc/xmlparse.inc on line 77 Fatal error: Cannot create references to/from string offsets nor overloaded objects in /etc/inc/xmlparse.inc on line 77
    

    But the trouble  seems to be deeper than just to be unable to save a new config (whatever parameter I wanna change), because now at boot time I see also this message in the logs and the booting processes seems to be freeze (per example no IP address is set on the interfaces).

    Using the serial console I can see that multiple instances of rc.initial are run and stay in the process list (never die)

    root         476  0.0  0.5 10584  2236 u0  I    Sun12PM    0:00.02 -sh (sh)
    root         482  0.0  0.4 10584  2144 u0  I    Sun12PM    0:00.02 /bin/sh /etc/rc.initial
    root         526  0.0  0.6 10948  2964 u0  I+   Sun12PM    0:00.15 /bin/tcsh
    root       70926  0.0  0.5 10584  2316  0  Is    8:11PM    0:00.03 -sh (sh)
    root       70927  0.0  0.4 10584  2208  0  I     8:11PM    0:00.02 /bin/sh /etc/rc.initial
    root       70938  0.0  0.6 10948  3056  0  S     8:11PM    0:00.31 /bin/tcsh
    

    I tried to restore a previous config.xml (using local backup) but the trouble still active…

    Any help will be appreciate :)

    Regards,

    Renaud

    1 Reply Last reply Reply Quote 0
    • H
      heper
      last edited by Nov 16, 2015, 9:42 PM

      looks like a broken config to me ….

      could you try to manually copy an old config using console ?
      https://forum.pfsense.org/index.php?topic=57359.msg306319#msg306319

      1 Reply Last reply Reply Quote 0
      • R
        renaudManda
        last edited by Nov 16, 2015, 10:48 PM

        unfortunately it's what I tried at first solution. I deleted also /tmp/config.{cache|lock} as well. I see my old config, but if I try to change settings, or restore a full backup (saved in my computer) I got this error again :(

        1 Reply Last reply Reply Quote 0
        • Z
          Zedful
          last edited by Nov 16, 2015, 11:12 PM

          I'm not an expert
          but you could do these things and give them a try .

          if you mean by active that the process keep appearing in console and does it job ,
          press Ctrl+C to abort it
          then write "exit" to show the menu again

          from my understanding that the file "/etc/inc/xmlparse.inc"
          don't contain configs by it's self , only functions and some variables that used to dump/backup the configurations on the firewall
          to xml file .
          also i searched for string username in it , but couldn't find it .
          maybe there is a package or something modified this file

          do a backup for "xmlparse.inc" and replace it with the default one .

          [ Attachment ]

          xmlparse.zip

          1 Reply Last reply Reply Quote 0
          • R
            renaudManda
            last edited by Nov 23, 2015, 11:13 PM

            Hello,

            I compare your file to mine and I see no diff :(

            In fact each time I try to save a setting I got this trouble. I tried a try/catch in PHP around xmlparser to see exactly on which XML node the parser crash but it soesn't work. In fact the error message indicate that is expcting the key "username" but at line:

            foreach ($curpath as $path) {
                            $ptr =& $ptr[$path];
                    }
            
            

            $ptr doesn't contain usernaname….

            1 Reply Last reply Reply Quote 0
            • R
              renaudManda
              last edited by Nov 23, 2015, 11:30 PM

              Ps: if I try a 'touch /conf/use_xmlreader'

              I Got: Warning: Illegal string offset 'username' in /etc/inc/xmlreader.inc on line 98 Fatal error: Cannot create references to/from string offsets nor overloaded objects in /etc/inc/xmlreader.inc on line 98

              and in the code the variant of xmlparse.inc

              
              } else
                                                      $cfgref =& $cfgarray[$parser->name];
              
              
              1 Reply Last reply Reply Quote 0
              • R
                renaudManda
                last edited by Nov 24, 2015, 1:49 AM

                It was effectively a problem with a config.xml. But in fact it wasn't an issue with the current config.xml but with an old one present in the directory /cf/config/backup. So I moved /cf/conf/backup to /cf/conf/backup.orig and then mkdir /cf/conf/backup and everything came back to the normal.

                It was really frustrating because even if you just wanna save the current setting, pfsense seems to read the back and if one is corrupt crash….

                I hope it could help someone in the future ;)

                Renaud

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  [[user:consent.lead]]
                  [[user:consent.not_received]]