Search code examples
pymqi

Unpack for type ((67108864,)) not implemented


I'm trying to query an MQ server running on IBM i from a python script on a linux box. I'm getting this error back from pymqi and I don't know what it means.

The stacktrace is as follows:

    [{"message": "Unpack for type ((67108864,)) not implemented", "traceback": 
"Traceback (most recent call last):\n  
    response = pcf.MQCMD_INQUIRE_CHANNEL(args)  
    File \"../python3.8/site-packages/pymqi/__init__.py\", 
    line 2770, in __call__\n    
    res, mqcfh_response = self.__pcf.unpack(message)  

This is the snippet of code that generates the error

    cd = pymqi.CD()
    cd.ChannelName = pymqi.ensure_bytes(channel)
    cd.ConnectionName = pymqi.ensure_bytes("{}({})".format(host, port))
    cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN
    cd.TransportType = pymqi.CMQC.MQXPT_TCP
    cd.Version = 9
    
    queue_manager = pymqi.QueueManager(None)
    queue_manager.connect_with_options(queue_manager_name, cd)
    args = {pymqi.CMQCFC.MQCACH_CHANNEL_NAME: pymqi.ensure_bytes('*')}
    pcf = pymqi.PCFExecute(queue_manager, response_wait_interval=5, convert=False)
    response = pcf.MQCMD_INQUIRE_CHANNEL(args)

What is type 67108864? I know there are limitations with this library and connecting to a z/OS, are there similar limitations with IBM i?


Solution

  • Turns out IBM i along with AIX have a different endinaness so one must pass convert=True to the pymqi.PCFExecute commands

    queue_manager = pymqi.QueueManager(None)
    queue_manager.connect_with_options(queue_manager_name, cd)
    args = {pymqi.CMQCFC.MQCACH_CHANNEL_NAME: pymqi.ensure_bytes('*')}
    pcf = pymqi.PCFExecute(queue_manager, response_wait_interval=5, convert=True)
    response = pcf.MQCMD_INQUIRE_CHANNEL(args)