FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.33k stars 1.25k forks source link

Undefined symbol "netsnmp_enable_subagent" #14875

Closed zappiehost closed 1 month ago

zappiehost commented 11 months ago

Describe the bug

To Reproduce

1) Compile the latest FRR from git (9.0.1) in FreeBSD 2) Follow the instructions to compile latest FRR (9.0.1) from here: https://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-freebsd14.html 2) make sure to add the --with-snmp=agentx into your ./configure 3) gmake && gmake install 4) Confirm FRR was build with snmp by running bgpd -v and looking for the --enable-snmp 5) execute bgpd -M snmp to replicate the fatal error

frr_init: loader error: dlopen(/usr/local/lib/frr/modules/bgpd_snmp.so): /usr/local/lib/libfrrsnmp.so.0: Undefined symbol "netsnmp_enable_subagent"
frr_init: loader error: dlopen(/usr/local/lib/frr/modules/snmp.so): Cannot open "/usr/local/lib/frr/modules/snmp.so"
frr_init: loader error: dlopen(snmp): Shared object "snmp" not found, required by "bgpd"

Expected behavior

I expect that FRR will start up without lib and .so files missing.

Screenshots

Screenshot 2023-11-26 at 7 55 14 PM

Versions

Additional context This has been an issue in OpenSense and PfSense and also FreeBSD ports when trying to enable SNMP with frr

donaldsharp commented 11 months ago

the Equivalent package on debian is libsnmp-dev that you are missing. I would suggest you figure out what the equivalent package is on freebsd and install it as well. I do not have a equivalent freebsd-14 vm at this point in time to do any type of experimenting to help you out

zappiehost commented 11 months ago

Thanks for the reply @donaldsharp

I have (and always did) have the net-snmp package installed on the FreeBSD system prior to compiling FRR with snmp support.

If I tried to compile FRRwithout net-snmp (which has libsnmp) the FRR compiler would complain on the ./configure dependancy check.

Is there anything I can help test to get this working as both our routers running PfSense and OpenSense have these issues with FRR (both being on FreeBSD)

Thanks!

rwgbsd commented 10 months ago

I have replicated this locally. It looks as if we need an additional .so pulled in to resolve the symbol "netsnmp_enable_subagent". It is starting to look like they split out the agentx stuff into a seperate lib as this support is optional. This bug may affect other operating systems, which I shall also investigate.

zappiehost commented 10 months ago

I have replicated this locally. It looks as if we need an additional .so pulled in to resolve the symbol "netsnmp_enable_subagent". It is starting to look like they split out the agentx stuff into a seperate lib as this support is optional. This bug may affect other operating systems, which I shall also investigate.

How did you searching go @rwgbsd Did you find what package might be missing in order to get FRR with SNMP to work?

rwgbsd commented 10 months ago

How did you searching go @rwgbsd Did you find what package might be missing in order to get FRR with SNMP to work?

This is not a matter of a missing pacakge, net-snmp infact includes a library file with the netsnmp_enable_subagent" defined, but the frr compile code is not pulling in that library for some reason. Either the net-snmp package has changed or this has been broken for a very long time.

I did not have time this past week to get back to this, hopefully I can atleast find out how wide spread the breakage is soon. Is anyone out there successfully running frr with net-snmp on ANY platform? Debian? Ubuntu?

zappiehost commented 9 months ago

That makes sense @rwgbsd

Did you by chance manage to find what (and where) is missing for the libs and might need to be pulled differently in to make SNMP with FRR?

I can replicate this issue on Debain 12 with latest src from git (followed this guide: https://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-debian12.html#install-required-packages)

root@debain12:/tmp/frr# ./bgpd/bgpd -v
bgpd version 9.2-dev
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
    '--localstatedir=/var/opt/frr' '--sbindir=/usr/lib/frr' '--sysconfdir=/etc/frr' '--enable-multipath=64' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' '--enable-fpm' '--with-snmp=agentx'
root@debain12:/tmp/frr# ./bgpd/bgpd -M snmp
frr_init: loader error: dlopen(/usr/local/lib/frr/modules/bgpd_snmp.so): /usr/local/lib/frr/modules/bgpd_snmp.so: cannot open shared object file: No such file or directory
frr_init: loader error: dlopen(/usr/local/lib/frr/modules/snmp.so): /usr/local/lib/frr/modules/snmp.so: cannot open shared object file: No such file or directory
frr_init: loader error: dlopen(snmp): snmp: cannot open shared object file: No such file or directory
root@debain12:/tmp/frr# ls -lsa  /usr/local/lib/frr/modules/
total 3376
   4 drwxr-xr-x 2 root root    4096 Jan 23 22:41 .
   4 drwxr-xr-x 3 root root    4096 Jan 23 22:41 ..
   4 -rwxr-xr-x 1 root root     992 Jan 23 22:41 dplane_fpm_nl.la
 192 -rwxr-xr-x 1 root root  195344 Jan 23 22:41 dplane_fpm_nl.so
   4 -rwxr-xr-x 1 root root     974 Jan 23 22:41 pathd_pcep.la
2568 -rwxr-xr-x 1 root root 2626064 Jan 23 22:41 pathd_pcep.so
   4 -rwxr-xr-x 1 root root    1022 Jan 23 22:41 zebra_cumulus_mlag.la
  60 -rwxr-xr-x 1 root root   58072 Jan 23 22:41 zebra_cumulus_mlag.so
   4 -rwxr-xr-x 1 root root    1040 Jan 23 22:41 zebra_fpm.la
 292 -rwxr-xr-x 1 root root  295424 Jan 23 22:41 zebra_fpm.so
   4 -rwxr-xr-x 1 root root     974 Jan 23 22:41 zebra_irdp.la
 236 -rwxr-xr-x 1 root root  237864 Jan 23 22:41 zebra_irdp.so
github-actions[bot] commented 1 month ago

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

frrbot[bot] commented 1 month ago

This issue will be automatically closed in the specified period unless there is further activity.