Page MenuHomeVyOS Platform

Error on interrupting list of pppoe sessions
Backport pending, NormalPublicBUG

Description

When we have lots of PPPoE sessions and trying to interrupt listing, CLI show Traceback

[email protected]:~$ show pppoe-server sessions 
ifname  | username |      ip       | ip6 | ip6-dp |    calling-sid    | rate-limit | state  |  uptime  | rx-bytes  | tx-bytes 
---------+----------+---------------+-----+--------+-------------------+------------+--------+----------+-----------+----------
 ppp0    | 2        | 100.64.14.164 |     |        | 02:00:00:00:00:02 |            | active | 00:19:20 | 100.1 KiB | 9.9 KiB  
 ppp1    | 3        | 100.64.14.163 |     |        | 02:00:00:00:00:03 |            | active | 00:19:20 | 99.8 KiB  | 11.3 KiB 
 ppp2    | 5        | 100.64.14.165 |     |        | 02:00:00:00:00:05 |            | active | 00:19:20 | 99.4 KiB  | 13.6 KiB 
 ppp3    | 6        | 100.64.14.167 |     |        | 02:00:00:00:00:06 |            | active | 00:19:20 | 99.7 KiB  | 9.7 KiB  
 ppp4    | 7        | 100.64.14.166 |     |        | 02:00:00:00:00:07 |            | active | 00:19:20 | 99.4 KiB  | 9.7 KiB  
 ppp5    | 8        | 100.64.14.168 |     |        | 02:00:00:00:00:08 |            | active | 00:19:20 | 100.1 KiB | 10.2 KiB 
 ppp6    | 9        | 100.64.14.169 |     |        | 02:00:00:00:00:09 |            | active | 00:19:20 | 100.1 KiB | 9.9 KiB  
 ppp7    | 10       | 100.64.14.170 |     |        | 02:00:00:00:00:0a |            | active | 00:19:20 | 99.7 KiB  | 11.6 KiB 
 ppp8    | 11       | 100.64.14.225 |     |        | 02:00:00:00:00:0b |            | active | 00:19:20 | 96.8 KiB  | 11.8 KiB 
 ppp9    | 12       | 100.64.14.171 |     |        | 02:00:00:00:00:0c |            | active | 00:19:20 | 99.7 KiB  | 8.0 KiB  
 ppp10   | 13       | 100.64.14.173 |     |        | 02:00:00:00:00:0d |            | active | 00:19:20 | 99.5 KiB  | 9.1 KiB  
 ppp11   | 14       | 100.64.14.172 |     |        | 02:00:00:00:00:0e |            | active | 00:19:20 | 98.9 KiB  | 9.3 KiB  
 ppp12   | 15       | 100.64.14.175 |     |        | 02:00:00:00:00:0f |            | active | 00:19:20 | 99.3 KiB  | 10.3 KiB 
 ppp13   | 16       | 100.64.14.174 |     |        | 02:00:00:00:00:10 |            | active | 00:19:20 | 99.3 KiB  | 11.9 KiB 
 ppp14   | 17       | 100.64.14.177 |     |        | 02:00:00:00:00:11 |            | active | 00:19:20 | 99.2 KiB  | 8.6 KiB  
 ppp19   | 18       | 100.64.14.182 |     |        | 02:00:00:00:00:12 |            | active | 00:19:20 | 99.5 KiB  | 9.6 KiB  
 ppp20   | 19       | 100.64.14.183 |     |        | 02:00:00:00:00:13 |            | active | 00:19:20 | 100.2 KiB | 10.1 KiB 
 ppp21   | 20       | 100.64.14.162 |     |        | 02:00:00:00:00:14 |            | active | 00:19:20 | 99.7 KiB  | 9.7 KiB  
 ppp22   | 21       | 100.64.14.184 |     |        | 02:00:00:00:00:15 |            | active | 00:19:20 | 98.3 KiB  | 7.9 KiB  
 ppp23   | 22       | 100.64.14.185 |     |        | 02:00:00:00:00:16 |            | active | 00:19:20 | 98.8 KiB  | 8.6 KiB  
 ppp24   | 23       | 100.64.14.186 |     |        | 02:00:00:00:00:17 |            | active | 00:19:21 | 98.1 KiB  | 10.2 KiB 
 ppp25   | 24       | 100.64.14.187 |     |        | 02:00:00:00:00:18 |            | active | 00:19:21 | 98.7 KiB  | 8.0 KiB  
 ppp26   | 25       | 100.64.14.188 |     |        | 02:00:00:00:00:19 |            | active | 00:19:21 | 98.5 KiB  | 12.0 KiB 
 ppp27   | 26       | 100.64.14.189 |     |        | 02:00:00:00:00:1a |            | active | 00:19:21 | 99.9 KiB  | 9.6 KiB  
 ppp28   | 27       | 100.64.14.197 |     |        | 02:00:00:00:00:1b |            | active | 00:19:21 | 99.0 KiB  | 7.6 KiB  
 ppp29   | 28       | 100.64.14.190 |     |        | 02:00:00:00:00:1c |            | active | 00:19:21 | 99.1 KiB  | 11.9 KiB 
 ppp30   | 29       | 100.64.14.191 |     |        | 02:00:00:00:00:1d |            | active | 00:19:21 | 98.0 KiB  | 9.9 KiB  
 ppp31   | 30       | 100.64.14.192 |     |        | 02:00:00:00:00:1e |            | active | 00:19:21 | 98.4 KiB  | 10.7 KiB 
 ppp32   | 31       | 100.64.14.193 |     |        | 02:00:00:00:00:1f |            | active | 00:19:21 | 98.9 KiB  | 10.6 KiB 
 ppp33   | 32       | 100.64.14.194 |     |        | 02:00:00:00:00:20 |            | active | 00:19:21 | 97.9 KiB  | 10.5 KiB 
 ppp34   | 33       | 100.64.14.195 |     |        | 02:00:00:00:00:21 |            | active | 00:19:21 | 98.8 KiB  | 8.0 KiB  
 ppp35   | 34       | 100.64.14.196 |     |        | 02:00:00:00:00:22 |            | active | 00:19:21 | 98.1 KiB  | 8.3 KiB  
 ppp36   | 35       | 100.64.14.198 |     |        | 02:00:00:00:00:23 |            | active | 00:19:21 | 98.2 KiB  | 11.5 KiB 
 ppp37   | 36       | 100.64.14.226 |     |        | 02:00:00:00:00:24 |            | active | 00:19:21 | 97.2 KiB  | 8.7 KiB  
 ppp15   | 37       | 100.64.14.178 |     |        | 02:00:00:00:00:25 |            | active | 00:19:21 | 100.6 KiB | 12.7 KiB 
 ppp16   | 4        | 100.64.14.179 |     |        | 02:00:00:00:00:04 |            | active | 00:19:21 | 98.8 KiB  | 9.8 KiB  
 ppp38   | 38       | 100.64.14.199 |     |        | 02:00:00:00:00:26 |            | active | 00:19:21 | 98.2 KiB  | 9.4 KiB  
 ppp39   | 39       | 100.64.14.200 |     |        | 02:00:00:00:00:27 |            | active | 00:19:21 | 97.7 KiB  | 9.1 KiB  
 ppp40   | 40       | 100.64.14.202 |     |        | 02:00:00:00:00:28 |            | active | 00:19:21 | 97.4 KiB  | 10.4 KiB 
 ppp41   | 41       | 100.64.14.201 |     |        | 02:00:00:00:00:29 |            | active | 00:19:21 | 99.2 KiB  | 10.1 KiB 
 ppp42   | 42       | 100.64.14.204 |     |        | 02:00:00:00:00:2a |            | active | 00:19:21 | 97.8 KiB  | 11.4 KiB 
 ppp43   | 43       | 100.64.14.203 |     |        | 02:00:00:00:00:2b |            | active | 00:19:21 | 97.4 KiB  | 9.3 KiB  
 ppp44   | 44       | 100.64.14.205 |     |        | 02:00:00:00:00:2c |            | active | 00:19:21 | 98.3 KiB  | 8.5 KiB  
 ppp45   | 45       | 100.64.14.227 |     |        | 02:00:00:00:00:2d |            | active | 00:19:21 | 97.2 KiB  | 9.1 KiB  
 ppp46   | 46       | 100.64.14.206 |     |        | 02:00:00:00:00:2e |            | active | 00:19:21 | 98.5 KiB  | 7.4 KiB  
 ppp47   | 47       | 100.64.14.207 |     |        | 02:00:00:00:00:2f |            | active | 00:19:21 | 97.1 KiB  | 10.3 KiB 
 ppp48   | 48       | 100.64.14.210 |     |        | 02:00:00:00:00:30 |            | active | 00:19:21 | 98.2 KiB  | 9.7 KiB  
 ppp49   | 49       | 100.64.14.208 |     |        | 02:00:00:00:00:31 |            | active | 00:19:21 | 97.7 KiB  | 8.0 KiB  
 ppp50   | 50       | 100.64.14.209 |     |        | 02:00:00:00:00:32 |            | active | 00:19:21 | 97.2 KiB  | 10.2 KiB 
 ppp51   | 51       | 100.64.14.213 |     |        | 02:00:00:00:00:33 |            | active | 00:19:21 | 97.1 KiB  | 10.5 KiB 
 ppp52   | 52       | 100.64.14.211 |     |        | 02:00:00:00:00:34 |            | active | 00:19:21 | 97.6 KiB  | 10.1 KiB 
 ppp53   | 53       | 100.64.14.212 |     |        | 02:00:00:00:00:35 |            | active | 00:19:21 | 97.9 KiB  | 10.5 KiB 
 ppp54   | 54       | 100.64.14.214 |     |        | 02:00:00:00:00:36 |            | active | 00:19:21 | 97.1 KiB  | 9.5 KiB  
 ppp55   | 55       | 100.64.14.215 |     |        | 02:00:00:00:00:37 |            | active | 00:19:21 | 97.2 KiB  | 10.4 KiB 
 ppp56   | 56       | 100.64.14.176 |     |        | 02:00:00:00:00:38 |            | active | 00:19:21 | 100.7 KiB | 9.0 KiB  
 ppp57   | 57       | 100.64.14.216 |     |        | 02:00:00:00:00:39 |            | active | 00:19:21 | 96.9 KiB  | 7.9 KiB  
 ppp58   | 58       | 100.64.14.217 |     |        | 02:00:00:00:00:3a |            | active | 00:19:21 | 96.9 KiB  | 9.6 KiB  
 ppp59   | 59       | 100.64.14.219 |     |        | 02:00:00:00:00:3b |            | active | 00:19:21 | 97.0 KiB  | 11.0 KiB 
 ppp60   | 60       | 100.64.14.218 |     |        | 02:00:00:00:00:3c |            | active | 00:19:21 | 96.8 KiB  | 11.3 KiB 
 ppp61   | 61       | 100.64.14.222 |     |        | 02:00:00:00:00:3d |            | active | 00:19:21 | 96.5 KiB  | 8.7 KiB  
 ppp62   | 62       | 100.64.14.220 |     |        | 02:00:00:00:00:3e |            | active | 00:19:21 | 96.8 KiB  | 9.1 KiB  
 ppp63   | 63       | 100.64.14.221 |     |        | 02:00:00:00:00:3f |            | active | 00:19:21 | 97.9 KiB  | 11.6 KiB 
 ppp64   | 64       | 100.64.14.224 |     |        | 02:00:00:00:00:40 |            | active | 00:19:21 | 96.6 KiB  | 10.4 KiB 
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/ppp-server-ctrl.py", line 71, in <module>
    main()
  File "/usr/libexec/vyos/op_mode/ppp-server-ctrl.py", line 62, in main
    print(output)
BrokenPipeError: [Errno 32] Broken pipe

Details

Difficulty level
Easy (less than an hour)
Version
1.4-rolling-202103120218
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

Viacheslav changed the task status from Open to Needs testing.Mar 14 2021, 2:45 PM

Works correct for q, but still show backtrace by Ctrl+C

:Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/ppp-server-ctrl.py", line 74, in <module>
    main()
  File "/usr/libexec/vyos/op_mode/ppp-server-ctrl.py", line 63, in main
    print(output)
KeyboardInterrupt

Lets change except BrokenPipeError: to except:

syncer changed the task status from Needs testing to Backport pending.Oct 17 2021, 3:46 PM
syncer assigned this task to Viacheslav.
syncer triaged this task as Normal priority.
syncer moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.

Also, I propose to add missing 'space' to header

[email protected]:~$ show pppoe-server sessions 
ifname  | username |      ip       | ip6 | ip6-dp |    calling-sid    | rate-limit | state  |  uptime  | rx-bytes  | tx-bytes 
---------+----------+---------------+-----+--------+-------------------+------------+--------+----------+-----------+----------

Easy to fix here https://github.com/vyos/vyos-1x/blob/current/src/op_mode/ppp-server-ctrl.py#L63
replace to print(f' {output}')