Answer the question
In order to leave comments, you need to log in
Docker: Node + Mongo - crashes at startup (mongo exited with code 132) - what could be?
Hello everyone, there was a problem when starting the Node + Mongo container, the assembly is very basic, there are no difficulties.
After the start, the service with nodejs rises and works stably, the mongodb service issues: mongo exited with code 132
, falls and goes into a restart. Accordingly, the node service does not see mongo and crashes with an error getaddrinfo ENOTFOUND mongo
to raise the mongo service docker run --name mongo -d mongo:latest
separately, it is also not possible.
A question for the "GURU" - who faced a similar error and how did he treat it?
In nets, people write that in the absence of support for the sse4.2 processor, this often happens, but my processor supports:
cat /proc/cpuinfo | grep sse4_2
... sse4_1 sse4_2...
version: "3.8"
services:
api:
build: ./api
command: npm run start
restart: unless-stopped
ports:
- "3000:3000"
environment:
- PORT=3000
- MONGO_URL=mongodb://mongo:27017/api
links:
- mongo
depends_on:
- mongo
environment:
WAIT_HOSTS: mongo:27017
mongo:
container_name: mongo
image: mongo
restart: unless-stopped
ports:
- "27017:27017"
FROM node:14.17.3-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
Successfully tagged docker_api:latest
mongo is up-to-date
Starting docker_api_1 ... done
Attaching to mongo, docker_api_1
api_1 |
api_1 | > [email protected] start /usr/src/app
api_1 | > node src/index.js
api_1 |
api_1 | MONGO_URI: mongodb://mongo:27017/api
mongo exited with code 132
api_1 | e: MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo
...
Answer the question
In order to leave comments, you need to log in
The problem was solved by replacing the image with a stable one, the latest version did not fit.
docker pull mongo:4.4.7-focal
According to this gist , your error 132 is:
OBSOLETE_CONFIG_SERVERS_INCONSISTENT
I have no idea what this means, but check your config servers (I don't know if you have them, but monga thinks they do :) )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question