简体   繁体   English

烧瓶 - pymongo.errors.ServerSelectionTimeoutError

[英]Flask - pymongo.errors.ServerSelectionTimeoutError

For some reason, my flask project stopped working.出于某种原因,我的烧瓶项目停止工作。 When I run "python run.py", my app crash.当我运行“python run.py”时,我的应用程序崩溃了。 See below a screenshot of the errors in my terminal.请参阅下面我终端中错误的屏幕截图。 I have checked my password and the mongoDB URI and they are both correct.我检查了我的密码和 mongoDB URI,它们都是正确的。

I also restarted my laptop, reinstall all the pip dependencies.我还重新启动了笔记本电脑,重新安装了所有 pip 依赖项。

I also tried to downgrade pymongo dep.我还尝试降级 pymongo dep。

Any help/suggestion is welcome.欢迎任何帮助/建议。

Pymongo errors screenshot Pymongo 错误截图

Most likely a connection to a backend component (like a mongo database) is not working, but your calling code is not surfacing the connection error.很可能与后端组件(如 mongo 数据库)的连接不起作用,但您的调用代码没有显示连接错误。

I encountered this error in using a function from a module that was calling Mongo, but Mongo wasn't running.我在使用调用 Mongo 的模块中的函数时遇到了这个错误,但 Mongo 没有运行。 When I put the code that had the mongo dependency in a try/except block and exposed the error I realized what the problem was:当我将具有 mongo 依赖关系的代码放在 try/except 块中并暴露错误时,我意识到问题出在哪里:

Error: localhost:27017: [Errno 61] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 62c98060ffc5725d82895ab4, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 61] Connection refused')>]>

I just restarted my Mongo and the error cleared.我刚刚重新启动了我的 Mongo 并清除了错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pymongo.errors.ServerSelectionTimeoutError - pymongo.errors.ServerSelectionTimeoutError pymongo.errors.ServerSelectionTimeoutError 错误与 MongoDB 图集和 Flask - pymongo.errors.ServerSelectionTimeoutError error with MongoDB atlas and Flask 烧瓶 Web 服务中的 Mongodb 错误 [pymongo.errors.ServerSelectionTimeoutError] - Mongodb error [pymongo.errors.ServerSelectionTimeoutError] in flask web-service pymongo.errors.ServerSelectionTimeoutError: RepliceSetNoPrimary - MongoDB Atlas - pymongo.errors.ServerSelectionTimeoutError: RepliceSetNoPrimary - MongoDB Atlas Pymongo pymongo.errors.ServerSelectionTimeoutError 使用示例代码时 - Pymongo pymongo.errors.ServerSelectionTimeoutError when using example code 连接到 mongo 图集给出 pymongo.errors.ServerSelectionTimeoutError: localhost:27017 - Connecting to mongo atlas gives pymongo.errors.ServerSelectionTimeoutError: localhost:27017 pymongo.errors.ServerSelectionTimeoutError:本地主机:27017:[Errno 61]连接被拒绝 - pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused 尝试连接到 CosmosDB 数据库时出现 pymongo.errors.ServerSelectionTimeoutError - Getting pymongo.errors.ServerSelectionTimeoutError when attempting to connect to a CosmosDB database pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] 连接被拒绝 - pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused pymongo pymongo.errors.ServerSelectionTimeoutError:hour must be in 0..23, Timeout: 30s, Topology Description: - pymongo pymongo.errors.ServerSelectionTimeoutError:hour must be in 0..23, Timeout: 30s, Topology Description:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM