Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Question] Failed to send "count" command with database "dddb": socket error or timeout #2055

Unanswered
apsbd asked this question in General
Discussion options

Hi

My server was good until yesterday and now it's showing this error:

Failed to send "count" command with database "dddb": 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.

It would be really very helpful if you give me a solution.

Thanks in advance

You must be logged in to vote

Replies: 2 comments

Comment options

@apsbd Failed to send "count" command with database "dddb": socket error or timeout looks like connect error

You must be logged in to vote
0 replies
Comment options

I have same similar issue with the count() timeout

While looking at mongo docs I noticed this note

MongoDB drivers compatible with the 4.0 features deprecate their respective cursor and collection count() APIs in favor of new APIs for countDocuments() and estimatedDocumentCount(). For the specific API names for a given driver, see the driver documentation.

How can I call countDocuments() or estimatedDocumentCount() methods with this library?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #2055 on September 05, 2020 05:41.

AltStyle によって変換されたページ (->オリジナル) /