ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

error is nil, not *ibmmq.MQReturn #89

Closed mlipin closed 5 years ago

mlipin commented 5 years ago

Hello, I have a problem with connection to MQ.

Installed MQ 9.0.5, go version go1.11.5 linux/amd64

./mq_prometheus -ibmmq.queueManager=QMT03 -ibmmq.monitoredQueues="TEST3" -log.level=debug INFO[0000] Starting IBM MQ metrics exporter for Prometheus monitoring INFO[0000] Command queue open ok INFO[0000] Reply queue open ok INFO[0000] Connected to queue manager QMT03 INFO[0000] Subscribing to topic '$SYS/MQ/INFO/QMGR/QMT03/Monitor/METADATA/CLASSES' panic: interface conversion: error is nil, not *ibmmq.MQReturn

goroutine 1 [running]: mqmetric.getMessage(0xc000026501, 0x30, 0x6, 0xdedef0, 0x0, 0x0) /var/mqm/gowork/src/mqmetric/mqif.go:162 +0x2ed mqmetric.discoverClasses(0x0, 0x0, 0xc00002e000, 0x0) /var/mqm/gowork/src/mqmetric/discover.go:133 +0x117 mqmetric.discoverStats(0x0, 0x0, 0x2, 0xc0000b9ea8) /var/mqm/gowork/src/mqmetric/discover.go:288 +0x6d mqmetric.DiscoverAndSubscribe(0x7fffa8919694, 0x5, 0x1, 0x0, 0x0, 0x0, 0x0) /var/mqm/gowork/src/mqmetric/discover.go:98 +0x39 main.main() /var/mqm/gowork/src/github.com/mq-golang-master/cmd/mq_prometheus/main.go:65 +0x3ee

Utilit mqitest work without problem

./mqitest TEST3 QMT03 Connected to queue manager QMT03 Opened queue TEST3 Put message to TEST3 Got message of length 13: Hello from Go MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033] Closed queue Subscribed to topic $SYS/MQ/INFO/QMGR/QMT03/ActivityTrace/ApplName/mqitest Got message of length 1244. Format = MQADMIN MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_NO_MSG_AVAILABLE [2033] Opened QMgr for MQINQ MQINQ returned +[5000 0] QMT03 DLQ 'QMT03 ' Disconnected from queue manager QMT03

Thank you very much for your answer.

Mike

ibmmqmet commented 5 years ago

Are you using current levels of the packages? That stack trace doesn't seem to tie up with line numbers (or function names) in the code.

mlipin commented 5 years ago

Thank you very much for your response. I updated the local repositories and it all worked)