20

I am getting this error while connecting to IBM MQ. I know that this is because of privileges, but is there any way just to check the connection with IBM MQ?

Please suggest.

T.Rob
  • 31,522
  • 9
  • 59
  • 103
Sreenath G V
  • 221
  • 1
  • 3
  • 5

9 Answers9

10

The 2035 suggests that your connection is getting to the QMgr. If you had the wrong channel name, host or port you would get back a 2059. The 2035 means that the connection made it to the listener, found a channel of the name that was requested and attempted a connection.

If you want to test past this point it will be necessary to either authorize the ID that you are using to connect or to put an authorized ID in the MCAUSER attribute of the channel.

For a detailed explanation of how the WMQ security works on client channels, see the WMQ Base Hardening presentation at http://t-rob.net/links.

T.Rob
  • 31,522
  • 9
  • 59
  • 103
  • OMG! What an awful Technote! I will contact IBM and see if I can get them to fix it. Note that the defect listed is with IBM FTM and not with MQ itself. My advice was to properly authorize the user attempting to connect. IBM's is to disable `CONNAUTH`. Since `CONNAUTH` is horribly broken that's good advice but assuming someone follows it they still need the ID that is connecting to be properly authorized at MQ. Thanks for the link! – T.Rob Dec 29 '17 at 04:27
5

If you enable authorization messages then the 2035 will show up in the event queue. Then you can look at the message and see what ID was used to connect and what options were used too. The 2035 might be because you asked for set authority on the queue manager or something else you aren't supposed to have. The authorization messages wil show you that.

T.Rob
  • 31,522
  • 9
  • 59
  • 103
mqrus
  • 325
  • 2
  • 10
2

You can also resolve this By setting mcauser('mqm') .. i was able to overcome 2035 error.

Define channel (channel1) chltype (svrconn) trptype (tcp) mcauser(‘mqm’)

Esp thanx to my SENIOR Bilal Ahmad (PSE)

Digital Alchemist
  • 2,324
  • 1
  • 15
  • 17
  • The suggestion in this answer not a good one to use. You would be giving the application full MQ administrative permission by setting `MCAUSER('mqm')`. Also note that on MQ v7.1 and later by default CHLAUTH rules will block this connection from working anyway. – JoshMc Aug 23 '17 at 07:32
0

You can use dspmqaut to check the grant. Below is the sample to give user poc access to Queue Manager QM1 and Queue LQ1

 # check the access right of user POC to QM1
 dspmqaut -m QM1 -n LQ1 -t q -p poc

 # if you want to give access, you should use 
 setmqaut -m QM1 -n LQ1 -t q -p poc <access Types>
 # eg (put everything - in the real live scenario, choose only what you want to grant) :
 setmqaut -m QM1 -n LQ1 -t q -p poc +put +get +browse +inq +set +crt +dlt +chg +dsp +passid +setid +setall +clr 

Then dont forget to restart QM1 with

  endmqm -i QM1
  strmqm QM1

Finally, you should be able to proceed without error 2035.

Rudy
  • 7,008
  • 12
  • 50
  • 85
  • 1
    A restart of the queue manager is not required after adding new OAM rules. – JoshMc Aug 23 '17 at 07:27
  • Unless you are using MQ on Windows or MQv8 or later with `SecurityPolicy=user` on Unix/Linux, granting permission with the `-p` flag is not recommended. This is because on Unix/Linux prior to v8 and by default in v8 and later the resulting OAM rule is actually granted to the primary group of the user specified not to the user itself. Many situations make this bad for example if by default a large number of users have the same primary group (ex: group `users`). – JoshMc Aug 23 '17 at 07:29
0

You have to check the privileges with an MQ administrator.

DaeMoohn
  • 1,087
  • 13
  • 27
0

I have been struggling with this for ages too. Eventually I found this solution. (If you can call turning off authentication a solution.)

I am using version - IBM Websphere 9.1.0.201807091223

From IBM's website they advise turning connection authentication off!!!

Resolving the problem Disable channel authentication

You will need to disable connection authentication, at least temporarily. There are known issues in FTM for Check with regard to using MQ connection authorization. These problems are actively being addressed and fixes will appear in a future fix pack. The target is fixpack 3.0.0.8.

