我的应用程序在本地使用时运行良好,但在使用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
如果我的回答不足以作为第一次海报,我深表歉意。我也遇到了这个问题,帮助我进入heroku网页。在";更多";选项是";查看日志";。单击该按钮,然后登录/注册您的应用程序。基于网络的日志似乎提供了更多的细节,应该表明问题出在你的猫鼬连接中。解决这个问题的方法是进入你的数据库网络访问,并将IP访问更改为任何地方,这应该会解决它。希望这有帮助。