IBM Support

IBM MQ - amqiclen failures encountered during the MQ upgrade

White Papers


Abstract

+++ Objective

The purpose of this technical document is to explain the work around steps to perform when an issue reported with amqiclen during fix pack installation.

Note:
The steps explained below is a work around and please do not run amqiclen or ipcrm in any other conditions. Refer the link for more information:
https://www.ibm.com/support/pages/why-should-i-not-run-ipcrm-nor-amqiclen

The objective of this document is to capture the amqiclen error and information messages, return codes and other data that are seen during the MQ upgrade. amqiclen has been called to clean up any MQ IPC resources (shared memory sets and semaphores) prior to the installation.
The amqiclen program has successfully gotten rid of shared memory resources and is examining semaphores when things go wrong. Specifically, amqiclen is trying to acquire a semaphore it must hold to keep other queue managers from starting up while it deletes their semaphore.


The Fix Pack install relies on the amqiclen utility to ensure MQ is not running. The Fix Pack install script and interim fixes also relies on amqiclen to return true in order to continue.

The amqiclen utility has a peculiar way of checking queue managers and failing which it reports "an MQ queue manager still running" error. The amqiclen program may fail under circumstances where it finds directory structure of one of the queue managers not intact. Installation runs amqiclen to ensure that all old queue manager IPC resources are removed.
Installation will fail with the claim that "qmgrs are still running" if "amqiclen -x" fails.
The command "amqiclen -x" can fail if it fails to find expected IPC directories under each of the entries in /var/mqm/qmgrs.

An APAR - IT30754 (( https://www.ibm.com/support/pages/apar/IT30754 ) is already in place to print the correct error of the root cause of the issue encountered during the upgrade.

Content

There are few scenarios related with amqiclen errors  explained in the document.
Scope:
The scope of this document is to familiarise with different amqiclen errors encountered during the upgrade.
How to best use this document:
Search the error number or trace details, and you will be taken to one of the tables at the beginning of the document.
Refer to the specific scenarios, which are described in more details later on in the document.
We request you to please refer to the link for applying maintenance level updates on Linux on upgrade of MQ.
IBM MQ / 9.2
Applying maintenance level updates on Linux using RPM

Please check the below steps before upgrade
    Stop all MQ processes and MQ applications
    Ensure no MQ IPC resources exist
+++ Scenarios

++ Scenario 1:
          error: %pre(MQSeriesClient-U9109-9.1.0-9.x86_64) scriptlet failed, exit status 1
          error: MQSeriesClient-U9109-9.1.0-9.x86_64: install failed
          ERROR:   amqiclen failed with rc=2.
          Failed to obtain global lock(1): rc=545261555
From the trace details the error found is         }! amqiclen_main rc=lrcE_NOT_AUTHORIZED
Please check on the amqiclen file permission
         Actual file permission:    -r-xr-x---. 1 mqm mqm 32504 Apr 12 2021 amqiclen
          Expected file permission:  -r-sr-s--- 1 mqm mqm 27688 Jul 9 2020 amqiclen               

Resolution:
Change the file permission and try the upgrade.

++ Scenario 2 (RDQM):
          Failed to obtain global lock(1): rc=545261555
          ERROR:   amqiclen failed with rc=2.
          error: %pre(MQSeriesRuntime-U9202-9.2.0-2.x86_64) scriptlet failed, exit status 1
          error: MQSeriesRuntime-U9202-9.2.0-2.x86_64: install failed
Resolution:
 The file system on which the MQ binaries are installed is mounted with the  'nosuid' option.   This means that, while the MQ binaries have the setuid/setgid bits (e.g. mode "-r-sr-s---" with owner"mqm" and group "mqm" on /opt/mqm/bin/amqiclen), the operating system is ignoring those bits and running. The MQ executable as the invoking user (e.g. root) rather than as mqm:mqm. Remount the /opt/mqm file system without the 'nosuid' option and test the fix pack installation.
++ Scenario 3:
On uninstalling the MQ: rpm -qa | grep MQSeries | xargs rpm -ev
Preparing packages...

ERROR: MQ shared resources associated with the installation at
      '/opt/mqm' are still in use.
       You must stop all MQ processing, including applications, Queue Managers
       and Listeners before attempting to install, update or delete
       the MQ product.

       'amqiclen -v -x' return code was: '1', output was:
IPCC subpool for QMgr 'QREPTGT' is active
APP subpool for QMgr 'QREPTGT' is active
QMPERSIST subpool for QMgr 'QREPTGT' is active
QMGR subpool for QMgr 'QREPTGT' is active

Resolution :
1. mv /opt/IBM/wmq9/bin/amqiclen /opt/IBM/wmq9/bin/amqiclen.bak
2. Create a symbolic link:
       ln -s /bin/true /opt/IBM/wmq9/bin/amqiclen
3. Retry the fixpack install command.
Run "rpm -ivh" to the MQ Runtime first (use full proper name of rpm, the * is a just place holder for illustration purposes)

   rpm -ivh MQSeriesRuntime-*.rpm
   This is the package that is the owner of the amqiclen utility.

4.a: If step 4 is successful, then very likely the symbolic link done in 3 is gone. Check for it:
       ls -l /opt/mqm/bin/amqiclen and delete amqiclen.bak.

4.b:If fails then remove symlink and put the old amqiclen back. And please send in the RPM output, the output of "/opt/mqm/bin/amqiclen -v -x", and also the zip file generated by the "runmqras -section defs" command to raise a case with IBM MQ Support. In addition, please send the following details as well.
a) Send us the installation logs.
b) Send us the output of:
     ps -ef | grep -i mq > /tmp/ps-ef.out
     ipcs -a             > /tmp/ipcs-a.out
5. Check the status of the applied fixpack:
     rpm -qa | grep MQ | sort
6. Check the version:
     dspmqver

 
++ Scenario 4:
Failed to obtain global lock(1): rc=1077960969
ERROR:   amqiclen failed with rc=2.
error: %pre(MQSeriesRuntime-U9204-9.2.0-4.x86_64) scriptlet failed, exit status 1

Resolution:
Please follow the steps mentioned in Scenario 3.
++ Scenario 5:
Preparing... ########################################
ERROR: amqiclen failed with rc=243.
error: %pre(MQSeriesRuntime-U91010-9.1.0-10.x86_64) scriptlet failed, exit status 1
error: MQSeriesRuntime-U91010-9.1.0-10.x86_64: install failed
ERROR: amqiclen failed with rc=243.

Resolution:
Please follow the steps mentioned in scenario 3.

If the error has not been under any of the above scenario and if the issue not resolved by the work around provided then please get the trace by the following steps for analysis.

1. Start the trace:
  strmqtrc -e -t all -t detail
2. As the user who would be doing the upgrade (probably root), run:
  /opt/mqm/bin/amqiclen -x -v > /var/mqm/errors/amqiclen.txt 2>&1
3. endmqtrc -a
4. cd /var/mqm/trace
  dspmqtrc *.TRC
5. runmqras -section defs,trace -caseno Case_Number
6. Send the zip file output of the above runmqras command
+++ end

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m0z00000008MGAAY","label":"Install"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
01 June 2022

UID

ibm16591157