Skip to content

Support for MQRC_ENVIRONMENT_ERROR [2012] #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
splift83 opened this issue Apr 30, 2025 · 3 comments
Open

Support for MQRC_ENVIRONMENT_ERROR [2012] #395

splift83 opened this issue Apr 30, 2025 · 3 comments

Comments

@splift83
Copy link

Hello,
I am trying to connect to a Queue Manager Ibm Mq but I am encountering the following errors:

2025-04-30 19:32:49 time="2025-04-30T17:32:49Z" level=debug msg="HTTP server - waiting until MQ connection ready"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="< [initConnectionKey] rp: 1 Error: : MQCC = MQCC_WARNING [1] MQRC = MQRC_ENVIRONMENT_ERROR [2012]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=info msg="Connected to queue manager QM1"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=error msg=" : : MQCC = MQCC_WARNING [1] MQRC = MQRC_ENVIRONMENT_ERROR [2012]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [DiscoverAndSubscribe]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [discoverAndSubscribe]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [discoverStats]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [discoverClasses]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [subscribeWithOptions]"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="< [subscribeWithOptions] rp: 0 Error: nil"
2025-04-30 19:32:50 time="2025-04-30T17:32:50Z" level=trace msg="> [getMessageWithHObj]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [getMessageWithHObj] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [parsePCFResponse]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [parsePCFResponse] rp: 1"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [discoverClasses] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [unsubscribe]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="Removing subscription for &{hObj:{hObj:102 qMgr:0xc000161888 Name:[$SYS/MQ/INFO/QMGR//Monitor/METADATA/CLASSES]} topic:$SYS/MQ/INFO/QMGR//Monitor/METADATA/CLASSES durable:false managed:true} "
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [unsubscribe] rp: 0 Error: nil"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [discoverStats] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=debug msg="Setting connection to grab qdepth via Publication"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [discoverAndSubscribe] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [DiscoverAndSubscribe] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [RediscoverAttributes]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [inquireChannelAttributes]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [statusClearReplyQ]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="> [EndConnection]"
2025-04-30 19:33:20 time="2025-04-30T17:33:20Z" level=trace msg="< [EndConnection] rp: 0"
2025-04-30 19:33:20 panic: runtime error: invalid memory address or nil pointer dereference
2025-04-30 19:33:20 [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x52fc59]
2025-04-30 19:33:20 
2025-04-30 19:33:20 goroutine 1 [running]:
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.getInternal.func1(...)
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:865
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.getInternal({0x0, 0x0, {0x0, 0x0}}, 0xc0000fc160, 0xc000296090, {0x1021120, 0x0, 0x0}, 0x0)
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:870 +0x419
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.Get({0x1?, 0x0?, {0x0?, 0x12?}}, 0xc0000fc160, 0xc000296090, {0x1021120, 0x0, 0x0})
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:773 +0xcd
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/mqmetric.clearQ({0x9988b2?, 0x0?, {0x0?, 0xc000031b08?}})
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/status.go:161 +0x99
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/mqmetric.statusClearReplyQ()
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/status.go:174 +0x9f
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/mqmetric.inquireChannelAttributes({0xc000109350, 0xc}, 0xc0000c9140)
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/channel.go:591 +0xad
2025-04-30 19:33:20 github.com/ibm-messaging/mq-golang/v5/mqmetric.RediscoverAttributes(0x6, {0xc000109350, 0xc})
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:284 +0x135
2025-04-30 19:33:20 main.main()
2025-04-30 19:33:20     /go/src/github.com/ibm-messaging/mq-metric-samples/main.go:142 +0x76a

The messages are present on the queue.
Could you please support me?

Thank you.

@ibmmqmet
Copy link
Collaborator

ibmmqmet commented May 1, 2025

Looking through the code, the only failure path I can see that might get you there is if an MQINQ on the qmgr object failed. Which would be unusual, but it is possible. I'll at least fix that path to give a proper error message anyway.

Is there anything in the qmgr error logs, such as missing permissions? Or are you running a very old version of MQ or on an unusual platform?

Otherwise, setting the environment variable MQIGO_TRACE=true will generate some lower-level trace info that might help.

@splift83
Copy link
Author

splift83 commented May 2, 2025

Hi,
Thank you very much for your support.
As indicated, I have added the configuration (MQIGO_TRACE=true) for the requested logs. Please find the updated log below:

