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

device_sdr_entries fails on ipmitool Received a response with unexpected ID 0 vs. 1 #182

Open
ahurst-openai opened this issue Jan 6, 2025 · 0 comments · May be fixed by #184
Open

device_sdr_entries fails on ipmitool Received a response with unexpected ID 0 vs. 1 #182

ahurst-openai opened this issue Jan 6, 2025 · 0 comments · May be fixed by #184

Comments

@ahurst-openai
Copy link

ahurst-openai commented Jan 6, 2025

I'm seeing intermittent stack traces when reading sensor values:

  File "//test.py", line 21, in <module>
    for sensor in iter_func():
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/sensor.py", line 149, in device_sdr_entries
    record = self.get_device_sdr(record_id, reservation_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/sensor.py", line 133, in get_device_sdr
    get_sdr_data_helper(self.reserve_device_sdr_repository,
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/helper.py", line 85, in get_sdr_data_helper
    (next_id, data) = get_fn(reservation_id, record_id, offset, length)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/sensor.py", line 120, in _get_device_sdr_chunk
    rsp = get_sdr_chunk_helper(self.send_message, req,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/helper.py", line 30, in get_sdr_chunk_helper
    rsp = send_fn(req)
          ^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/__init__.py", line 196, in send_message
    rsp = self.interface.send_and_receive(req)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/interfaces/ipmitool.py", line 179, in send_and_receive
    rsp_data = self.send_and_receive_raw(req.target, req.lun, req.netfn,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/interfaces/ipmitool.py", line 154, in send_and_receive_raw
    cc, rsp = self._parse_output(output)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/interfaces/ipmitool.py", line 135, in _parse_output
    rsp = array('B', [
                     ^
  File "/root/.pyenv/versions/3.11.8/lib/python3.11/site-packages/pyipmi/interfaces/ipmitool.py", line 136, in <listcomp>
    int(value, 16) for value in hexstr.split(' ')
    ^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: 'Received'

I added a debug print near the failure:

        if len(hexstr):
+            log().debug(f'{hexstr=}')
            rsp = array('B', [
                int(value, 16) for value in hexstr.split(' ')
            ])

The output on failure:

...
System Temp : 35
hexstr=96 01 53 01 51 01 3a
hexstr=96 01 20 00 0c 07 03 7d 68 01 01 04 2a 04 6a 3f 3f 00 01 00 00 01
hexstr=96 01 00 00 00 00 00 07 14 4f 0b ff 00 5a 55 50 05 05 0a 02 02 00
hexstr=96 01 00 00 cf 50 65 72 69 70 68 65 72 61 6c 20 54 65 6d 70
hexstr=1e c0 c0
Peripheral Temp : 30
hexstr=d9 01 96 01 51 01 3a
hexstr=d9 01 20 00 10 07 10 7d 68 01 01 00 0a 00 6a 3f 3f 00 01 00 00 01
hexstr=d9 01 00 00 00 00 00 07 14 5e 0b ff 00 69 64 5f 05 05 0a 02 02 00
hexstr=Received a response with unexpected ID 0 vs. 1 d9 01 00 00 cf 43 50 55 31 5f 56 52 4d 49 4e 20 54 65 6d 70

Appears to be related to this issue: ipmitool/ipmitool#399

I think it would be sensible to match and handle this output equivalent to the 'failure' lines.

@ahurst-openai ahurst-openai linked a pull request Jan 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant