Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

473
Views
ERROR: Cannot write pid file to /tmp/docker-entrypoint-temp-mongod.pid: Unknown error

Stack information :

BE : NodeJS App, MongoDB

FE : AngularJS App

Use case : I am deploying BE(NodeJS) application on AWS ECS along with MongoDB. There is a task definition (AWS) in which there should be both the containers attached so that Mongo container can be linked to the NodeJS container. Mongo container is from docker hub registry registry.hub.docker.com/library/mongo:latest

Please note I have also subscribed to the CloudWatch Logs for the containers.

I am also providing the MONGO_INITDB_ROOT_PASSWORD & MONGO_INITDB_ROOT_USERNAME as new user environment variables.

Problem : As soon as the service bootstraps NodeJS container, it gets failed with below error.

2019-05-28T14:15:23.208+0000 I CONTROL [main] ERROR: Cannot write pid file to /tmp/docker-entrypoint-temp-mongod.pid: Unknown error

enter image description here

Result : As a result, mongo is not able to get started and NodeJS app is unable to operate on the db. I want this db operations within container (ECS) as a solution.

Please guide what I am doing wrong here!! Kindly Help!

Why it differs from this answer/question : Because in my case the application along with MongoDB is running in container environment and container (Node container) is all responsible for bootstrapping it or restarting the mongo service. Also, the error I am facing is Unknown Error.

EDIT : Dockerfile

    FROM node:8-alpine

    # Create app directory
    WORKDIR /usr/src/app

    # Install app dependencies
    # A wildcard is used to ensure both package.json AND package-lock.json are copied
    # where available (npm@5+)

    COPY package*.json ./


    RUN npm install
    # RUN npm audit

    # Bundle app source
    #COPY . /usr/src/app

    COPY . .

    EXPOSE 9000
    CMD [ "npm", "start" ]
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!