# MQRC 2058: Queue manager name not valid

Source: https://wndsoftware.com/mainframe-errors/mqrc-2058

### MQRC 2058: Queue manager name not valid

MQRC 2058 (MQRC_Q_MGR_NAME_ERROR, hex 080A) means the queue manager name passed on MQCONN or MQCONNX isn't valid or isn't known where the application is connecting. It is a naming problem, unlike 2059, where the name is known but the queue manager isn't available.


#### Other names for this code

Also written as `RC2058`, `reason code 2058`, `MQ 2058`, `MQ error 2058`, `MQRC_Q_MGR_NAME_ERROR`, `080A`, `0x080A`, `queue manager name error`, `JMSWMQ0018 2058`, `MQJE001 Reason 2058`.


### What it means

When an application connects, it names the queue manager it wants, or passes a blank name for the default. The queue manager, the client or the z/OS adapter checks that name before connecting. If the name doesn't match anything it can reach, the call returns 2058.

On distributed MQ in bindings mode, there is no queue manager by that name on the machine, or there is no default queue manager when the name is blank. Names are case-sensitive, so qm1 and QM1 are different queue managers. For a client, the name must match the queue manager the channel actually reaches. If the client asks for QM1 and the host and port lead to QM2, the connect fails with 2058. With a client channel definition table (CCDT), no entry has a matching QMNAME, or the name refers to a queue manager group that doesn't exist.

On z/OS the checks are made by the adapters. A batch connect to a name that isn't a defined MQ subsystem or queue sharing group gets 2058. The IMS adapter returns it when the CSQQDEFV table doesn't contain the name, or when the wrong CSQQDEFV module is loaded. The CICS adapter returns it when group resync is requested with a queue manager name instead of a queue sharing group name. It can also come back when one address space tries to connect through a different adapter type than its existing MQ connection, such as a batch-adapter MQCONN from inside a CICS region.


### Common causes

- A typo or wrong case in the queue manager name in the program, its properties file or its connection factory.
- A client connects with a name that doesn't match the queue manager behind the host, port and channel it uses.
- A CCDT has no channel entry whose QMNAME matches the requested name, or the application asks for a queue manager group (a name starting with an asterisk) that isn't defined.
- A blank name is used where no default queue manager is set.
- On z/OS IMS, CSQQDEFV doesn't list the name, has no default entry for a blank name, or another copy of CSQQDEFV is found first because the library sits after SCSQAUTH in STEPLIB or JOBLIB.
- On z/OS CICS, the MQCONN resource uses RESYNCMEMBER(GROUPRESYNC) and MQNAME holds a queue manager name instead of the queue sharing group name.


### How to find the problem

- Compare the exact name the application uses, case included, with `dspmq` output on the server.
- For a client, connect with runmqsc or a sample program using the same host, port and channel, and check which queue manager answers with `DISPLAY QMGR QMNAME`.
- For a CCDT, list its entries. On MQ 9.1.2 and later a JSON CCDT is a text file you can read, and a binary CCDT can be displayed with `runmqsc -n`. Check the QMNAME on each client channel.
- On z/OS IMS, check the CSQQDEFV module and the STEPLIB or JOBLIB concatenation order of the dependent region.
- On z/OS CICS, check the MQCONN resource with `CEMT INQUIRE MQCONN` and its MQNAME and RESYNCMEMBER values.


### How to fix it

- Correct the queue manager name in the application or its configuration, matching case exactly.
- For clients, either pass the real name of the target queue manager or pass a blank name so the client accepts whichever queue manager the channel reaches.
- Add or fix the CCDT entries so that QMNAME matches what the application asks for.
- On z/OS IMS, rebuild CSQQDEFV with the right entries and place its library ahead of SCSQAUTH. On CICS with group resync, put the queue sharing group name in MQNAME.


### What it looks like


```text
JMSWMQ0018: Failed to connect to queue manager 'QM1' with connection mode 'Client' and host name 'mqhost01(1414)'.
JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2058' ('MQRC_Q_MGR_NAME_ERROR').
```


### IBM documentation

[IBM documentation: MQRC 2058](https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=acrc-2058-080a-rc2058-mqrc-q-mgr-name-error). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.

Last reviewed 2026-10-18 by the WND Software team. Written in our own words. For the full reference, check IBM’s MQ documentation for your version.


### Related codes

[MQRC 2059 MQRC_Q_MGR_NOT_AVAILABLE Read →](https://wndsoftware.com/mainframe-errors/mqrc-2059)
[MQRC 2540 MQRC_UNKNOWN_CHANNEL_NAME Read →](https://wndsoftware.com/mainframe-errors/mqrc-2540)
[MQRC 2538 MQRC_HOST_NOT_AVAILABLE Read →](https://wndsoftware.com/mainframe-errors/mqrc-2538)
[MQRC 2035 MQRC_NOT_AUTHORIZED Read →](https://wndsoftware.com/mainframe-errors/mqrc-2035)
[MQRC 2018 MQRC_HCONN_ERROR Read →](https://wndsoftware.com/mainframe-errors/mqrc-2018)

### Questions


#### What is the difference between 2058 and 2059?

2058 means the name isn't valid or doesn't match. 2059 means the name was understood but the queue manager can't be reached or isn't running. Fix the name for 2058, and the queue manager or network for 2059.


#### Why does my client get 2058 when the host and port are right?

The queue manager listening on that port has a different name from the one in the application. Use the real name, or a blank name if you don't need to check it.


#### Are MQ queue manager names case-sensitive?

Yes. QM1 and qm1 are different names, and a connect that uses the wrong case fails with 2058.

[IBM MQ reason codes](https://wndsoftware.com/mainframe-errors/mq-reason-codes) · [MQRC 2057](https://wndsoftware.com/mainframe-errors/mqrc-2057) · [MQRC 2059](https://wndsoftware.com/mainframe-errors/mqrc-2059)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
