zodern / meteor-up

Production Quality Meteor Deployment to Anywhere
http://meteor-up.com/
MIT License
1.27k stars 281 forks source link

MongoNetworkError: connect EHOSTUNREACH - #1294 was closed, but I didn't see a solution #1315

Open RobGordon406 opened 2 years ago

RobGordon406 commented 2 years ago

I'm getting MongoNetworkError: connect EHOSTUNREACH

This seems to be the same as #1294, please correct me if I';m wrong but there didn't seem to be a solution offered. Note: my investigation .. this issue seems be linked to the version of Mongo that I'm trying to connect to.

Mup config

{
    "env": {
      "ROOT_URL": "https://subdomain.host.com",
      "MONGO_URL": "mongodb://user:pass@subdomain.subdomain.subdomain.host.com:16968/db?ssl=true&retryWrites=false",
      "MONGO_OPLOG_URL": "mongodb://oploguser:pw@aws-ap-southeast-1-portal.2.dblayer.com:16969/local?authSource=admin&ssl=true",
    },
    "docker": {
      "image": "zodern/meteor:latest",
    },
    "type": "meteor"
  }
}
Verifying Deployment: FAILED

          ------------------------------------STDERR------------------------------------
           (7) Failed to connect to 172.17.0.3 port 3000: Connection refused
    => Logs:
            },
            address: '10.130.121.135:27017',
            type: 'Unknown',
            hosts: [],
            passives: [],
            arbiters: [],
            tags: {},
            minWireVersion: 0,
            maxWireVersion: 0,
            roundTripTime: -1,
            lastUpdateTime: 5163675311,
            lastWriteDate: 0,
            error: MongoNetworkError: connect EHOSTUNREACH 10.130.121.135:27017
                at connectionFailureError (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connect.js:381:20)
                at TLSSocket.<anonymous> (/built_app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connect.js:301:22)
                at Object.onceWrapper (events.js:520:26)
                at TLSSocket.emit (events.js:400:28)
                at TLSSocket.emit (domain.js:475:12)
                at emitErrorNT (internal/streams/destroy.js:106:8)
                at emitErrorCloseNT (internal/streams/destroy.js:74:3)
                at processTicksAndRejections (internal/process/task_queues.js:82:21)
          },

The issue seems be linked to the version of Mongo because if I connect to Mongo DB 4.4 (Digital Ocean) then the deployment works with this MONGO_URL

    "env": {
      "ROOT_URL": "https://subdomain.host.com",
      "MONGO_URL": "mongodb+srv://user:pass@subdomain.subdomain.host.com/appointments?authSource=admin&replicaSet=managed-mongo-databases",
      "VIRTUAL_HOST": "subdomain.host.com,subdomain.subdomain.host.com",
      "HTTPS_METHOD": "redirect",
      "VIRTUAL_PORT": 3000,
      "HTTP_FORWARDED_COUNT": 1
    },