Skip to content

[DPB] show interface breakout throws error when BREAKOUT_CFG table not present #7957

@alexrallen

Description

@alexrallen

When the user upgrades from a previous version of SONiC such as 202012 the table BREAKOUT_CFG is not automatically imported which is required for certain dynamic port breakout commands to function such as show interface breakout and config interface breakout

While the absence of BREAKOUT_CFG is an intentional design decision (see this comment on #7402) these commands are present and should elegantly handle error and inform the end user they should run config reload -l in order to enable this feature on an upgraded switch.

Experienced Result

admin@r-bulldog-03:~$ show int break
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in
    sys.exit(cli())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/show/interfaces/__init__.py", line 204, in breakout
    cur_brkout_mode = cur_brkout_tbl[port_name]["brkout_mode"]
KeyError: 'Ethernet0'

Desired Result

Some type of human readable error message.
e.g. CONFIG_DB does not contain the required information to complete this action please run config reload -l to import this from the platform files to enable dynamic breakout features

Version

SONiC Software Version: SONiC.master.140-a4b31fcb7_Internal
Distribution: Debian 10.9
Kernel: 4.19.0-12-2-amd64
Build commit: a4b31fcb7
Build date: Mon Jun 14 15:31:01 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02

Platform: x86_64-mlnx_msn4700-r0
HwSKU: ACS-MSN4700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2022X08597
Uptime: 21:11:29 up 16:58,  3 users,  load average: 0.32, 0.25, 0.26

Docker images:
REPOSITORY                                        TAG                             IMAGE ID            SIZE
harbor.mellanox.com/sonic-lc-manager/lc-manager   0.0.6                           07dab0396238        554MB
docker-syncd-mlnx                                 latest                          41d9f031f17d        670MB
docker-syncd-mlnx                                 master.140-a4b31fcb7_Internal   41d9f031f17d        670MB
docker-snmp                                       latest                          93bd11cff0c5        454MB
docker-snmp                                       master.140-a4b31fcb7_Internal   93bd11cff0c5        454MB
docker-teamd                                      latest                          39519881ce7e        423MB
docker-teamd                                      master.140-a4b31fcb7_Internal   39519881ce7e        423MB
docker-nat                                        latest                          094f94d8687c        426MB
docker-nat                                        master.140-a4b31fcb7_Internal   094f94d8687c        426MB
docker-router-advertiser                          latest                          d31730f2d8a1        412MB
docker-router-advertiser                          master.140-a4b31fcb7_Internal   d31730f2d8a1        412MB
docker-platform-monitor                           latest                          6708eb3468f2        701MB
docker-platform-monitor                           master.140-a4b31fcb7_Internal   6708eb3468f2        701MB
docker-lldp                                       latest                          e699b0e15f80        452MB
docker-lldp                                       master.140-a4b31fcb7_Internal   e699b0e15f80        452MB
docker-dhcp-relay                                 latest                          9139ad1c1bfc        419MB
docker-dhcp-relay                                 master.140-a4b31fcb7_Internal   9139ad1c1bfc        419MB
docker-database                                   latest                          7dcb114a2d7a        412MB
docker-database                                   master.140-a4b31fcb7_Internal   7dcb114a2d7a        412MB
docker-orchagent                                  latest                          9f289a7b96c3        442MB
docker-orchagent                                  master.140-a4b31fcb7_Internal   9f289a7b96c3        442MB
docker-macsec                                     latest                          0ddeec697dbc        426MB
docker-macsec                                     master.140-a4b31fcb7_Internal   0ddeec697dbc        426MB
docker-sonic-telemetry                            latest                          4e07a8ec7a64        501MB
docker-sonic-telemetry                            master.140-a4b31fcb7_Internal   4e07a8ec7a64        501MB
docker-sonic-mgmt-framework                       latest                          52b04ff3a071        570MB
docker-sonic-mgmt-framework                       master.140-a4b31fcb7_Internal   52b04ff3a071        570MB
docker-fpm-frr                                    latest                          1aa221bda051        441MB
docker-fpm-frr                                    master.140-a4b31fcb7_Internal   1aa221bda051        441MB
docker-sflow                                      latest                          1540482a009e        424MB
docker-sflow                                      master.140-a4b31fcb7_Internal   1540482a009e        424MB
docker-sonic-restapi                              latest                          6f4fdb26f843        355MB
docker-sonic-restapi                              master.140-a4b31fcb7_Internal   6f4fdb26f843        355MB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions