#1 2020-03-05 17:26:52

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

bad formatted bson request in StaticMongoDBRegisterAll

Yesterday I updated the source of the mormot and started receiving an exception in the StaticMongoDBRegisterAll method for Mongo client. I realized that the error occurs for all collections that are empty. The error message is as follows:

Server did reset the connection: probably due to a bad formatted bson request - > close socket"

Offline

#2 2020-03-05 18:35:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,263
Website

Re: bad formatted bson request in StaticMongoDBRegisterAll

Could you try to debug a bit more and find out the culprit in SynMongoDB?

Offline

#3 2020-03-05 20:47:53

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: bad formatted bson request in StaticMongoDBRegisterAll

Hi Ab,
Thanks for the answer. The problem is happening in the TSQLRestStorageMongoDB.TableHasRows method of the unit mormotmongodb. It happens when he executes the fCollection.IsEmpty method for every collection that is empty.

Offline

#4 2020-03-09 12:23:45

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: bad formatted bson request in StaticMongoDBRegisterAll

hi Ab,
I debugged a little more about the problem and found the error exactly in the method AsynchRecv

 result := Recv(sock,buf,buflen,0);

in the SynCrtSock unit

Last edited by fabiovip2019 (2020-03-09 13:45:16)

Offline

#5 2020-03-10 11:18:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,263
Website

Re: bad formatted bson request in StaticMongoDBRegisterAll

Offline

#6 2020-03-10 13:46:51

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: bad formatted bson request in StaticMongoDBRegisterAll

Thanks Ab, I will perform the tests I report here. Doubt, do you still recommend these reviews to use with mormot?
* FPC trunk SVN 40491;
* Lazarus trunk SVN 59757.

Offline

#7 2020-03-10 18:36:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,263
Website

Re: bad formatted bson request in StaticMongoDBRegisterAll

Yes, we only test with those two revision here by now.

Offline

#8 2020-03-11 18:21:01

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: bad formatted bson request in StaticMongoDBRegisterAll

Hi,

I redid the entire installation on lazarus + fcp recommended in the documentation, updated with the trunk of the mormot but the error persists, I cannot initialize TSQLRecords linked to empty collections. Does anyone have any idea what it might be?

Offline

Board footer

Powered by FluxBB