1

I am getting the below error while connecting to IBM MQ using library pymqi.

Its a clustered MQ channel

    Traceback (most recent call last):
      File "postToQueue.py", line 432, in <module>
        qmgr = pymqi.connect(queue_manager, channel, conn_info)
      File "C:\Python\lib\site-packages\pymqi\__init__.py", line 2608, in connect
        qmgr.connect_tcp_client(queue_manager or '', CD(), channel, conn_info, user, password)
      File "C:\Python\lib\site-packages\pymqi\__init__.py", line 1441, in connect_tcp_client
        self.connect_with_options(name, cd, user=user, password=password)
      File "C:\Python\lib\site-packages\pymqi\__init__.py", line 1423, in connect_with_options
        raise MQMIError(rv[1], rv[2])
    pymqi.MQMIError: MQI Error. Comp: 2, Reason 2012: FAILED: MQRC_ENVIRONMENT_ERROR'

Please see my code below.

queue_manager = 'quename here' 
channel = 'channel name here' 
host ='host-name here'
port = '2333'
queue_name = 'queue name here'
message = 'my message here'
conn_info = '%s(%s)' % (host, port)
print(conn_info)
qmgr = pymqi.connect(queue_manager, channel, conn_info)
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
print("message sent")
queue.close()
qmgr.disconnect()

Getting error at the line below

qmgr = pymqi.connect(queue_manager, channel, conn_info)

Added the IBM client to scripts folder as well , using Windows 10 , Python 3.8.1 and IBM Client 9.1 windows client installation image, Below is the header

