[Solved]MUP Deploy : MongoError: failed to connect to server [mongodb:27017] on first connect [MongoError: getaddrinfo ENOTFOUND mongodb mongodb:27017]

Hi All,

I am facing below issue while mup deploy.

[18.220.xxx.xxx] x Verifying Deployment: FAILED

        -----------------------------------STDERR-----------------------------------
        meteor app on port:80

        /built_app/programs/server/node_modules/fibers/future.js:313
                                                        throw(ex);
                                                        ^
        MongoError: failed to connect to server [mongodb:27017] on first connect [MongoError: getaddrinfo ENOTFOUND mongodb mongodb:27017]
            at Pool.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/topologies/server.js:336:35)
            at emitOne (events.js:115:13)
            at Pool.emit (events.js:210:7)
            at Connection.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:280:12)
            at Object.onceWrapper (events.js:318:30)
            at emitTwo (events.js:125:13)
            at Connection.emit (events.js:213:7)
            at Socket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:187:49)
            at Object.onceWrapper (events.js:316:30)
            at emitOne (events.js:115:13)

        => Redeploying previous version of the app

        -----------------------------------STDOUT-----------------------------------

        To see more logs type 'mup logs --tail=100'

        ----------------------------------------------------------------------------

And also when I am trying to list all containers mongo is not taking any port. What to do?

sudo docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                            PORTS                  NAMES
789025a88f4a        mongo:3.4.1               "/entrypoint.sh mo..."   28 minutes ago      Restarting (100) 11 minutes ago                          mongodb
739b9606ab63        mup-rightnxtprod:latest   "/bin/sh -c 'bash ..."   24 hours ago        Restarting (1) 11 minutes ago     0.0.0.0:3003->80/tcp   rightnxtProd
f4201c547e37        mup-rightnxttest:latest   "/bin/sh -c 'bash ..."   2 days ago          Restarting (1) 11 minutes ago     0.0.0.0:3000->80/tcp   rightnxttest

Result of docker running is:

docker exec -it mongodb mongo
Error response from daemon: Container 789025a88f4a506112fc16c13aa33b71922c267bdfe650bc667109d5fdae076e is not running

mup.js env variable

env: {      
          ROOT_URL: 'http://xyz.com',      
          MONGO_URL: 'mongodb://127.0.0.1:27017/xyz',      
          PORT: 3003,   
 },

Thanks in advance!

Issue was related to allocated space to root. Brief discussion here.

i have the same error.i couldnt solve it.I am trying to deploy to digital ocean.

@lastpeony I was facing this issue because of low memory on server.