travisghansen / kubernetes-pfsense-controller

Integrate Kubernetes and pfSense
Apache License 2.0
197 stars 22 forks source link

require_once(): Failed opening required '/usr/local/pkg/openbgpd.inc' on pfsense #25

Closed lozlow closed 1 year ago

lozlow commented 1 year ago

Hi there, I have had kpf set up and working brilliantly for many months but since yesterday I've started seeing a lot of errors like below from pfsense.

 PHP ERROR: Type: 64, File: /usr/local/www/xmlrpc.php(147) : eval()'d code, Line: 1, Message: require_once(): Failed opening required '/usr/local/pkg/openbgpd.inc' (include_path='.:/etc/inc:/usr/local/pfSense/include:/usr/local/pfSense/include/www:/usr/local/www:/usr/local/captiveportal:/usr/local/pkg:/usr/local/www/classes:/usr/local/www/classes/Form:/usr/local/share/pear:/usr/local/share/openssl_x509_crl/') @ 2023-06-16 17:19:59

After a bit of digging I saw that openbgpd was removed but that happened a while ago so I'm not sure why this would only just start happening.

I'm using pfsense version 2.6.0, metal-lb with the plugin setup:

plugins:
  metallb:
    enabled: true
    nodeLabelSelector:
    nodeFieldSelector:
    bgp-implementation: openbgp
    options:
      openbgp:
        # pass through to config.xml
        template:
          md5sigkey:
          md5sigpass:
          groupname: metallb
          row:
            - parameters: announce all
              parmvalue:
  pfsense-dns-services:
    enabled: true
    serviceLabelSelector:
    serviceFieldSelector:
    #
    #allowedHostRegex: "/.*/"
    #
    dnsBackends:
      dnsmasq:
        enabled: false
      unbound:
        enabled: true

Do you have any pointers? Thanks!

lozlow commented 1 year ago

I also see this error:

[16-Jun-2023 16:54:40 Europe/London] PHP Fatal error:  Uncaught Error: Call to undefined function openbgpd_install_conf() in /usr/local/www/xmlrpc.php(147) : eval()'d code:2
Stack trace:
#0 /usr/local/www/xmlrpc.php(147): eval()
#1 /usr/local/share/pear/XML/RPC2/Server/CallHandler/Instance.php(141): pfsense_xmlrpc_server->exec_php('require_once '/...')
#2 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(135): XML_RPC2_Server_Callhandler_Instance->__call('pfsense.exec_ph...', Array)
#3 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(99): XML_RPC2_Backend_Php_Server->getResponse()
#4 /usr/local/www/xmlrpc.php(982): XML_RPC2_Backend_Php_Server->handleCall()
#5 {main}
  thrown in /usr/local/www/xmlrpc.php(147) : eval()'d code on line 2

And I saw that this is called by reloadOpenbgp() in this repo

I guess the problem relates to openbgpd not being installed with pfsense any more, but I'm confused as to why this started happening just yesterday?

travisghansen commented 1 year ago

Are you running openbgp or frr now then?

Suddenly showing up as an issue does seem odd if pfsense didn’t get updated etc. Did someone uninstall openbgpd on your pfsense install?

lozlow commented 1 year ago

I’m not using frr and from what I can see it’s not been possible to install (or therefore uninstall) openbgpd as a package for a long time, since a version before I set up the box so I’m really confused tbh!

Further to that I have it running as a vm and I restored to a backup before yesterday and I get the same error. 😩

I’ll carry on digging, thanks

travisghansen commented 1 year ago

You may need to use the cli to wipe out openbgp if it's still there. If it's gone (seems likely if the .inc files are gone) then just install frr and update as appropriate the config for this. frr may seem daunting to setup but the required config is very small honestly.

lozlow commented 1 year ago

Yeah I think that's the best way to go, I'll configure it with frr instead, thanks for your help!