简体   繁体   中英

ibmmq node client can't find MQ C Library, fails consistently

I'm trying to create a node app that dockerizes the server and the MQ container, and use the ibmmq node client to interact with said container. I'm running into an issue where I'm not able to get my server running because the MQ C library can't be found. The specific error in question:

Cannot find MQ C library.
   System appears to be: linux[x64]
   Has the MQ C client been installed?
   Have you run setmqenv?
 Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'
     at Object.openSync (fs.js:462:3)
     at readFileSync (fs.js:364:35)
     at new DynamicLibrary (/server/node_modules/ffi-napi/lib/dynamic_library.js:68:23)
     at Object.Library (/server/node_modules/ffi-napi/lib/library.js:47:10)
     at loadLib (/server/node_modules/ibmmq/lib/mqi.js:290:18)
     at loadLibMulti (/server/node_modules/ibmmq/lib/mqi.js:417:13)
     at Object.<anonymous> (/server/node_modules/ibmmq/lib/mqi.js:436:1)
     at Module.<anonymous> (internal/modules/cjs/loader.js:999:30)
     at Module._compile (/server/node_modules/source-map-support/source-map-support.js:568:25)
     at internal/modules/cjs/loader.js:1027:10
 [ERROR] 07:40:21 Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'

When I go to check /opt/... there is no folder mqm. I'm not really sure when it would be created in the process.

Here is my docker file:

FROM node:12

# Non-development values will be provided by Drone when
# deploying to staging or production
ARG ENV="development"

WORKDIR /server

COPY package.json .
COPY yarn.lock .

RUN yarn install --production=false

COPY . .

# In non-dev environments, we need to build executable code
# during image build time so that we're not doing it at
# container startup (which would cause significant down-time)
RUN if [ $ENV = "staging" ] || [ $ENV = "production" ]; \
  then yarn build;  \
  fi

CMD ["yarn", "serve"]

The specific code that triggers the issue:

import mq from 'ibmmq'

const MQC = mq.MQC

I've tried a few things, including not letting the c library build but nothing is working. Any help would be appreciated, thanks in advance!

See https://github.com/ibm-messaging/mq-mqi-nodejs/tree/master/samples for a working Dockerfile example using npm install .

The postinstall script for linux x64 will normally pull in the MQ Redist C client package. If the postinstall is not run for some reason, or cannot download the package, then you have to install the MQ C client manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM