Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgp: T6106: Show complete FRR output on internal errors #3151

Merged
merged 1 commit into from Mar 23, 2024

Conversation

HollyGurza
Copy link
Contributor

handle vtysh bgp error

Change Summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

vyos@vyos# set protocols bgp peer-group peer1 address-family l2vpn-evpn route-reflector-client
[edit]
vyos@vyos# set protocols bgp system-as 1
[edit]
vyos@vyos# commit

% Invalid command. Not an internal neighbor

[[protocols bgp]] failed
Commit failed
[edit]
vyos@vyos# 

Smoketest result

vyos@vyos:~$ python3 /usr/libexec/vyos/tests/smoke/cli/test_protocols_bgp.py 
test_bgp_01_simple (__main__.TestProtocolsBGP.test_bgp_01_simple) ... ok
test_bgp_02_neighbors (__main__.TestProtocolsBGP.test_bgp_02_neighbors) ... ok
test_bgp_03_peer_groups (__main__.TestProtocolsBGP.test_bgp_03_peer_groups) ... ok
test_bgp_04_afi_ipv4 (__main__.TestProtocolsBGP.test_bgp_04_afi_ipv4) ... ok
test_bgp_05_afi_ipv6 (__main__.TestProtocolsBGP.test_bgp_05_afi_ipv6) ... ok
test_bgp_06_listen_range (__main__.TestProtocolsBGP.test_bgp_06_listen_range) ... ok
test_bgp_07_l2vpn_evpn (__main__.TestProtocolsBGP.test_bgp_07_l2vpn_evpn) ... ok
test_bgp_09_distance_and_flowspec (__main__.TestProtocolsBGP.test_bgp_09_distance_and_flowspec) ... ok
test_bgp_10_vrf_simple (__main__.TestProtocolsBGP.test_bgp_10_vrf_simple) ... ok
test_bgp_11_confederation (__main__.TestProtocolsBGP.test_bgp_11_confederation) ... ok
test_bgp_12_v6_link_local (__main__.TestProtocolsBGP.test_bgp_12_v6_link_local) ... ok
test_bgp_13_vpn (__main__.TestProtocolsBGP.test_bgp_13_vpn) ... ok
test_bgp_14_remote_as_peer_group_override (__main__.TestProtocolsBGP.test_bgp_14_remote_as_peer_group_override) ... ok
test_bgp_15_local_as_ebgp (__main__.TestProtocolsBGP.test_bgp_15_local_as_ebgp) ... ok
test_bgp_16_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_16_import_rd_rt_compatibility) ... ok
test_bgp_17_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_17_import_rd_rt_compatibility) ... ok
test_bgp_18_deleting_import_vrf (__main__.TestProtocolsBGP.test_bgp_18_deleting_import_vrf) ... ok
test_bgp_19_deleting_default_vrf (__main__.TestProtocolsBGP.test_bgp_19_deleting_default_vrf) ... ok
test_bgp_20_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_20_import_rd_rt_compatibility) ... ok
test_bgp_21_import_unspecified_vrf (__main__.TestProtocolsBGP.test_bgp_21_import_unspecified_vrf) ... ok
test_bgp_22_interface_mpls_forwarding (__main__.TestProtocolsBGP.test_bgp_22_interface_mpls_forwarding) ... ok
test_bgp_23_vrf_interface_mpls_forwarding (__main__.TestProtocolsBGP.test_bgp_23_vrf_interface_mpls_forwarding) ... ok
test_bgp_24_srv6_sid (__main__.TestProtocolsBGP.test_bgp_24_srv6_sid) ... ok
test_bgp_25_ipv4_labeled_unicast_peer_group (__main__.TestProtocolsBGP.test_bgp_25_ipv4_labeled_unicast_peer_group) ... ok
test_bgp_26_commit_error (__main__.TestProtocolsBGP.test_bgp_26_commit_error) ... ok
test_bgp_26_ipv6_labeled_unicast_peer_group (__main__.TestProtocolsBGP.test_bgp_26_ipv6_labeled_unicast_peer_group) ... ok
test_bgp_99_bmp (__main__.TestProtocolsBGP.test_bgp_99_bmp) ... ok

----------------------------------------------------------------------
Ran 27 tests in 185.568s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team March 19, 2024 10:38
LOG.debug(f'frr-reload output: {i:3} {e}')
if code == 1:
if emsg:
raise ConfigError(emsg)

raise CommitError('FRR configuration failed while running commit. Please ' \
'enable debugging to examine logs.\n\n\n' \
'To enable debugging run: "touch /tmp/vyos.frr.debug" ' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should make people create files by hand. It's trivial to add an operational mode command that does it, I think we should do it.

python/vyos/frr.py Show resolved Hide resolved
except:
# we just need to re-try the commit of the configuration
# for the listed FRR issues above
pass
if count >= count_max:
if emsg:
raise ConfigError(emsg)
raise ConfigurationNotValid(f'Config commit retry counter ({count_max}) exceeded for {daemon} dameon!')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/dameon/daemon/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@dmbaturin dmbaturin changed the title bgp: T6106: Valid commit error for route-reflector-client option defi… bgp: T6106: Show complete FRR output on internal errors Mar 23, 2024
@dmbaturin dmbaturin merged commit 19df61f into vyos:current Mar 23, 2024
7 checks passed
@dmbaturin
Copy link
Member

@Mergifyio backport sagitta

Copy link

mergify bot commented Mar 23, 2024

backport sagitta

✅ Backports have been created

@c-po
Copy link
Member

c-po commented Mar 24, 2024

So with this merged it seems like CI is broken.

out: DEBUG - ======================================================================
out: DEBUG - FAIL: test_bgp_26_commit_error (__main__.TestProtocolsBGP.test_bgp_26_commit_error)
out: DEBUG - ----------------------------------------------------------------------
out: DEBUG - Traceback (most recent call last):
out: DEBUG -   File "/usr/libexec/vyos/tests/smoke/cli/test_protocols_bgp.py", line 1244, in test_bgp_26_commit_error
out: DEBUG -     self.assertTrue("% Invalid command. Not an internal neighbor" in str(e.exception))
out: DEBUG - AssertionError: False is not true

I also wonder, are those error messages the "last resort" and the implemented errors in verify() are used first? If so, can you please also add a proper verify() section for this issue of internal neighbors with a better error message?

c-po added a commit that referenced this pull request Mar 24, 2024
bgp: T6106: Show complete FRR output on internal errors (backport #3151)
@HollyGurza HollyGurza mentioned this pull request Mar 26, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants