python-ipmi icon indicating copy to clipboard operation
python-ipmi copied to clipboard

establish_session() throws error CompletionCodeError Gigabyte R163-Z30-AAB2-000

Open mark99i opened this issue 10 months ago • 3 comments

Hi, on server Gigabyte R163-Z30-AAB2-000 this code:

import logging
logging.basicConfig(level=logging.DEBUG)

interface = create_interface(
    'rmcp',
    keep_alive_interval=0
)
ipmi: Ipmi = create_connection(interface)
ipmi.session.set_session_type_rmcp(host=ipmi_addr, port=623)
ipmi.session.set_auth_type_user(username=ipmi_login, password=ipmi_passw)

ipmi.target = Target()
ipmi.session.establish()

print(ipmi.get_chassis_status())

throws error:

DEBUG:pyipmi:ASF TX: msg
DEBUG:pyipmi:ASF RX: msg
DEBUG:pyipmi:Get Channel Authentication Capabilities
DEBUG:pyipmi:IPMI TX: 20 18 c8 81 04 38 0e 04 31
DEBUG:pyipmi:IPMI RX: 81 1c 63 20 04 38 00 01 04 14 00 00 00 00 00 8b
DEBUG:pyipmi:Authentication Capabilities:
  IPMI v1.5: True
  IPMI v2.0: False
  Auth. types: md5
  Max Auth. type: 2

DEBUG:pyipmi:Get Session Challenge
DEBUG:pyipmi:IPMI TX: 20 18 c8 81 08 39 02 70 79 69 70 6d 69 74 65 73 74 00 00 00 00 00 00 e4
DEBUG:pyipmi:IPMI RX: 81 1c 63 20 08 39 cc d3
Traceback (most recent call last):
  File "C:\Users\mark\PycharmProjects\tests\tests\pyipmi-example.py", line 26, in <module>
    ipmi.session.establish()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\mark\PycharmProjects\tests\.venv-3.13\Lib\site-packages\pyipmi\session.py", line 118, in establish
    self.interface.establish_session(self)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\mark\PycharmProjects\tests\.venv-3.13\Lib\site-packages\pyipmi\interfaces\rmcp.py", line 528, in establish_session
    rsp = self._get_session_challenge(session)
  File "C:\Users\mark\PycharmProjects\tests\.venv-3.13\Lib\site-packages\pyipmi\interfaces\rmcp.py", line 482, in _get_session_challenge
    check_rsp_completion_code(rsp)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "C:\Users\mark\PycharmProjects\tests\.venv-3.13\Lib\site-packages\pyipmi\utils.py", line 72, in check_rsp_completion_code
    raise CompletionCodeError(
    ...<3 lines>...
        group_extension=rsp.group_extension)
pyipmi.errors.CompletionCodeError: CompletionCodeError cc=0xcc desc=Invalid data field in Request

settings on web: Image

with ipmitool connection success:

root@Mark-PC:~# ipmitool -I lanplus -H X -U pyipmitest -P X shell
ipmitool> bmc info
Device ID                 : 32
Device Revision           : 1
Firmware Revision         : 13.06
IPMI Version              : 2.0
Manufacturer ID           : 15370
Manufacturer Name         : GIGA-BYTE TECHNOLOGY CO., LTD
Product ID                : 4163 (0x1043)
Product Name              : Unknown (0x1043)
Device Available          : yes
Provides Device SDRs      : yes
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    IPMB Event Generator
    Chassis Device
Aux Firmware Rev Info     :
    0x09
    0x00
    0x00
    0x00
ipmitool> chassis status
System Power         : on
Power Overload       : false
Power Interlock      : inactive
Main Power Fault     : false
Power Control Fault  : false
Power Restore Policy : previous
Last Power Event     : ac-failed
Chassis Intrusion    : inactive
Front-Panel Lockout  : inactive
Drive Fault          : false
Cooling/Fan Fault    : false
Front Panel Control  : none
ipmitool> fru print
FRU Device Description : Builtin FRU Device (ID 0)
 Chassis Type          : Rack Mount Chassis
 Chassis Part Number   : 01234567
 Chassis Serial        : 01234567890123456789AB
 Board Mfg Date        : Sat Jan  1 03:10:00 2022 MSK
 Board Mfg             : Giga Computing
 Board Product         : MZ33-DC0-000
 Board Serial          : X
 Board Part Number     : 123456789AB
 Board Extra           : NULL
 Product Manufacturer  : Giga Computing
 Product Name          : R163-Z30-AAB2-000
 Product Part Number   : 000000000001
 Product Version       : 0100
 Product Serial        : X
 Product Asset Tag     : 01234567890123456789AB

FRU Device Description : FRU01 (ID 1)
 Chassis Type          : Rack Mount Chassis
 Chassis Part Number   : 01234567
 Chassis Serial        : 01234567890123456789AB
 Board Mfg Date        : Sat Jan  1 03:10:00 2022 MSK
 Board Mfg             : NULL
 Board Product         : MZ33-DC0-000
 Board Serial          : 01234567890123456789AB
 Board Part Number     : 01234567
 Board Extra           : NULL
 Product Manufacturer  : NULL
 Product Name          : R163-Z30-AAB2-000
 Product Part Number   : 000000000001
 Product Version       : 0100
 Product Serial        : 01234567890123456789AB
 Product Asset Tag     : 01234567890123456789AB

