MQRC 2038: Handle not open for inquiry
MQRC 2038 means MQINQ used a handle without inquiry capability. Check MQOO_
Other names for this code
Also written as RC2038, reason code 2038, MQ error 2038, MQRC_NOT_OPEN_FOR_INQUIRE, 07F6, 0x07F6.
What it means
MQINQ reads object attributes through an existing handle. That handle must have been opened with MQOO_
IBM additionally documents MQINQ restrictions for Multicast topic handles. Avoid assuming that all handles expose the same administrative information.
A troubleshooting example
A sender puts an invoice successfully, then queries queue depth for a status display. The inquiry returns 2038 and the wrapper reports the whole send as failed. A caller retries and can duplicate the invoice. Correct both problems: provide the required inquiry capability where appropriate, and report the put outcome independently from a diagnostic attribute read. A test should deliberately fail the inquiry after a successful put and verify that the sender does not resubmit the business message.
Common causes
- A producer queries queue attributes using its output-only handle.
- A generic library adds an attribute check without updating object-open requirements.
- The application attempts MQINQ through an unsupported Multicast topic handle.
How to find the problem
- Record the attribute query, object type and Hobj from the failing MQINQ. Then locate the corresponding open.
- Compare actual open options with the library's documented prerequisites. Check whether one caller configures inquiry and another does not.
- Determine why the application needs the attribute. Some diagnostic paths can be separated from the critical message flow.
- For topic or Multicast use, confirm support in the installed release before adding an open option that cannot make the call valid.
How to fix it
- Include MQOO_
INQUIRE when opening an object that supports the required inquiry. Reopen safely if the existing handle must change. - Document inquiry capability in the wrapper's contract. Avoid hidden attribute reads that unexpectedly change the permissions or modes required by a producer.
- Test startup and steady-state behavior with inquiry enabled. Confirm an inquiry failure does not trigger an unsafe retry of a message operation that already succeeded.
What it looks like
Illustrative diagnostic notes; not an IBM message template. MQPUT: succeeds MQINQ through output-only handle: Reason=2038 Do not report the successful put as a failed send.
IBM documentation
IBM MQ 9.4: 2038 MQRC_NOT_OPEN_FOR_INQUIRE. Use the documentation for your installed release.
Related codes
Questions
Can a successful producer still receive 2038?
Yes. Output and inquiry are separate handle capabilities. The later diagnostic call can fail independently.
Will MQOO_INQUIRE make any topic handle work?
No. Check object and messaging-model support. IBM documents that MQINQ is not supported for Multicast topic handles.