生产中Firebase的Cloud Functions上的mongodb错误 [英] mongodb error on Cloud Functions for Firebase on production

查看:54
本文介绍了生产中Firebase的Cloud Functions上的mongodb错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Cloud Functions for Firebase,在本地进行所有设置并运行firebase serve,并在mlab中使用mongodb设置测试了getpost.

I started playing around with Cloud Functions for Firebase, I did all the setup locally and run firebase serve and tested my get and post with mongodb setup in mlab.

我做了一个firebase deploy,可以很好地部署,然后我回到家,准备玩更多游戏.我使用邮递员,并试图在生产中发布一个帖子.我以某种方式收到Cloud Functions崩溃的错误

I did a firebase deploy which deployed fine, then now I got home, was going to play around more. I used postman and trying to make a post on production. Somehow I get errors that Cloud Functions crashes

我可以看到它似乎没有通过此错误与mongodb连接

I can see that it seems like it's not connecting with mongodb with this error

MongoDB连接错误:{MongoNetworkError:首次连接[MongoNetworkError:getaddrinfo EAI_AGAIN dsxxxxxx.mlab.com:xxxxx]时,无法连接到服务器[dsxxxxx.mlab.com:xxxxx]

MongoDB connection error: { MongoNetworkError: failed to connect to server [dsxxxxx.mlab.com:xxxxx] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN dsxxxxxx.mlab.com:xxxxx]

名称:"MongoNetworkError", 消息:在首次连接[MongoNetworkError:getaddrinfo EAI_AGAIN dsxxxxx.mlab.com:xxxxx]时无法连接到服务器[xxxxx.mlab.com:xxxxx]"

name: 'MongoNetworkError', message: 'failed to connect to server [xxxxx.mlab.com:xxxxx] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN dsxxxxx.mlab.com:xxxxx]'

有人知道我不知道生产部署无法正常工作吗?

Does anyone know what I am missing that the production deploy isn't working?

在此先感谢您的帮助.

推荐答案

免费Spark计划中的Firebase项目无法建立与不受Google控制的服务的传出套接字连接.如果您想建立外向连接,请将付款计划升级到Blaze .您可能仍不会被收取费用,因为应该有足够的免费配额使用,该配额应涵盖小型开发项目.

Firebase projects on the free Spark plan are not able to make outgoing socket connections to services that are not controlled by Google. If you'd like to make an outgoing connection, upgrade your payment plan to Blaze. You'll likely still not be billed, as there are generous free quotas for usage that should cover small development projects.

这篇关于生产中Firebase的Cloud Functions上的mongodb错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