Errors installing HAProxy and not showing up on services tab
-
HAProxy installs, however with errors using the package manager but does not appear on services tab. build is fresh install of 2.7.2 on bare metal. with restore of backup from 2.7.0. I have tried some of the other tips found in other post such as multiple removals and re-installations, pkg-static upgrade -f pfSense-repoc, and even reinstalled OS from scratch a couple of times however still cannot get it to install correctly.
results from package installer:
>>> Installing pfSense-pkg-haproxy... Updating pfSense-core repository catalogue... Fetching meta.conf: Fetching packagesite.pkg: pfSense-core repository is up to date. Updating pfSense repository catalogue... Fetching meta.conf: Fetching packagesite.pkg: pfSense repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The following 3 package(s) will be affected (of 0 checked): New packages to be INSTALLED: haproxy: 2.8.3 [pfSense] lua53: 5.3.6 [pfSense] pfSense-pkg-haproxy: 0.63_2 [pfSense] Number of packages to be installed: 3 The process will require 5 MiB more space. [1/3] Installing lua53-5.3.6... [1/3] Extracting lua53-5.3.6: ......... done [2/3] Installing haproxy-2.8.3... [2/3] Extracting haproxy-2.8.3: ........ done [3/3] Installing pfSense-pkg-haproxy-0.63_2... [3/3] Extracting pfSense-pkg-haproxy-0.63_2: .......... done Saving updated package information... done. Loading package configuration... done. Configuring package components... Loading package instructions... Custom commands... Executing custom_php_install_command()... Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/haproxy/haproxy.inc:2265 Stack trace: #0 /usr/local/pkg/haproxy/haproxy.inc(1559): use_transparent_clientip_proxying() #1 /usr/local/pkg/haproxy/haproxy.inc(2516): haproxy_writeconf('/var/etc/haprox...') #2 /usr/local/pkg/haproxy/haproxy.inc(702): haproxy_check_run(1) #3 /etc/inc/pkg-utils.inc(778) : eval()'d code(1): haproxy_custom_php_install_command() #4 /etc/inc/pkg-utils.inc(778): eval() #5 /etc/inc/pkg-utils.inc(896): eval_once('haproxy_custom_...') #6 /etc/rc.packages(76): install_package_xml('haproxy') #7 {main} thrown in /usr/local/pkg/haproxy/haproxy.inc on line 2265 PHP ERROR: Type: 1, File: /usr/local/pkg/haproxy/haproxy.inc, Line: 2265, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/haproxy/haproxy.inc:2265 Stack trace: #0 /usr/local/pkg/haproxy/haproxy.inc(1559): use_transparent_clientip_proxying() #1 /usr/local/pkg/haproxy/haproxy.inc(2516): haproxy_writeconf('/var/etc/haprox...') #2 /usr/local/pkg/haproxy/haproxy.inc(702): haproxy_check_run(1) #3 /etc/inc/pkg-utils.inc(778) : eval()'d code(1): haproxy_custom_php_install_command() #4 /etc/inc/pkg-utils.inc(778): eval() #5 /etc/inc/pkg-utils.inc(896): eval_once('haproxy_custom_...') #6 /etc/rc.packages(76): install_package_xml('haproxy') #7 {main} thrownpkg-static: POST-INSTALL script failed >>> Cleaning up cache... done. Success
additional PHP related error captured from top of main page after installion:
PHP ERROR: Type: 1, File: /usr/local/pkg/haproxy/haproxy.inc, Line: 2265, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/haproxy/haproxy.inc:2265 Stack trace: #0 /usr/local/pkg/haproxy/haproxy.inc(1559): use_transparent_clientip_proxying() #1 /usr/local/pkg/haproxy/haproxy.inc(2516): haproxy_writeconf('/var/etc/haprox...') #2 /usr/local/pkg/haproxy/haproxy.inc(702): haproxy_check_run(1) #3 /etc/inc/pkg-utils.inc(778) : eval()'d code(1): haproxy_custom_php_install_command() #4 /etc/inc/pkg-utils.inc(778): eval() #5 /etc/inc/pkg-utils.inc(896): eval_once('haproxy_custom_...') #6 /etc/rc.packages(76): install_package_xml('haproxy') #7 {main} thrown @ 2024-04-01 19:07:55
-
One of the very last steps in package installation is creating the necessary entries in
config.xml
to display any associated entries under the SERVICES menu (and possibly the Services widget). If PHP errors are encountered during the last portion of the install script, then the installation PHP process can crash and terminate without getting to the last part where it actually creates the SERVICES entries. I suspect that is what is happening here. Those PHP errors are crashing the installer process before it completes the final step of creating the SERVICES entries.Package installation on pfSense is often a two-step process. The first step uses the binary
pkg
utility from FreeBSD to download all the required package files and then install any necessary binary bits. The second step is run from a PHP process (and not within thepkg
utility). That second step is where things get written to the pfSenseconfig.xml
file to complete the installation of the full package. Package maintainers have access to an install hook function that can be used to allow the PHP GUI portion of the package to accomplish certain things at install time (such as finding and recovering an existing installation configuration, for example). HAProxy is using such a hook here:/etc/inc/pkg-utils.inc(778) : eval()'d code(1): haproxy_custom_php_install_command()
There is a PHP error happening during that hook function's execution, and the error is crashing the installer PHP process and thus the full installation of HAProxy does not complete (you wind up with only a partial install).
The crash is happening in the file
/usr/local/pkg/haproxy/haproxy.inc
at line 2265:/usr/local/pkg/haproxy/haproxy.inc, Line: 2265, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/haproxy/haproxy.inc:2265
-
@bmeeks Thank you very much for such a detailed explanation. I'm not a coder so unable to dig into any of the php to sort how to fix what you have described but is there anywhere that I may find information on how to manually add this service somehow?
-
@frntmn said in Errors installing HAProxy and not showing up on services tab:
@bmeeks Thank you very much for such a detailed explanation. I'm not a coder so unable to dig into any of the php to sort how to fix what you have described but is there anywhere that I may find information on how to manually add this service somehow?
Without knowing the details the HAProxy package expects, there is no way to just add the correct data manually unless you have a backup.
If you have a previously saved
config.xml
backup that contained a working HAProxy configuration, you could restore that configuration and perhaps solve your problem. Or you could examine that backupconfig.xml
, and compare it to the currentconfig.xml
on the firewall in/cf/conf/config.xml
to see what's missing with regards to the HAProxy package and add it back. -
Good idea, I still have the equipment that I migrated from, so I will go back to that one and pull the config and see if I can find the differences in the config, thank you