Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49372

Duplicate bson field error message refers to something which is not user input

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: 4.4.0-rc11
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Send multiple $readPreference fields in a find query.

      Show
      Send multiple $readPreference fields in a find query.

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-servicearch Backlog - Service Architecture
              Reporter:
              oleg.pudeyev Oleg Pudeyev
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: