[SERVER-49372] Duplicate bson field error message refers to something which is not user input Created: 08/Jul/20  Updated: 23/Feb/23  Resolved: 23/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.0-rc11
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Oleg Pudeyev (Inactive) Assignee: Backlog - Service Architecture
Resolution: Won't Fix Votes: 0
Labels: neweng, re-triaged-ticket
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to RUBY-2312 Sending $readPreference in command he... Backlog
Assigned Teams:
Service Arch
Operating System: ALL
Steps To Reproduce:

Send multiple $readPreference fields in a find query.

Participants:

 Description   

We currently have an issue in the Ruby driver where the driver appears to always add its own $readPreference field to the query, even if the user already specified a read preference. This appears to manifest itself as two $readPreference fields being sent to the server.

The error message that the server produces in this case references "OperationSessionInfo" which as far as I can tell is not something that the driver sent to it.

irb(main):002:0> c.database.command(find: "foo", '$readPreference': {})
 
localhost:14420 #1:1 | admin.find | STARTED | {"find"=>"foo", "$readPreference"=>{"mode"=>"primary"}, "$db"=>"admin", "lsid"=>{"id"=><BSON::Binary:0x1020 type=uuid data=0x6e42f7d4fd24479a...>}}
 
D, [2020-07-08T14:22:45.203680 #7382] DEBUG -- : MONGODB | [10] localhost:14420 | admin.find | FAILED | BSON field  'OperationSessionInfo.$readPreference' is a duplicate field (40413) | 0.000546408s

I expected the server error messages to only refer to fields that were provided to it as input and not to internal data structures.



 Comments   
Comment by Lauren Lewis (Inactive) [ 24/Feb/22 ]

We haven’t heard back from you for at least one calendar year, so this issue is being closed. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Comment by Craig Homa [ 14/Jul/20 ]

Passing to Service Arch as Query feels this error message is coming from an IDL generated parser, and we believe Service Arch owns IDL.

Generated at Thu Feb 08 05:19:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.