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

Sfputil crashes while checking is_rj45_port_from_api() #2298

Closed
prgeor opened this issue Aug 5, 2022 · 4 comments
Closed

Sfputil crashes while checking is_rj45_port_from_api() #2298

prgeor opened this issue Aug 5, 2022 · 4 comments
Assignees
Labels

Comments

@prgeor
Copy link
Contributor

prgeor commented Aug 5, 2022

Description

If the optics is NOT present, the API is crashing

## Steps to reproduce the issue
root@str2-7260cx3-acs-12:~# sfputil show eeprom -d 
Traceback (most recent call last):
  File "/usr/local/bin/sfputil", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 662, in eeprom
    if is_rj45_port_from_api(port_name):
  File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 309, in is_rj45_port_from_api
    port_type = sfp.get_transceiver_info()['type']
TypeError: 'NoneType' object is not subscriptable
root@str2-7260cx3-acs-12:~#

Describe the results you received

Describe the results you expected

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

root@str2-7260cx3-acs-12:~# show ver

SONiC Software Version: SONiC.master.130884-a98407c58
Distribution: Debian 11.4
Kernel: 5.10.0-12-2-amd64
Build commit: a98407c58
Build date: Thu Aug  4 14:55:52 UTC 2022
Built by: AzDevOps@sonic-build-workers-001VQH

Platform: x86_64-arista_7260cx3_64
HwSKU: Arista-7260CX3-D108C8
ASIC: broadcom
ASIC Count: 1
Serial Number: JPE20222159
Model Number: DCS-7260CX3-64
Hardware Revision: 03.00
Uptime: 23:35:29 up 19:31,  2 users,  load average: 4.73, 2.28, 1.49
Date: Fri 05 Aug 2022 23:35:29

Docker images:
REPOSITORY                    TAG                       IMAGE ID       SIZE
docker-orchagent              latest                    8d147e2b3f98   474MB
docker-orchagent              master.130884-a98407c58   8d147e2b3f98   474MB
docker-teamd                  latest                    57c85314ed21   456MB
docker-teamd                  master.130884-a98407c58   57c85314ed21   456MB
docker-macsec                 latest                    76c9c7d5b919   458MB
docker-syncd-brcm             latest                    9846263c5b6f   781MB
docker-syncd-brcm             master.130884-a98407c58   9846263c5b6f   781MB
docker-gbsyncd-credo          latest                    f7e0aed8c8a3   458MB
docker-gbsyncd-credo          master.130884-a98407c58   f7e0aed8c8a3   458MB
docker-dhcp-relay             latest                    412c51dcc00a   449MB
docker-sonic-telemetry        latest                    f11f00278cf1   520MB
docker-sonic-telemetry        master.130884-a98407c58   f11f00278cf1   520MB
docker-router-advertiser      latest                    a76a60aa95bc   440MB
docker-router-advertiser      master.130884-a98407c58   a76a60aa95bc   440MB
docker-platform-monitor       latest                    4e245901aebf   562MB
docker-platform-monitor       master.130884-a98407c58   4e245901aebf   562MB
docker-mux                    latest                    191b22423642   489MB
docker-mux                    master.130884-a98407c58   191b22423642   489MB
docker-database               latest                    2d2921df7df6   440MB
docker-database               master.130884-a98407c58   2d2921df7df6   440MB
docker-sflow                  latest                    88e3e3819dc9   429MB
docker-sflow                  master.130884-a98407c58   88e3e3819dc9   429MB
docker-fpm-frr                latest                    852c18934215   458MB
docker-fpm-frr                master.130884-a98407c58   852c18934215   458MB
docker-nat                    latest                    0bc5f4b463b0   431MB
docker-nat                    master.130884-a98407c58   0bc5f4b463b0   431MB
docker-snmp                   latest                    3db6375d49b6   457MB
docker-snmp                   master.130884-a98407c58   3db6375d49b6   457MB
docker-sonic-mgmt-framework   latest                    c2dc8a9d8fb0   558MB
docker-sonic-mgmt-framework   master.130884-a98407c58   c2dc8a9d8fb0   558MB
docker-lldp                   latest                    ca2303527c0c   454MB
docker-lldp                   master.130884-a98407c58   ca2303527c0c   454MB

root@str2-7260cx3-acs-12:~# 
@stephenxs
Copy link
Collaborator

Looks like this issue has been resolved by a latter sonic-utilities PR which has not been in sonic-buildimage.
I'll further check and get back to you

@stephenxs
Copy link
Collaborator

With old sonic-utilities

admin@c-panther-01:~$ sudo sfputil show eeprom -p Ethernet116
Cannot get module EEPROM information: Input/output error
Traceback (most recent call last):
  File "/usr/local/bin/sfputil", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 662, in eeprom
    if is_rj45_port_from_api(port_name):
  File "/usr/local/lib/python3.9/dist-packages/sfputil/main.py", line 309, in is_rj45_port_from_api
    port_type = sfp.get_transceiver_info()['type']
TypeError: 'NoneType' object is not subscriptable
admin@c-panther-01:~$ show version

With the PR #2249 merged

admin@c-panther-01:~$ sudo sfputil show eeprom -p Ethernet116
Cannot get module EEPROM information: Input/output error
Ethernet116: SFP EEPROM not detected

I'll compose submodule update PR soon

@stephenxs
Copy link
Collaborator

Fixed by sonic-net/sonic-buildimage#11643

@stephenxs
Copy link
Collaborator

Closing it since it has been fixed for more than 1 year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants