GithubHelp home page GithubHelp logo

Comments (5)

prgeor avatar prgeor commented on May 25, 2024 1

@andywongarista could you take a look if possible?

from sonic-platform-common.

aravindmani-1 avatar aravindmani-1 commented on May 25, 2024

@prgeor Could you please check this issue?.

from sonic-platform-common.

andywongarista avatar andywongarista commented on May 25, 2024

I haven't been able to reproduce this error exactly but I'm encountering a different error:

SONiC Software Version: SONiC.branch.master-ars.98914b08-buildimage.3855ce284-nightly-2021.12.23.18.34
Distribution: Debian 10.11
Kernel: 4.19.0-12-2-amd64
Build commit: 9c0ebe7ae
Build date: Thu Dec 23 18:43:55 UTC 2021
Built by: jenkins@jenkins-arsonic-2-vb59s

Platform: x86_64-arista_7060dx4_32
HwSKU: Arista-7060DX4-C32
ASIC: broadcom
ASIC Count: 1
Serial Number: JPE21204635
Model Number: DCS-7060DX4-32
Hardware Revision: 04.00
Uptime: 23:13:28 up  3:47,  2 users,  load average: 0.23, 0.22, 0.27


>>> from sonic_platform.chassis import Chassis
>>> c=Chassis()
>>> c.get_sfp(1).get_transceiver_info()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py", line 24, in get_transceiver_info
    return api.get_transceiver_info() if api is not None else None
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/api/public/cmis.py", line 121, in get_transceiver_info
    admin_info = self.xcvr_eeprom.read(consts.ADMIN_INFO_FIELD)
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/xcvr_eeprom.py", line 30, in read
    return field.decode(raw_data, **decoded_deps)
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 252, in decode
    result[field.name] = field.decode(raw_data[offset - start: offset + field.get_size() - start],
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 252, in decode
    result[field.name] = field.decode(raw_data[offset - start: offset + field.get_size() - start],
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 203, in decode
    code = struct.unpack(self.format, raw_data)[0]
struct.error: unpack requires a buffer of 1 bytes

I believe the inclusion of page 01 fields in the ADMIN_INFO_FIELD group is causing this error for 400G DAC, e.g. https://github.com/Azure/sonic-platform-common/blob/77da9c8440dda385db745c070453ff343acc1eac/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py#L64

from sonic-platform-common.

aravindmani-1 avatar aravindmani-1 commented on May 25, 2024

I haven't been able to reproduce this error exactly but I'm encountering a different error:

SONiC Software Version: SONiC.branch.master-ars.98914b08-buildimage.3855ce284-nightly-2021.12.23.18.34
Distribution: Debian 10.11
Kernel: 4.19.0-12-2-amd64
Build commit: 9c0ebe7ae
Build date: Thu Dec 23 18:43:55 UTC 2021
Built by: jenkins@jenkins-arsonic-2-vb59s

Platform: x86_64-arista_7060dx4_32
HwSKU: Arista-7060DX4-C32
ASIC: broadcom
ASIC Count: 1
Serial Number: JPE21204635
Model Number: DCS-7060DX4-32
Hardware Revision: 04.00
Uptime: 23:13:28 up  3:47,  2 users,  load average: 0.23, 0.22, 0.27


>>> from sonic_platform.chassis import Chassis
>>> c=Chassis()
>>> c.get_sfp(1).get_transceiver_info()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py", line 24, in get_transceiver_info
    return api.get_transceiver_info() if api is not None else None
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/api/public/cmis.py", line 121, in get_transceiver_info
    admin_info = self.xcvr_eeprom.read(consts.ADMIN_INFO_FIELD)
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/xcvr_eeprom.py", line 30, in read
    return field.decode(raw_data, **decoded_deps)
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 252, in decode
    result[field.name] = field.decode(raw_data[offset - start: offset + field.get_size() - start],
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 252, in decode
    result[field.name] = field.decode(raw_data[offset - start: offset + field.get_size() - start],
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 203, in decode
    code = struct.unpack(self.format, raw_data)[0]
struct.error: unpack requires a buffer of 1 bytes

I believe the inclusion of page 01 fields in the ADMIN_INFO_FIELD group is causing this error for 400G DAC, e.g.

https://github.com/Azure/sonic-platform-common/blob/77da9c8440dda385db745c070453ff343acc1eac/sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py#L64

Yes. I could able to repro the same issue as well.

from sonic-platform-common.

prgeor avatar prgeor commented on May 25, 2024

issue is now fixed

from sonic-platform-common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.