1

I try to deploy my app with Meteor Up with the following configuration:

module.exports = {
  servers: {
    one: {
      host: '192.168.0.220',
      username: 'root',
      password: '******',
    },
  },
  app: {
    name: 'my_app',
    path: '../',
    docker: {
      image: 'abernix/meteord:node-12.14.0-base',
    },
    servers: {
      one: {},
    },
    buildOptions: {
      serverOnly: true,
    },
    env: {
      ROOT_URL: 'http://192.168.0.220:5000',
      MONGO_URL: 'mongodb://localhost/my_app',
      PORT: 5000,
    },
  },
  mongo: {
    version: '4.0.5',
    servers: {
      one: {},
    },
  },
}

Error Log:

Started TaskList: Start Meteor
[192.168.0.220] - Start Meteor
[192.168.0.220] - Start Meteor: SUCCESS
[192.168.0.220] - Verifying Deployment
[192.168.0.220] x Verifying Deployment: FAILED
    
          ------------------------------------STDERR------------------------------------
          de_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:995:11
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:32:7
        at callback (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:280:5)
        at Socket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:310:7)
        at Object.onceWrapper (events.js:300:26)
        at Socket.emit (events.js:210:5)
        at Socket.EventEmitter.emit (domain.js:475:20)
        at emitErrorNT (internal/streams/destroy.js:92:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      name: 'MongoNetworkError'
    }
    => Starting meteor app on port:3000
    /built_app/programs/server/node_modules/fibers/future.js:313
                            throw(ex);
                            ^
    
    MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) {
      name: 'MongoNetworkError'
    }]
        at Pool.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/topologies/server.js:438:11)
        at Pool.emit (events.js:210:5)
        at Pool.EventEmitter.emit (domain.js:475:20)
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:995:11
        at /built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:32:7
        at callback (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:280:5)
        at Socket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:310:7)
        at Object.onceWrapper (events.js:300:26)
        at Socket.emit (events.js:210:5)
        at Socket.EventEmitter.emit (domain.js:475:20)
        at emitErrorNT (internal/streams/destroy.js:92:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      name: 'MongoNetworkError'
    }

docker ps log:

root@pop-os:~# docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED          STATUS                          PORTS                            NAMES
3174bb5bad23  my_app:latest   "/bin/sh -c 'exec $M…"   4 minutes ago    Restarting (1) 48 seconds ago                                    my_app
790f807e9b2d   mongo:4.0.5                 "docker-entrypoint.s…"   39 minutes ago   Up 

mongodb log:

root@pop-os:~# docker exec -it mongodb mongo my_app 
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27017/my_app?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8fbe6eaa-de5a-47c5-8d56-3e0723739cfc") }
MongoDB server version: 4.0.5
Server has startup warnings: 
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] 
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2021-08-02T01:12:26.510+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] 
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2021-08-02T01:12:31.613+0000 I CONTROL  [initandlisten] 
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).

The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---

Version:

  • Meteor version: v2.1
  • Mup version: v1.5.3

Could anyone explain what causes this error? And sorry I'm new to this stuff.

  • Your config and all looks correct to me. Could you run `docker exec -it mongodb mongo my_app` on the host to make sure mongo is running? – Christian Fritz Jul 30 '21 at 14:55
  • @ChristianFritz I am really sorry for my late reply, But after I run `docker exec -it mongodb mongo my_app` it shows like above (I edited question) – user7592187 Aug 02 '21 at 01:30
  • ok great so it's running. Next, since you are connecting to localhost, I would install mongodb-clients on the host and run `mongo my_app` directly on the host. I suspect that that will *not* work. – Christian Fritz Aug 02 '21 at 03:20
  • btw, it's weird that your `docker ps` is not showing a proxy. Any chance you missed a step in configuring your host via mup? – Christian Fritz Aug 02 '21 at 03:22
  • It was working fine before I upgrade Meteor from 1.8.1 to 2.1. The only thing changed in my configuration is node js image: `'abernix/meteord:node-8.15.1-base'` To `'abernix/meteord:node-12.14.0-base'` – user7592187 Aug 02 '21 at 04:20
  • Oh I'm sorry I missing something in docker ps, my Mongo container show port: `127.0.0.1:27017->27017/tcp ` – user7592187 Aug 02 '21 at 04:24

0 Answers0