jaredhendrickson13 / pfsense-api

The missing REST and GraphQL API package for pfSense
https://pfrest.org/
Apache License 2.0
689 stars 106 forks source link

2.6.0 - Missing functions in system.inc #199

Closed mbentley closed 2 years ago

mbentley commented 2 years ago

Describe the bug There is an error that comes up in a few places (main dashboard, upgrade page, auto backups) due to a couple missing functions in system.inc that appear to be new in 2.6.0 in /etc/inc/system.inc:

https://github.com/pfsense/pfsense/blob/95d74811193b4be8eb515b5dd13e963971f8de57/src/etc/inc/system.inc#L2797-L2843

screenshot 2022-02-18 at 2 34 09 AM

Crash bug report:

Crash report begins.  Anonymous machine information:

amd64
12.3-STABLE
FreeBSD 12.3-STABLE RELENG_2_6_0-n226742-1285d6d205f pfSense

Crash report details:

PHP Errors:
[18-Feb-2022 02:55:38 America/Indiana/Indianapolis] PHP Fatal error:  Uncaught Error: Call to undefined function check_dnsavailable() in /etc/inc/pkg-utils.inc:1330
Stack trace:
#0 /usr/local/www/widgets/widgets/system_information.widget.php(73): get_system_pkg_version(false, true)
#1 {main}
  thrown in /etc/inc/pkg-utils.inc on line 1330
[18-Feb-2022 02:55:47 America/Indiana/Indianapolis] PHP Fatal error:  Uncaught Error: Call to undefined function check_dnsavailable() in /etc/inc/pkg-utils.inc:1331
Stack trace:
#0 /usr/local/www/widgets/widgets/system_information.widget.php(73): get_system_pkg_version(false, true)
#1 {main}
  thrown in /etc/inc/pkg-utils.inc on line 1331
[18-Feb-2022 03:02:06 America/Indiana/Indianapolis] PHP Fatal error:  Uncaught Error: Call to undefined function check_dnsavailable() in /etc/inc/pkg-utils.inc:1331
Stack trace:
#0 /usr/local/www/widgets/widgets/system_information.widget.php(73): get_system_pkg_version(false, true)
#1 {main}
  thrown in /etc/inc/pkg-utils.inc on line 1331

No FreeBSD crash data found.

To Reproduce Steps to reproduce the behavior:

  1. Load the dashboard UI with the version check enabled.

Expected behavior The functions should exist in the patched version

Screenshots or Response If applicable, add screenshots or response data to help explain your problem.

pfSense Version & Package Version:

Affected Endpoints: n/a

Additional context Others reported the bug here: https://forum.netgate.com/topic/170025/crash-report-after-upgrading-to-2-6-yesterday

mbentley commented 2 years ago

Sorry, I'm now seeing that for 2.6.0, it is using the default overrides since there is not yet a 2.6.0 one. I did a quick diff from the original 2.5.2 -> 2.6.0 system.inc to get a patch file and it does seem to apply cleanly to the default system.inc at least (https://gist.github.com/mbentley/032f3f0bf05370cc95dc1e5a10d0d72c). Not sure if that's how you generate them or not but I could make a PR if that is helpful. I haven't worked with this code base before so I don't know if there is anything else I am missing though so figured I'd check in first.

oakslabs commented 2 years ago

I can confirm the same behavior on 3 pfSenses after the upgrade to 2.6.0.

jaredhendrickson13 commented 2 years ago

Hey!

Yes, you are correct the overrides don't exist for 2.6.0 yet. I typically have the overrides for new pfSense releases implemented within a week or two of their release. I have the 2.6.0 overrides ready to go and I plan to have them included in a patch this weekend. I'll update this issue when those changes are merged in.

Thanks!