在ZEIT上部署时出现MongoDB连接错误

时间:2017-11-15 12:35:52

标签: mongodb reactjs meteor graphql zeit-now

我是React的新手,我正试图在zeit上部署。部署是成功的但是在zeit上它会给出错误,如

  

/usr/src/app/bundle/programs/server/node_modules/fibers/future.js:280                           扔(除息);                           ^

Error: query parameter ssl is an incomplete value pair
    at module.exports (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/url_parser.js:47:15)
    at connect (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/mongo_client.js:401:16)
    at Function.MongoClient.connect (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/mongo_client.js:225:3)
    at new MongoConnection (packages/mongo/mongo_driver.js:169:11)
    at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
    at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
    at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
    at new Mongo.Collection (packages/mongo/collection.js:99:40)
    at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
    at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)

如果有人也得到同样的错误,那么请帮助。

2 个答案:

答案 0 :(得分:2)

我面临同样的错误,对我而言,这种情况正在发生,因为我没有通过值为true的ssl参数传递。

ssl=true

使用我的mongo url,所以完整的网址现在看起来像

mongourl://yoururl?ssl=true&otherparameters;

答案 1 :(得分:0)

错误来自mongodb/lib/url_parser.js,这意味着MONGO_URL可能存在问题,可能是SSL部分的问题。

https://docs.meteor.com/environment-variables.html#MONGO-URL