-----------------------------------------------------------------------------+
|                                                                             |
| WebSphere MQ First Failure Symptom Report                                   |
| =========================================                                   |
|                                                                             |
| Date/Time         :- Tue January 28 2020 16:27:51 Eastern Standard Time     |
| UTC Time          :- 1580246871.853000                                      |
| UTC Time Offset   :- -300 (Eastern Standard Time)                           |
| Host Name         :- CA-LDLD0SQ2                                            |
| Operating System  :- Windows 10 Enterprise x64 Edition, Build 17763         |
| PIDS              :- 5724H7251                                              |
| LVLS              :- 8.0.0.11                                               |
| Product Long Name :- IBM MQ for Windows (x64 platform)                      |
| Vendor            :- IBM                                                    |
| O/S Registered    :- 0                                                      |
| Data Path         :- C:\Python\Scripts\IBM                                  |
| Installation Path :- C:\Python                                              |
| Installation Name :- MQNI08000011     (126)                                 |
| License Type      :- Unknown                                                |
| Probe Id          :- XC207013                                               |
| Application Name  :- MQM                                                    |
| Component         :- xxxInitialize                                          |
| SCCS Info         :- F:\build\slot1\p800_P\src\lib\cs\amqxeida.c,           |
| Line Number       :- 5085                                                   |
| Build Date        :- Dec 12 2018                                            |
| Build Level       :- p800-011-181212.1                                      |
| Build Type        :- IKAP - (Production)                                    |
| UserID            :- alekhya.machiraju                                      |
| Process Name      :- C:\Python\python.exe                                   |
| Arguments         :-                                                        |
| Addressing mode   :- 32-bit                                                 |
| Process           :- 00010908                                               |
| Thread            :- 00000001                                               |
| Session           :- 00000001                                               |
| UserApp           :- TRUE                                                   |
| Last HQC          :- 0.0.0-0                                                |
| Last HSHMEMB      :- 0.0.0-0                                                |
| Last ObjectName   :-                                                        |
| Major Errorcode   :- xecF_E_UNEXPECTED_SYSTEM_RC                            |
| Minor Errorcode   :- OK                                                     |
| Probe Type        :- INCORROUT                                              |
| Probe Severity    :- 2                                                      |
| Probe Description :- AMQ6090: MQM could not display the text for error      |
|   536895781.                                                                |
| FDCSequenceNumber :- 0                                                      |
| Comment1          :- WinNT error 1082155270 from Open ccsid.tbl.            |
|                                                                             |
+-----------------------------------------------------------------------------+
JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • Check for a log file called `AMQERR01.LOG` under the location pointed to by either `%MQ_DATA_PATH%` or `%MQ_FILE_PATH` and see if it provided any further error, if it does then ***EDIT*** your question and add it to the question. You said "Its a clustered MQ channel", when you connect from a client application you need to connect to a channel of type SVRCONN (Server Connection) not a clustered channel, not sure if you used that term to reference the type of channel such as `Cluster Sender` or `Cluster Receiver. – JoshMc Jan 28 '20 at 22:34
  • Based on the simple connection you are trying to make which has no security you can use one of the built in IBM MQ sample programs to attempt to connect to the MQ queue manager to eliminate pymqi from the troubleshooting. You will find a program called `amqscnxc` under the install Tools directory, based on the values you provided in your pymqi program above you would call it like this `amqscnxc -x host(port) -c "channel name here"`. Try this out and report back the results. – JoshMc Jan 28 '20 at 22:37
  • AMQERR01.log is empty , How ever there is a AMQ1***.FDC file is gettng created for every run from PyMQI. and please ignore the statement Clustured MQ channel. – machiraju alekhya Jan 29 '20 at 00:45
  • And , We are using IBM MQ manager and we need to connect to a remote Queue Manager ... Connection type is Client and channel name is "****.SVR.CONN" – machiraju alekhya Jan 29 '20 at 00:49
  • 'amqscnxc' is not recognized as an internal or external command, operable program or batch file ------------ Where should i enter this command for verification – machiraju alekhya Jan 29 '20 at 01:27
  • Search under the client install directory under tools directory. Please ***EDIT*** the question and add the header from the FDC file. – JoshMc Jan 29 '20 at 03:14
  • Try to copy ccsid_part2.tbl to ccsid.tbl file – Seyf Jan 29 '20 at 04:19
  • Your code looks ok. As you are currently trying to determine the source of the issue, you should take the server you are connecting to out of your test. I suggest creating a lite version of MQ server in the cloud or setting up a docker image from ibmcom/mq:latest. That way if you can reproduce the error, you know its how you are using pymqi and the MQ Client. If you can't then it's down to your server side configuration. – chughts Jan 29 '20 at 09:26
  • hi joshMc , Edited the question with FDC Header – machiraju alekhya Jan 29 '20 at 14:53
  • Hi SeyFSv , Can u please elaborate .. should i need to copy and append in the new file or should i replace the whoole file – machiraju alekhya Jan 29 '20 at 14:58
  • Please try running the `setmqenv` command from the redist bin folder and see if this resolves the error. – JoshMc Jan 29 '20 at 15:01
  • @machirajualekhya, lets clarify: FFDC shows `WinNT error 1082155270 from Open ccsid.tbl`, I think there is issue with opening this file. And I guess, that it does not exists, and it should be created by copying from ccsid_part2.tbl. We hade similar issue and it was resolved by copying file. Also I see this issue https://github.com/ibm-messaging/mq-golang/issues/124 – Seyf Jan 30 '20 at 07:05
  • setmqenv should fix this by setting variables the MQ libraries use to find things. The the git link the user had only copied two libraries which is not a supported config. Does running setmqenv fix the issue without the need to copy files? – JoshMc Jan 30 '20 at 17:04
  • I tried setmqenv -s but the issue still exists – machiraju alekhya Jan 31 '20 at 01:07
  • Below is the error log 1/30/2020 20:18:13 - Process(10652.1) User(alekhya.machiraju) Program(python.exe) Host(CA-LDLD0SQ2) Installation(MQNI08000011) VRMF(8.0.0.11) AMQ6090: MQM could not display the text for error 268460419. – machiraju alekhya Jan 31 '20 at 01:19

0 Answers0