ipmitool> ^C
SIGN INT: Close Interface IPMI v2.0 RMCP+ LAN Interface
root@Mark-PC:~# ipmitool -V
ipmitool version 1.8.19
root@Mark-PC:~#

mark99i avatar Feb 18 '25 17:02 mark99i

ipmitool chassis status traffic dump seems like:

0600ff07000000000000000000092018c88100388e04b5
0600ff0700000000000000000010811c632000380001841403000000000c
0600ff07060000000000000000000a002018c88104540e008099
0600ff07060000000000000000001300811c632004540001c003014181c01103448168
0600ff0706100000000000000000200000000000a4a3a2a0000000080300000001000008040000000200000801000000
0600ff0706110000000000000000240000000400a4a3a2a09b5d7b00000000080300000001000008040000000200000801000000
0600ff07061200000000000000002600000000009b5d7b00969aabb083d3a0a11d392f815576ba241400000a707969706d6974657374
0600ff0706130000000000000000480000000400a4a3a2a02215db0d1c8a65d62c028f1b23e65cc374563c4c6913bf02ef114a725e67ab36d14b8520a5a4450a1f0aaece0cc8717bf1ac415870c0be0e1f33d3985c26998d
0600ff07061400000000000000002800000000009b5d7b007258e9f14ed430a3631c635bbcfeb462abafa67a85f0521233e37ff34a36a851
0600ff0706150000000000000000180000000400a4a3a2a0af3eb6096854e589cd665493ebec2740
0600ff0706c09b5d7b0004000000200095891494c06064f98438f4ed221db160d3c5fbd08cab3b9a0b720705d09508e6ffff02074484e4fe1c890e18b6ee3031e175cbf4
0600ff0706c0a4a3a2a00100000020000ac7e07b90362ab4e64cfc7a2d97e04777871e13f812ca9f61a3ba6ec2fa9090ffff02070e9e6bd01449d60cb7d5615783118220
0600ff0706c09b5d7b000500000020005031db56111f45b2d364b767f17b678b8e1fc3b21efbf88ef607913127497342ffff02079e297edf0fe24f8ed5ebfff1085a2aa8
0600ff0706c0a4a3a2a0020000002000ca24d82204728f0b4508c37596ad201ae521f3846be5e879a9b71c28f5266effffff02070a4eac16da22aa73d1f348405ac36810
0600ff0706c09b5d7b00060000002000a48fe308309fb4320c88bc2fc2e86851274a574994acb2a72e2084acb11be982ffff0207c16a0ddf9c989fc06903e8e93027a6e1
0600ff0706c0a4a3a2a0030000003000069d6a861659031219c6f09de9da2f2ca437e25647ca0438eb601011d1687524fafef74b65412737e88df1de5a56e3bbffff0207a62a0aa75dda2a052bed796545a16300
0600ff0706c09b5d7b0007000000200045761f1515345a441d968f136c74cdb62a2a68eb62c6bcd1b07ff4e425e0ad6dffff020786c8a8a5dd56b7b032966fa91723dd44
0600ff0706c0a4a3a2a0040000002000fda9104920749371f3e64b703c233f47af11868b353dede5ba13f63bf4edb0c1ffff02079693c9a711eb092838b1d1a45b0d9f13
0600ff0706c09b5d7b00080000002000b51926110934910adf88233885eaad7c3dcac3aeae5873062a95b82390419127ffff02070fdc04824d172273cbf63018472965bb
0600ff0706c0a4a3a2a005000000200055bfae31472739d4afdaf6ed78c836a29c0b4c52544933571d29b0d41e0e2cb2ffff0207c1968669d09c31943a3f7a8d860ea8a6
0600ff0706c09b5d7b000900000020008684deebfd133f605437e9534a5113892689aef2fa319f921a018c3f8f728722ffff02079291003473032905c5ebc2401ce53e31
0600ff0706c0a4a3a2a0060000002000a35a02812b70f17fbbeeb48d6ca97af7783fe2d5f3bc3c7e38ce874d81d41ab3ffff02075d14c24a434a4207c064f8c14affeac8
0600ff0706c09b5d7b000a0000002000516249bf7c14048706821a6c5e9c09e5ac9ac9b98b9320133e04168f976b470fffff02075f9b077ffffd5276d0f26e89cb8b39e7
0600ff0706c0a4a3a2a00700000020003b981cdcc306209ab825f51ec93aec35e60da250d4e74573df3faf8a43507056ffff02079e98c43765c96d2dacd23087109cd1c6

mark99i avatar Feb 18 '25 22:02 mark99i

Hi,

what I see is that you try to use the native RMCP interface of this lib. But with ipmitool you are using lanplus (rmcp+). This is not compatilbe.

So the lib has the following support

  • RMCP as native create_interface(interface='rmcp')
  • RMCP with ipmitool as backend create_interface(interface='ipmitool', interface_type='lan')
  • RMCP+ with ipmitool as backend create_interface(interface='ipmitool', interface_type='lanplus')

Hope that helps

hthiery avatar May 08 '25 11:05 hthiery

Hi, I did some work in supporting rmcp+. It is currently available for testing purposes in https://github.com/kontron/python-ipmi/tree/feature/rmcp%2B branch. You can give it a try and come with feedback.

hthiery avatar May 18 '25 10:05 hthiery