Steps to disable connection authentication: Open MQ command console and type runmqsc ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(NONE) CHCKLOCL(NONE) Restart the queue manager for this change to take effect.

Source http://www-01.ibm.com/support/docview.wss?uid=swg21962081

Matt
  • 3,664
  • 3
  • 33
  • 39
0

On this topic if you are using MQSeries 9.1 in a test or development environment you can disable channel authentication with the following approach : . Launch MQ command line utility with the following : runmqsc (for example runmqsc QM1) . Disable authentication for all channels with the following command ALTER QMGR CHLAUTH (DISABLED)

EmmanuelM
  • 337
  • 1
  • 6
-1

For a Q/Q-manager running on Windows, you may have to create the user on the Q/Q-manager machine [i.e. create a user on the Q-machine to match the user on the Q-client machine], and then add that user to the 'mqm' group on that machine.

Steps:

  1. Ensure that the domain user that is being used to create the Q CLIENT [i.e. the user that the Q-client app is running under] also exists on the box with the Q/Q-manager. You may be able to just create a local user on the Q/Q-manager box [, or you may have to do some more complicated creation of an Active Directory user - I can't help you there].

  2. On the Q/Q-manager box, add the user you have just created [or the existing one, if it already exists] to the mqm group. [On a Windows server box you will need to use the Microsoft Management Console (1. 'mmc' from the command line, 2. File > Add/Remove SnapOn > Local Users & Groups, 3. add user to group)]. The 'mqm' group should already exist on the Q/Q-manager machine.

david.barkhuizen
  • 5,239
  • 4
  • 36
  • 38
  • By adding the user to the mqm group you are giving that user full MQ administrative authority which is not recommended, the application should be granted the least permission require to perform its function. Also note that on MQ v7.1 and later by default CHLAUTH rules will block connections from working that resolve to MQ Admin users. – JoshMc Aug 23 '17 at 07:34
  • @JoshMc What is the recommended resolution, then ? – david.barkhuizen Aug 23 '17 at 08:53
  • On windows you can grant the authority directly to the user. On unix prior to v8 you would could add the user to a group other than mqm and grant the authority to that group. On v8 and later on unix you can set `SecurityPolicy=user` in the qm.ini and grant the authority directly to the user. – JoshMc Aug 23 '17 at 09:05
-1

Error MQRC 2035 basically means that your application has been able to connect to the queue manager, however due to certain absence of permissions/authorizations, it was unable to put/get/publish/subscribe messages.

To resolve this, at first, try these steps in order to disable the authorizations from queue manager and channel. Use this only if it isn't a production queue manager.

  1. Always check the queue manager logs. It tells you exactly where you need to look into, and resolve the issue.

  2. In this case, generally, you can issue the following commands after doing a runmqsc on the queue manager :

    ALTER QMGR CHLAUTH(DISABLED)
    

Then set the chckclnt object(under authinfo) to optional

  1. DISPLAY QMGR CONNAUTH
    DISPLAY AUTHINFO(name-from-above) ALL  //name from the first commands
    
    ALTER AUTHINFO(name-from-above) AUTHTYPE(IDPWOS) ADOPTCTX(YES)
    
    ALTER AUTHINFO(name-from-above) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)
    
    REFRESH SECURITY TYPE(CONNAUTH)
    
  2. SET CHLAUTH('*') TYPE(BLOCKUSER) ACTION(REMOVEALL)

    This helps remove any blocks that the channel is creating against any user.

     SET CHLAUTH(your channel name) TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL)
    

This should resolve your issue, since we have disabled every authorization that an application has to pass in order to do anything on a queue manager.

Now, in case you are using a production queue manager, NEVER remove authorizations. Go, and right click on any QM that you have configured in your MQ explorer. Go to the QM authority, and authority records. Click on create new user, and give the same name as the username your application is using. Select all the checkboxes, then copy from the space below all the commands that are given. Namely, setmqaut. Edit with your queue manager name, and issue them!

----Never give up, the answer is where you have not looked yet--------

RBT
  • 24,161
  • 21
  • 159
  • 240
Saugato
  • 1
  • 2