ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexGeneral IBM MQ Supportpymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: M

Post new topicReply to topic
pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: M View previous topic :: View next topic
Author Message
sayli.jadhav
PostPosted: Wed Jun 14, 2023 2:36 am Post subject: pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: M Reply with quote

Newbie

Joined: 13 Jun 2023
Posts: 4

below is my code to set it up Queue:
openOptions = CMQC.MQOO_SET_ALL_CONTEXT
mqod = pymqi.make_q_desc(remote_queue_name.encode('utf-8'))
put_queue = pymqi.Queue(self.mq_qmgr, mqod, openOptions)
put_queue.put(strMsg, put_mqmd, put_pmo)
put_queue.close()
it gives an error as pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: MQRC_OPTIONS_ERROR
I tried setting up
openOptions = CMQC.MQOO_OUTPUT but still no luck.

Can someone please help
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 14, 2023 4:29 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9400
Location: US: west coast, almost. Otherwise, enroute.

Which MQ call failed? Your OP says “it failed”.

Not a py guy, but options structures are added together before the MQOPEN call is issued.

All MQ calls should include _FAIL_IF_QUIESCING.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
sayli.jadhav
PostPosted: Wed Jun 14, 2023 4:51 am Post subject: Re: pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED Reply with quote

Newbie

Joined: 13 Jun 2023
Posts: 4

sayli.jadhav wrote:
below is my code to set it up Queue:
openOptions = CMQC.MQOO_SET_ALL_CONTEXT
mqod = pymqi.make_q_desc(remote_queue_name.encode('utf-8'))
put_queue = pymqi.Queue(self.mq_qmgr, mqod, openOptions)
put_queue.put(strMsg, put_mqmd, put_pmo)
put_queue.close()
it gives an error as pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: MQRC_OPTIONS_ERROR
I tried setting up
openOptions = CMQC.MQOO_OUTPUT but still no luck it gives an error

File "pymqi\__init__.py", line 1648, in put
pymqi.MQMIError: MQI Error. Comp: 2, Reason 2095: FAILED: MQRC_NOT_OPEN_FOR_SET_ALL

Can someone please help
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 14, 2023 5:48 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9400
Location: US: west coast, almost. Otherwise, enroute.

When you attempt to open a queue, you need to specify all of the options added together, something like:
openOptions = CMQC.MQOO.OUTPUT+CMQC.MQOO_SET_ALL_CONTEXT+CMQC.MQOO+FAIL_IF_QUIESCING
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 14, 2023 6:13 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9400
Location: US: west coast, almost. Otherwise, enroute.

Any compile-time errors? Post them here.

Start a py trace of app execution. Post trace output here.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jun 15, 2023 2:49 am Post subject: Re: pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1916
Location: Bay of Plenty, New Zealand

sayli.jadhav wrote:
below is my code to set it up Queue:
openOptions = CMQC.MQOO_SET_ALL_CONTEXT
mqod = pymqi.make_q_desc(remote_queue_name.encode('utf-8'))
put_queue = pymqi.Queue(self.mq_qmgr, mqod, openOptions)
put_queue.put(strMsg, put_mqmd, put_pmo)
put_queue.close()
it gives an error as pymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: MQRC_OPTIONS_ERROR

This first error is because you have not used the MQOO_OUTPUT option. Since you want to put a message to the queue, you must always first ask to open the queue for output (putting).

sayli.jadhav wrote:
I tried setting up
openOptions = CMQC.MQOO_OUTPUT but still no luck it gives an error

File "pymqi\__init__.py", line 1648, in put
pymqi.MQMIError: MQI Error. Comp: 2, Reason 2095: FAILED: MQRC_NOT_OPEN_FOR_SET_ALL

This second error is because the put was using the SET_ALL option for some reason (we can't see all your code so not exactly sure why), and you did not open the queue with the MQOO_SET_ALL_CONTEXT option.

So it sounds like you need to use both the options you have tried individually, together.

Change your openOptions line to look like this:-
Code:
openOptions = ( CMQC.MQOO_OUTPUT | CMQC.MQOO_SET_ALL_CONTEXT )

and let us know how you get on.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
sayli.jadhav
PostPosted: Sun Jun 25, 2023 10:36 pm Post subject: Reply with quote

Newbie

Joined: 13 Jun 2023
Posts: 4

Thank you it worked.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ Supportpymqi.MQMIError: MQI Error. Comp: 2, Reason 2046: FAILED: M
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.