MongoDB "Failed to query for documents to update ... unable to decode message length: EOF"

Viewed 1474

I'm doing a bunch (i.e. around 30) of upserts in a row and occasionally getting "Failed to query for documents to update: handshake failure: connection(etc-etc-etc.mongodb.net:27017[-10399]) unable to decode message length: EOF". Each update uniquely changes the whole document, as opposed to changing the same field(s) to one new value as with updateMany.

Is this a problem with making many separate update requests? I'm using MongoDB's Stitch service FWIW. The Stitch js API suggests that it just creates one connection, but it feels like every update is trying to create a new connection or something.

1 Answers

In my case I received this message when using the GO MongoDB client library. I was trying to issue a shutdown command, but apparently this can only be issued from localhost.

Run the shutdown against the admin database. When using shutdown, the connection must originate from localhost or use an authenticated connection.

I am using an authenticated connection, but I'm guessing there's some error being returned that the library isn't expecting.

I'm wagering that because the Stitch service is a MongoDB product it will be written in Go. They seem to really love Go these days :).

I doubt this will help you, but it's probably an issue with the driver.

Related