首页 > 解决方案 > 无法部署到 Meteor Galaxy,我不断收到“错误:必须在环境中设置 MONGO_URL”

问题描述

我遵循了我找到的每一个指南,但它一直在崩溃并且没有部署,我完全迷失了。

我构建了以下settings.json文件。

{
  "galaxy.meteor.com": {
    "env": {
      "ROOT_URL": "http://<MyApp>.meteorapp.com/",
      "DEPLOY_HOSTNAME": "galaxy.meteor.com",
      "MONGO_URL": "mongodb+srv://<USER>:<PASS>@cluster0.je1mt.mongodb.net/<DB>?retryWrites=true&w=majority"
    }
  }
}

然后我使用以下命令进行部署:

DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy <MyApp>.meteorapp.com ---settings settings.json

(标记的文本<..>是我文件上的真实数据)

几分钟后,我在我的计算机终端上得到了这个:

******************************************************************************
ERROR: Failed to deploy new app version: 8.
Galaxy failed to deploy your app. The final deploy status was: Deploy Failed.
Your app is currently stopped.
See https://galaxy.meteor.com/app/<MyApp>.meteorapp.com/logs for details.
******************************************************************************

这在 Galaxy 的日志页面上:

2020-11-23 18:17:55-03:00Error: MONGO_URL must be set in environment6n91f
2020-11-23 18:17:55-03:00 at Object.<anonymous> (packages/mongo/remote_collection_driver.js:36:11)6n91f
2020-11-23 18:17:55-03:00 at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)6n91f
2020-11-23 18:17:55-03:00 at new Collection (packages/mongo/collection.js:97:40)6n91f
2020-11-23 18:17:55-03:00 at new AccountsCommon (packages/accounts-base/accounts_common.js:23:18)6n91f
2020-11-23 18:17:55-03:00 at new AccountsServer (packages/accounts-base/accounts_server.js:23:5)6n91f
2020-11-23 18:17:55-03:00 at packages/accounts-base/server_main.js:7:126n91f
2020-11-23 18:17:55-03:00 at module (packages/accounts-base/server_main.js:19:1)6n91f
2020-11-23 18:17:55-03:00 at fileEvaluate (packages/modules-runtime.js:336:7)6n91f
2020-11-23 18:17:55-03:00 at Module.require (packages/modules-runtime.js:238:14)6n91f
2020-11-23 18:17:55-03:00 at require (packages/modules-runtime.js:258:21)6n91f
2020-11-23 18:17:55-03:00 at /app/bundle/programs/server/packages/accounts-base.js:2093:156n91f
2020-11-23 18:17:55-03:00 at /app/bundle/programs/server/packages/accounts-base.js:2100:36n91f
2020-11-23 18:17:55-03:00 at /app/bundle/programs/server/boot.js:401:386n91f
2020-11-23 18:17:55-03:00 at Array.forEach (<anonymous>)6n91f
2020-11-23 18:17:55-03:00 at /app/bundle/programs/server/boot.js:226:216n91f
2020-11-23 18:17:55-03:00 at /app/bundle/programs/server/boot.js:464:76n91f
2020-11-23 18:17:56-03:00Application exited with code: 16n91f
2020-11-23 18:18:31-03:00The container has crashed. A new container will be started to replace it.

标签: node.jsmeteor

解决方案


推荐阅读