DHCP leases UI bug?

  • LAYER 8 Moderator

    Hi guys,

    just fired up a new pfSense with 2.0.1 yesterday. Seems pretty smooth until I activated the DHCP Server on LAN. I made a few reservations with MACs - checked the DHCP leases page - good, everything was showing up.
    Later the evening as more clients connected and got dynamically assigned I wanted to check the status page again - not working! I got the error:

    Fatal error: Cannot use string offset as an array in /usr/local/www/status_dhcp_leases.php on line 354

    just above the table where the leases should show up. This is a new installed 2.0.1, no update. So is there a bug in the parser for the leases file or sth like that? Any way I could possibly fix this by hand?


  • Rebel Alliance Developer Netgate

    Interesting, that error implies that your DHCP config is somehow incomplete, that line is trying to pull in values from the start/end of the DHCP range and it's saying that the range itself may not exist at all.

    If you take a config backup, what does the DCHP section of the config look like?

  • LAYER 8 Moderator

    Gross, didn't actually think it was based on config being pulled. I merely thought it was from reading values from the leases file. Thanks Jimp for pointing that out, didn't see hat as I was browsing through the PHP file, I'll look into it and post ASAP.

  • LAYER 8 Moderator

    Nope, that doesn't seem to fit:

    		<domainsearchlist>test.lan, mobile.test.lan</domainsearchlist>

    That seems pretty much OK to me. So it doesn't seem to be a problem related to the given range. Even if I change the range parameters, it is saved right (and shows up in the config) but the error resists. It always occurs after the first IP is given out. If the list is empty, the parsing seems to work.

  • Any more information on this?

    I have the same problem and dhcpd config seems to be OK.

    - <dhcpd>- <lan>- <range><from></from> 
      <opt3>- <opt7>- <range><from></from> 
    - <opt10>- <range><from></from> 

  • Rebel Alliance Developer Netgate

  • @jimp:

    This might help


    Could you please explain a couple things for me?

    1. It appears the dhcp config in the above posts are a range.  So why would they not be an array and causing this php error?  Mine is also a range.  But unlike these others I do not get this error.

    2. The patch you linked to starts on line 371.  That code hunk in my status_dhcp_leases.php starts at line 350.  Why the difference?


    2.0.1-RELEASE (i386)
    built on Mon Dec 12 18:24:17 EST 2011
    FreeBSD 8.1-RELEASE-p6

  • Rebel Alliance Developer Netgate

    1. I don't know, but that's where the error is, so that's where the check went. The second guy had a "<opt3>" entry which could have led to this, but the fist one I still don't see how it would have landed on that error. Either way, it's more correct to test and bypass here than it would be to keep processing, so it's the right fix for the error at least.

    2. This patch is against master (2.1), you're probably on 2.0.x.</opt3>

  • I'm sorry if this is a total noob question.
    Will the proposed fix from the github link be persistent? I mean, will the fix remain in place after a reboot?

  • Rebel Alliance Developer Netgate

    If you edit the change into the file, then yes it'll persist between reboots. It would be lost during a firmware upgrade if the new firmware doesn't already include this change.

  • Verry sorry to reply to an old topic, but did anyone document the github link above? I'm having the same problem again on one machine and it's quite annoying. Thanks for any help!

  • On GitHub, BSDperimeter changed to pfSense a while ago. So the link is now:

Log in to reply