当我尝试登录或注册新用户时Heroku崩溃

vbopmzt1  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(274)

我的应用程序在本地使用时运行得很好,但在使用Heroku时,我无法注册或登录。下面是我遇到的错误:

2022-04-14T09:42:38.162125+00:00 heroku[router]: at=info method=GET path="/" host=crypto-emissions-calculator.herokuapp.com request_id=9c770e38-15d6-4aec-8ea7-cc88a54d81f3 fwd="86.26.128.27" dyno=web.1 connect=0ms service=11ms status=302 bytes=402 protocol=https
2022-04-14T09:42:38.202179+00:00 heroku[router]: at=info method=GET path="/accounts/login" host=crypto-emissions-calculator.herokuapp.com request_id=6b4c5157-b8bd-4f8d-9f2c-6cfcdeb70023 fwd="86.26.128.27" dyno=web.1 connect=0ms service=13ms status=304 bytes=151 protocol=https
2022-04-14T09:42:38.309361+00:00 heroku[router]: at=info method=GET path="/css/index.css" host=crypto-emissions-calculator.herokuapp.com request_id=926d9066-9c0b-4be3-8771-6cc7d8c022c2 fwd="86.26.128.27" dyno=web.1 connect=0ms service=13ms status=200 bytes=812 protocol=https
2022-04-14T09:42:59.201019+00:00 app[web.1]: MongooseError: Operation `users.findOne()` buffering timed out after 10000ms
2022-04-14T09:42:59.201032+00:00 app[web.1]:     at Timeout.<anonymous> (/app/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:151:23)
2022-04-14T09:42:59.201033+00:00 app[web.1]:     at listOnTimeout (node:internal/timers:559:17)
2022-04-14T09:42:59.201033+00:00 app[web.1]:     at processTimers (node:internal/timers:502:7)
2022-04-14T09:43:19.179894+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/accounts/login" host=crypto-emissions-calculator.herokuapp.com request_id=7329069b-ee04-4793-ac69-4a91c069abd2 fwd="86.26.128.27" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
mm9b1k5b

mm9b1k5b1#

如果我的回答不足以作为第一次发布者,我很抱歉。我也遇到了这个问题,进入heroku网页是有帮助的。在“更多”选项下面是“查看日志”。点击它,然后登录/注册你的应用程序。看起来基于网络的日志给予了更详细的信息,应该会显示问题出在你的mongoose连接上。解决这个问题的方法是进入你的数据库网络访问,改变IP访问到任何地方,这应该可以解决它。希望这能有所帮助。

相关问题