Home > front end >  Issue with Ibmmq docker container run
Issue with Ibmmq docker container run

Time:07-04

Context: I have been running the NodeJS app with ibmmq as an npm package. This service consumes msg with the help of ibmmq package. For running this app, I had built below docker file.

STAGE1: BUILD
FROM node:16.13.2-bullseye-slim AS base

WORKDIR /app

COPY package*.json ./
COPY tsconfig.json ./
COPY src ./src

RUN echo $(ls -1 ./)
RUN echo $(ls -1 ./src)=
RUN apt-get update && apt-get install --yes curl g   make git python3
RUN npm install

RUN npm run app-build
COPY . .

STAGE2: RELEASE

FROM node:16.13.2-bullseye-slim AS release

WORKDIR /app

COPY --from=base /app/build/src ./src
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/package*.json ./
COPY --from=base /app/tsconfig.json ./

CMD node src/index.js

The above docker image with the container was running perfectly, for the past 6 months. Now it's been giving errors while running the image in the docker container. PFB the error.

container is backing off waiting to restart
-dev:pod/---5dbc6cd9c8-x48tj: container is backing off waiting to restart
[ -5dbc6cd9c8-x48tj ] Cannot find MQ C library.
[ -5dbc6cd9c8-x48tj ] Has the C client been installed?
[ -5dbc6cd9c8-x48tj ] Have you run setmqenv?
failed. Error: container is backing off waiting to restart.

PFB the lib versions:

"node_modules/ibmmq": { "version": "0.9.18", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "ffi-napi": ">=4.0.3", "ref-array-di": ">=1.2.2", "ref-napi": "^3.0.3", "ref-struct-di": ">=1.1.1", "unzipper": ">=0.10.11" }

Please help me here, since 2-3 days I have been trying with multiple images and all are failing now. I have also raised an issue on Github.

Thanks in advance.

CodePudding user response:

Version 0.9.18 of the ibmmq package is about a year old. It had a default version of the MQ C client library to use of 9.2.3.0. IBM removes out-of-support versions of the Redist client from its download site, and with the recent release of 9.3.0, that site got cleaned up about a week ago. So the automatic download of the C package would now fail with that level of the Node package.

If you want to continue to use a particular version of the MQ client past its support lifetime then you need to keep a local copy of the tar file ready to install in your container, and put it in there yourself. And then tell the npm install process not to try to download during the postinstall phase.

The ibmmq package has this documented in its README

I would have expected the npm install to have reported a download error but newer versions of npm seem to have stopped printing useful information during installation by default.

  • Related