FRRouting / frr

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

BGPD crash when executing `show rpki prefix X.X.X.X/YY` command #11466

Closed elmemis closed 2 years ago

elmemis commented 2 years ago

Describe the bug

To Reproduce

Configuration:

rpki
 rpki polling_period 1000
 rpki cache rtr.rpki.cloudflare.com 8282 preference 2
exit

Execute command:

show rpki prefix 1.1.1.0/24
vtysh: error reading from bgpd: Success (0)Warning: closing connection to bgpd because of an I/O error!

Log:

Jun 23 22:26:07  bgpd[4952]: [MSXMS-XK80N] RPKI: rtr_mgr is not synced, retrying.
Jun 23 22:26:10  bgpd[4952]: [MSXMS-XK80N] RPKI: rtr_mgr is not synced, retrying.
Jun 23 22:26:13  bgpd[4952]: [QR7VS-DFSYD] RPKI: rtr_mgr sync is done.
Jun 23 22:26:55  watchfrr[4927]: [HD38Q-0HBRT][EC 268435457] bgpd state -> down : read returned EOF
Jun 23 22:26:55  zebra[4947]: [VXKFG-8SJRV][EC 4043309121] Client 'vnc' encountered an error and is shutting down.
Jun 23 22:26:55  zebra[4947]: [VXKFG-8SJRV][EC 4043309121] Client 'bgp' encountered an error and is shutting down.
Jun 23 22:26:55  zebra[4947]: [YDZ55-W3VM6] release_daemon_table_chunks: Released 0 table chunks
Jun 23 22:26:55  zebra[4947]: [JPSA8-5KYEA] client 31 disconnected 0 vnc routes removed from the rib
Jun 23 22:26:55  zebra[4947]: [S929C-NZR3N] client 31 disconnected 0 vnc nhgs removed from the rib
Jun 23 22:26:55  zebra[4947]: [YDZ55-W3VM6] release_daemon_table_chunks: Released 0 table chunks
Jun 23 22:26:55  zebra[4947]: [JPSA8-5KYEA] client 17 disconnected 4 bgp routes removed from the rib
Jun 23 22:26:55  zebra[4947]: [S929C-NZR3N] client 17 disconnected 0 bgp nhgs removed from the rib
Jun 23 22:27:00  watchfrr[4927]: [YFT0P-5Q5YX] Forked background command [pid 4988]: /usr/lib/frr/watchfrr.sh restart bgpd
Jun 23 22:27:00  zebra[4947]: [V98V0-MTWPF] client 17 says hello and bids fair to announce only bgp routes vrf=0
Jun 23 22:27:00  zebra[4947]: [V98V0-MTWPF] client 32 says hello and bids fair to announce only vnc routes vrf=0
Jun 23 22:27:00  bgpd[4997]: [SP97F-NHRBZ] RPKI: Resetting RPKI Session
Jun 23 22:27:00  bgpd[4997]: [JCY9V-X3VW5] RPKI: Init rtr_mgr.
Jun 23 22:27:00  bgpd[4997]: [VDD91-CY4ZC] RPKI: Polling period: 1000
Jun 23 22:27:00  bgpd[4997]: [W1ZFR-RNTNC] RPKI: Starting rtr_mgr.
Jun 23 22:27:00  bgpd[4997]: [MSXMS-XK80N] RPKI: rtr_mgr is not synced, retrying.
Jun 23 22:27:00  bgpd[4997]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00
Jun 23 22:27:00  watchfrr[4927]: [QDG3Y-BY5TN] bgpd state -> up : connect succeeded
Jun 23 22:27:03  bgpd[4997]: [MSXMS-XK80N] RPKI: rtr_mgr is not synced, retrying.
Jun 23 22:27:06  bgpd[4997]: [MSXMS-XK80N] RPKI: rtr_mgr is not synced, retrying.
Jun 23 22:27:09  bgpd[4997]: [QR7VS-DFSYD] RPKI: rtr_mgr sync is done.

Versions

Additional context

Other commands in the RPKI section, work without any problem.

show rpki cache-connection
Connected to group 2
rpki tcp cache rtr.rpki.cloudflare.com 8282 pref 2
show rpki as-number 1001
RPKI/RTR prefix table
Prefix                                   Prefix Length  Origin-AS
2602:fb55::                                 36 -  48         1001
2610:168::                                  40 -  40         1001
Number of IPv4 Prefixes: 0
Number of IPv6 Prefixes: 2
show rpki prefix-table
c0e:7800::                                 24 -  24        36969
2603:2000::                                 20 -  20         7922
2a01:c000::                                 19 -  48         5511
2003::                                      19 -  19         3320
Number of IPv4 Prefixes: 287118
Number of IPv6 Prefixes: 56761
ton31337 commented 2 years ago

@elmemis I can't replicate this on master and even on stable/8.2. Are you able to test the compiled version?

elmemis commented 2 years ago

Yes, with stable/8.2 (installed with apt install frr frr-pythontools frr-rpki-rtrlib work without crash but this version has issues about memory leak (#11339 , #11333 , #11332 ) and we use this functions.

show rpki prefix 1.1.1.0/24
Prefix                                   Prefix Length  Origin-AS
1.1.1.0                                     24 -  24        13335
frr                            8.2.2-0~deb11u1                amd64
frr-pythontools                8.2.2-0~deb11u1                all
frr-rpki-rtrlib                8.2.2-0~deb11u1                amd64
elmemis commented 2 years ago

With this combination of the packages, the issue isn't present.

dpkg -l | grep frr
ii  frr                            8.2.2-stable82-gf669da3-20220619.194113-1~deb11u1 amd64        FRRouting suite of internet protocols (BGP, OSPF, IS-IS, ...)
ii  frr-pythontools                8.2.2-stable82-gf669da3-20220619.194113-1~deb11u1 all          FRRouting suite - Python tools
ii  frr-rpki-rtrlib                8.2.2-0~deb11u1                                   amd64        FRRouting suite - BGP RPKI support (rtrlib)
ii  frr-snmp                       8.2.2-stable82-gf669da3-20220619.194113-1~deb11u1 amd64        FRRouting suite - SNMP support
show rpki prefix 1.1.1.0/24
Prefix                                   Prefix Length  Origin-AS
1.1.1.0                                     24 -  24        13335

The issue is with frr-rpki-rtrlib_8.2.2-stable82-gf669da3-20220619.194113-1~deb11u1_amd64.deb pacakge.

ton31337 commented 2 years ago

To be sure, is this fixed in master?

elmemis commented 2 years ago

To be sure, is this fixed in master?

Yes, work without the reported issue in master.