plugins icon indicating copy to clipboard operation
plugins copied to clipboard

os-frr: bgp commands return non-zero exist status

Open mimartin12 opened this issue 9 months ago • 4 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
  • [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
  • [x] The title contains the plugin to which this issue belongs

Describe the bug A clear and concise description of what the bug is, including last known working version (if any). The BGP panels in Routing > Diagnostics > BGP are blank, and I am seeing errors in the logs related to the bgp command.

Tip: to validate your setup was working with the previous version, use opnsense-revert (https://docs.opnsense.org/manual/opnsense_tools.html#opnsense-revert)

To Reproduce Steps to reproduce the behavior:

  1. Install os-frr
  2. Set up BGP routing.
  3. Add 2 neighbors
  4. Apply configuration
  5. Navigate to Routing > Diagnostics > BGP Expected behavior A clear and concise description of what you expected to happen. I should be able to see details under Routing > Diagnostics > BGP > Summary

Screenshots

Image

Image

Relevant log files If applicable, information from log files supporting your claim.


[21b488d4-caac-4974-852c-522932d026a4] Script action failed with Command '/usr/local/bin/vtysh -c 'show bgp neighbors 'json''' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 78, in execute subprocess.check_call(script_command, env=self.config_environment, shell=True, File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vtysh -c 'show bgp neighbors 'json''' returned non-zero exit status 1.
--



Additional context Add any other context about the problem here.

Environment Software version used and hardware type if relevant.

OPNsense 25.1.3 (amd64). os-frr 1.43_1

mimartin12 avatar Mar 24 '25 22:03 mimartin12

Can you check the following outputs from the CLI:

  1. /usr/local/bin/vtysh -c 'show bgp neighbors 'json''

  2. configctl quagga diagnostics bgp_neighbors json

We need both outputs to find out why it fails.

Monviech avatar Mar 25 '25 13:03 Monviech

@Monviech thanks for troubleshooting. It was painfully obvious that I enabled BGP, but I didn't toggle the checkbox under Routing > General. I was in the weeds and completely missed it here https://docs.opnsense.org/manual/dynamic_routing.html#general-setup. This specific is resolved.

mimartin12 avatar Mar 25 '25 20:03 mimartin12

@Monviech is that something we should validate?

fichtner avatar Mar 26 '25 06:03 fichtner

Missing validation is a larger issue in this plugin. It's hard to start with it at this point in time because there are so many options and who knows how people use it.

I would rather catch the error that invalidates the json output

root@opn-dev-01:/usr/local/etc/caddy # /usr/local/bin/vtysh -c 'show bgp neighbors 'json''
Exiting: failed to connect to any daemons.

Monviech avatar Mar 26 '25 07:03 Monviech