2025-05-02 11:53:17 time="2025-05-02T09:53:17Z" level=debug msg="Connecting to queue manager QM1"
2025-05-02 11:53:17 [ibmmq] 2025-05-02T09:53:17.927 : > [Connx]
2025-05-02 11:53:17 [ibmmq] 2025-05-02T09:53:17.927 : QMgrName: QM1
2025-05-02 11:53:17 time="2025-05-02T09:53:17Z" level=debug msg="HTTP server - waiting until MQ connection ready"
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.123 : < [Connx] rp: 0 Error: nil
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.123 : > [Open]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.123 : Object:  
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.161 : < [Open] rp: 0 Error: nil
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.161 : > [Inq]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.200 : < [Inq] rp: 1 Error: MQINQ: MQCC = MQCC_FAILED [2] MQRC = MQRC_SELECTOR_ERROR [2067]
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="< [initConnectionKey] rp: 1 Error: : MQCC = MQCC_WARNING [1] MQRC = MQRC_ENVIRONMENT_ERROR [2012]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=info msg="Connected to queue manager QM1"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=error msg=" : : MQCC = MQCC_WARNING [1] MQRC = MQRC_ENVIRONMENT_ERROR [2012]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [DiscoverAndSubscribe]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [discoverAndSubscribe]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [discoverStats]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [discoverClasses]"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [subscribeWithOptions]"
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.200 : > [Sub]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.200 : Object: [$SYS/MQ/INFO/QMGR//Monitor/METADATA/CLASSES]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.246 : < [Sub] rp: 0 Error: nil
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="< [subscribeWithOptions] rp: 0 Error: nil"
2025-05-02 11:53:18 time="2025-05-02T09:53:18Z" level=trace msg="> [getMessageWithHObj]"
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.246 : > [Get]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.246 : > [getInternal]
2025-05-02 11:53:18 [ibmmq] 2025-05-02T09:53:18.246 : BufferLength: 32768
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.287 : Returned datalen: 0
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.287 : < [getInternal] rp: 3 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.287 : < [Get] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.287 : > [Cmit]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.326 : < [Cmit] rp: 0 Error: nil
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [getMessageWithHObj] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [parsePCFResponse]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [parsePCFResponse] rp: 1"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [discoverClasses] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [unsubscribe]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="Removing subscription for &{hObj:{hObj:102 qMgr:0xc0000df188 Name:[$SYS/MQ/INFO/QMGR//Monitor/METADATA/CLASSES]} topic:$SYS/MQ/INFO/QMGR//Monitor/METADATA/CLASSES durable:false managed:true} "
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.326 : > [Close]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.365 : < [Close] rp: 0 Error: nil
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [unsubscribe] rp: 0 Error: nil"
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.365 : > [Close]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.403 : < [Close] rp: 0 Error: nil
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [discoverStats] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=debug msg="Setting connection to grab qdepth via Publication"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [discoverAndSubscribe] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [DiscoverAndSubscribe] rp: 0 Error: MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [RediscoverAttributes]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [inquireChannelAttributes]"
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [statusClearReplyQ]"
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.404 : > [Get]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.404 : > [getInternal]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.404 : BufferLength: 0
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="> [EndConnection]"
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.404 : > [Disc]
2025-05-02 11:53:48 [ibmmq] 2025-05-02T09:53:48.446 : < [Disc] rp: 0 Error: nil
2025-05-02 11:53:48 time="2025-05-02T09:53:48Z" level=trace msg="< [EndConnection] rp: 0"
2025-05-02 11:53:48 panic: runtime error: invalid memory address or nil pointer dereference
2025-05-02 11:53:48 [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x52fc59]
2025-05-02 11:53:48 
2025-05-02 11:53:48 goroutine 1 [running]:
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.getInternal.func1(...)
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:865
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.getInternal({0x0, 0x0, {0x0, 0x0}}, 0xc000296000, 0xc000298000, {0x1021120, 0x0, 0x0}, 0x0)
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:870 +0x419
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/ibmmq.MQObject.Get({0x1?, 0x0?, {0x0?, 0x12?}}, 0xc000296000, 0xc000298000, {0x1021120, 0x0, 0x0})
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqi.go:773 +0xcd
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/mqmetric.clearQ({0x9988b2?, 0x0?, {0x0?, 0xc00002fb08?}})
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/status.go:161 +0x99
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/mqmetric.statusClearReplyQ()
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/status.go:174 +0x9f
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/mqmetric.inquireChannelAttributes({0xc0000cc340, 0xc}, 0xc000280510)
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/channel.go:591 +0xad
2025-05-02 11:53:48 github.com/ibm-messaging/mq-golang/v5/mqmetric.RediscoverAttributes(0x6, {0xc0000cc340, 0xc})
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:284 +0x135
2025-05-02 11:53:48 main.main()
2025-05-02 11:53:48     /go/src/github.com/ibm-messaging/mq-metric-samples/main.go:142 +0x76a

We checked the queue manager error logs and did not find any permission-related issues.
The MQ version in use is 9.2, and the operating system is Z/OS.
I remain available for any further details or clarifications.
Thanks again.

ibmmqmet added a commit that referenced this issue May 6, 2025
@ibmmqmet
Copy link
Collaborator

ibmmqmet commented May 6, 2025

Thanks for the extra trace. I've been able to work out what's going on and have pushed a temporary fix direct into the vendor tree (which is not usually a good idea, but just about acceptable since I also control that dependency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants