Skip to content

bgp: option "graceful-restart" causes frr-reload.py to return non zero exit code #8403

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

Closed
1 of 2 tasks
c-po opened this issue Apr 5, 2021 · 3 comments
Closed
1 of 2 tasks
Labels
triage Needs further investigation

Comments

@c-po
Copy link
Contributor

c-po commented Apr 5, 2021

Describe the bug

When reloading the FRR configuration and bgp graceful-restart option is set, the /usr/lib/frr/frr-reload.py script returns with 1 but the configuration is applied properly into FRR - this makes scripts processing the return code fail.

  • Did you check if this is a duplicate issue?
  • Did you test it on the latest FRRouting/frr master branch?

To Reproduce

1.txt

!
frr version 7.5.1-20210401-04-g3d506af6a
frr defaults traditional
hostname LR1.wue3
log syslog
log facility local7
agentx
service integrated-vtysh-config
!
router bgp 100
 no bgp ebgp-requires-policy
 bgp graceful-restart
 no bgp network import-check
 neighbor DAL13 peer-group
 neighbor DAL13 remote-as 200
 neighbor DAL13 ebgp-multihop 2
 neighbor DAL13 update-source dum0
 neighbor 192.168.253.6 peer-group DAL13
 !
 address-family ipv4 unicast
  neighbor DAL13 soft-reconfiguration inbound
 exit-address-family
!
line vty
!
end

2.txt

!
frr version 7.5.1-20210401-04-g3d506af6a
frr defaults traditional
hostname LR1.wue3
log syslog
log facility local7
agentx
service integrated-vtysh-config
!
line vty
!
end

Now you can toggle between 1.txt and 2.txt, while loading 1.txt triggers the error

root@vyos:/home/vyos# /usr/lib/frr/frr-reload.py --reload --debug --daemon bgpd --stdout 1.txt
root@vyos:/home/vyos# echo $?
1
root@vyos:/home/vyos# /usr/lib/frr/frr-reload.py --reload --debug --daemon bgpd --stdout 2.txt
root@vyos:/home/vyos# echo $?
0

Even when frr-reload exists 1, the configuration is applied.

vyos@vyos:~$ vtysh -c "show run"
Building configuration...

Current configuration:
!
frr version 7.5.1-20210401-04-g3d506af6a
frr defaults traditional
hostname LR1.wue3
log syslog
log facility local7
agentx
service integrated-vtysh-config
!
router bgp 100
 no bgp ebgp-requires-policy
 bgp graceful-restart
 no bgp network import-check
 neighbor DAL13 peer-group
 neighbor DAL13 remote-as 200
 neighbor DAL13 ebgp-multihop 2
 neighbor DAL13 update-source dum0
 neighbor 192.168.253.6 peer-group DAL13
 !
 address-family ipv4 unicast
  neighbor DAL13 soft-reconfiguration inbound
 exit-address-family
!
line vty
!
end

Expected behavior

  • do not return a non zero exit code
  • do not apply the configuration if 1 is returned
    I would like to go with option 1, as it feels the rc=1 is triggered by Graceful restart configuration changed, reset all peers to take effect - so this is something the user should do afterwards

Screenshots

Versions

  • OS Version: Debian 10
  • Kernel: 5.10.27
  • FRR Version: 7.5.1-20210401-04-g3d506af6a

Additional context

@c-po c-po added the triage Needs further investigation label Apr 5, 2021
c-po added a commit to vyos/vyos-1x that referenced this issue Apr 5, 2021
…oad bug

When loading a configuration for BGP that contains the graceful-restart
options, the frr-reload script will not return 0, but the config is accepted.

This is a false positive, and related to FRRouting/frr#8403
c-po added a commit to c-po/vyos-1x that referenced this issue Apr 30, 2021
This commit has a dependecy on FRRouting/frr#8403,
thus support will be "commented out" by default.
c-po added a commit to vyos/vyos-1x that referenced this issue Apr 30, 2021
This commit has a dependecy on FRRouting/frr#8403,
thus support will be "commented out" by default.
@c-po
Copy link
Contributor Author

c-po commented May 1, 2021

The issue also appears when configuriong graceful-restart options on the peer level.

@c-po
Copy link
Contributor Author

c-po commented May 3, 2021

Turns out this issue is not frr-reload.py related but rather related to vtysh:

+ vtysh -c configure -c 'frr version 7.5.1-20210401-04-g3d506af6a'
+ echo 0
0
+ vtysh -c configure -c 'hostname LR1.wue3'
+ echo 0
0
+ vtysh -c configure -c 'frr version 7.5.1-20210401-04-g3d506af6a'
+ echo 0
0
+ vtysh -c configure -c 'hostname LR1.wue3'
+ echo 0
0
+ vtysh -c configure -c 'router bgp 100'
+ echo 0
0
+ vtysh -c configure -c 'router bgp 100' -c 'no bgp ebgp-requires-policy'
+ echo 0
0
+ vtysh -c configure -c 'router bgp 100' -c 'bgp graceful-restart'
Graceful restart configuration changed, reset all peers to take effect
% The Graceful Restart command used is not valid at this moment.
+ echo 1
1
+ vtysh -c configure -c 'router bgp 100' -c 'no bgp network import-check'
+ echo 0
0

@c-po
Copy link
Contributor Author

c-po commented May 4, 2021

Turns our, return code 1 is used for both informational messages like "hey joe, please reset your peers" but also on real errors like "BGP -> Specify remote-as or peer-group commands first"

root@vyos:/home/vyos# vtysh -c configure -c 'router bgp 100' -c 'neighbor 1.1.1.1 description foo'
% Specify remote-as or peer-group commands first
root@vyos:/home/vyos# echo $?
1

c-po added a commit to c-po/frr that referenced this issue May 4, 2021
vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter either globally or per-neighbor/peer-group
will emit a message. This message is only informational for the user and should
not create a return code of 1 which signals "error"!

This fixes GitHub issue FRRouting#8403
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter either globally or per-neighbor/peer-group
will emit a message. This message is only informational for the user and should
not create a return code of 1 which signals "error"!

This fixes GitHub issue FRRouting#8403
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter either globally or per-neighbor/peer-group
will emit a message. This message is only informational for the user and should
not create a return code of 1 which signals "error"!

This fixes GitHub issue FRRouting#8403

(cherry picked from commit 30ec1ad)
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter either globally or per-neighbor/peer-group
will emit a message. This message is only informational for the user and should
not create a return code of 1 which signals "error"!

This fixes GitHub issue FRRouting#8403

Signed-off-by: Christian Poessinger <[email protected]>
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter either globally or per-neighbor/peer-group
will emit a message. This message is only informational for the user and should
not create a return code of 1 which signals "error"!

This fixes GitHub issue FRRouting#8403

Signed-off-by: Christian Poessinger <[email protected]>

(cherry picked from commit 7b84b46)
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
…s error

vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter will require a peer reset. This is should
not be treated as an error message (resulting in a return code of 1) but
rather as a simple information to the user.

This fixes GitHub issue FRRouting#8403

$ vtysh -c configure -c 'router bgp 100' -c 'bgp graceful-restart'
Graceful restart configuration changed, reset all peers to take effect
$ echo $?
0

Signed-off-by: Christian Poessinger <[email protected]>
c-po added a commit to c-po/frr that referenced this issue May 4, 2021
…s error

vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter will require a peer reset. This is should
not be treated as an error message (resulting in a return code of 1) but
rather as a simple information to the user.

This fixes GitHub issue FRRouting#8403

$ vtysh -c configure -c 'router bgp 100' -c 'bgp graceful-restart'
Graceful restart configuration changed, reset all peers to take effect
$ echo $?
0

Signed-off-by: Christian Poessinger <[email protected]>

(cherry picked from commit 5b899e9)
@c-po c-po closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

1 participant