php - (PHP + MongoDB + Laravel jenssegers)无法向数据库发送“count”命令:套接字错误或超时
问题描述
自 2019 年以来,我一直在我的 Amazon 中运行 MongoDB。它拥有超过数百万的数据,并且直到昨天都运行良好。但是今天当我尝试使用 Laravel jenssegers eloquent 模型进行查询时,它给了我这个错误:
Failed to send "count" command with database "<database>": socket error or timeout
at /var/www/html/console/vendor/mongodb/mongodb/src/Operation/Count.php:154
150| if (isset($this->options['readConcern']) && ! \MongoDB\server_supports_feature($server, self::$wireVersionForReadConcern)) {
151| throw UnsupportedException::readConcernNotSupported();
152| }
153|
154| $cursor = $server->executeReadCommand($this->databaseName, new Command($this->createCommandDocument()), $this->createOptions());
155| $result = current($cursor->toArray());
156|
157| // Older server versions may return a float
158| if ( ! isset($result->n) || ! (is_integer($result->n) || is_float($result->n))) {
Exception trace:
1 MongoDB\Driver\Server::executeReadCommand("dddb", Object(MongoDB\Driver\Command), [Object(MongoDB\Driver\ReadPreference)])
/var/www/html/console/vendor/mongodb/mongodb/src/Operation/Count.php:154
2 MongoDB\Operation\Count::execute(Object(MongoDB\Driver\Server))
/var/www/html/console/vendor/mongodb/mongodb/src/Collection.php:277
Please use the argument -v to see more details.
解决方案
推荐阅读
- python-3.x - 有没有人尝试在 Centos6/7 上集成 Tox 和 SCL?
- wicket - 将 Wicket 1.4.x 迁移到 Wicket 7.9.x
- sql - 使用 RODBC 的 sqlQuery 为 SQL 表拉取中间有空格的变量
- webpack - Webpack:未知参数:模式/配置具有未知属性“模式”
- javascript - 如何在 HTML5 视频标签中提供转发视频功能?
- python - Freeswitch 报告挂钩
- javascript - 如何在剃刀视图中使用 Javascript 拆分('@')脚本?
- javascript - 点击登录时问号添加到网址
- javascript - 使用纯 javascript 从 JSON Url 读取数据并以 HTML 格式显示
- android - 反应本机应用程序中的静默推送通知