node.js - 无法部署到 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.
解决方案
推荐阅读
- javascript - 在 JavaScript 中,为什么不能修改常量字符串但可以修改常量数组
- python - 当我将参数传递给派生类时,派生类的行为不像基类
- ios - 在 Swift 中加载图像时应用程序冻结
- php - Laravel 刀片 @section 不起作用
- python - python和arduino通过串口通信,只接收零
- python - 检查来自对象的值是否具有字符
- java - 从 arrayList 中删除对象并打印出剩余的对象
- javascript - 为什么参数 multi 在 mongo 请求中不起作用?
- jpa - Kotlin JPA 继承建议
- java - 对象构造在实践中是否保证所有线程都看到初始化的非最终字段?