Re: [mongodb-user] MongoCursorException with message: couldn't send query

175 views
Skip to first unread message

Hannes Magnusson

unread,
Oct 10, 2012, 1:16:34 AM10/10/12
to mongod...@googlegroups.com, ant...@mail.ru
On Tue, Oct 9, 2012 at 8:27 PM, WennY <ant...@mail.ru> wrote:
> Hello. When i try to connect, my php said: "PHP Fatal error: Uncaught
> exception 'MongoCursorException' with message 'couldn't send query: [here
> broken encoding]". Sure, it is not php problem. I think problem in mongo
> connections. In the log I found the following:
> if we have exception, in log we may see:
> Wed Oct 10 07:03:15 [initandlisten] connection accepted from 127.0.0.1:60305
> #9
> Wed Oct 10 07:03:15 [conn9] end connection 127.0.0.1:60305
>
> but if we have valid connection we always see:
> Wed Oct 10 07:03:15 [initandlisten] connection accepted from 127.0.0.1:60306
> #10
> Wed Oct 10 07:03:16 [conn10] killcursors: found 0 of 1
> Wed Oct 10 07:03:16 [conn10] end connection 127.0.0.1:60306


We apparently don't kill the cursor when we encounter bad data... It
shouldn't cause any issues though.

We have seen this couple of times in virtualised environments, and we
suspect something is corrupting the network traffic...

Could you try to repair the database (using db.repairDatabase() from
the shell)? Note that it could take some time if you have a lot of
data.
You may want to try just validating the collection first (using
db.collectionName.validate(true)).

That should atleast make sure the database itself isn't at fault :)

-Hannes

WennY

unread,
Oct 10, 2012, 1:43:53 AM10/10/12
to mongod...@googlegroups.com
When trying validate, it say:
SyntaxError: missing ; before statement (shell):1
:(

WennY

unread,
Oct 10, 2012, 6:14:25 AM10/10/12
to mongod...@googlegroups.com
Result of validating:



Hannes Magnusson

unread,
Oct 10, 2012, 8:17:25 PM10/10/12
to mongod...@googlegroups.com, ant...@mail.ru
Looks fine.

Which driver version are you using?
Is this a virtualised environment?
Could you paste the exact query?
Is this a standalone instance running on localhost?

-Hannes

On Wed, Oct 10, 2012 at 3:14 AM, WennY <ant...@mail.ru> wrote:
>
> Result of validating:
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb

WennY

unread,
Oct 11, 2012, 3:55:14 AM10/11/12
to mongod...@googlegroups.com
Which driver version are you using?

php driver file version - 1.2.12.0


Is this a virtualised environment?

No


Could you paste the exact query?

From php - find(array('userId' => 'ololonickname')). Which clean request - dont know :(


Is this a standalone instance running on localhost?

Yeah

WennY

unread,
Oct 12, 2012, 8:29:31 AM10/12/12
to mongod...@googlegroups.com
The problem not in driver! I've got it from shell:

WennY

unread,
Oct 12, 2012, 8:35:17 AM10/12/12
to mongod...@googlegroups.com
And corrupted error: "remote host forcibly severed connection "

Jeremy Mikola

unread,
Oct 12, 2012, 4:09:50 PM10/12/12
to mongod...@googlegroups.com
If the database validated and this is manifesting itself in both the PHP driver and shell, I would suspect some sort of network corruption.

It may be helpful to monitor the packets using something like RawCap (see http://stackoverflow.com/q/1566234/162228).

Also, are you at all able to reproduce this behavior on separate hardware?

WennY

unread,
Oct 13, 2012, 2:21:34 AM10/13/12
to mongod...@googlegroups.com
I've installed your sniffer. What doing? What to look for? Thx

Jeremy Mikola

unread,
Oct 15, 2012, 11:35:31 AM10/15/12
to mongod...@googlegroups.com
Once you capture the network traffic, you should be able to visualize it in Wireshark, which as special support for Mongo's wire protocol: http://wiki.wireshark.org/Mongo

I don't have any more specific advice for you, but the sniffer and Wireshark should be suitable for determining if the network traffic is corrupted.

I would strongly encourage you to also attempt reproduction on another machine.
Reply all
Reply to author
Forward
0 new messages