Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2296

mongoimport reports documents imported despite failure with authorization error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.12
    • Affects Version/s: 3.6.12
    • Component/s: mongoimport
    • None

      A recent support case from Barclays seems to indicate a regression of TOOLS-1126 or a similar bug:

      /apps/mongodb/sysmngdemeafrm1/downloads/mongodb-linux-x86_64-3.6.12-ent/bin/mongoimport --verbose --host=ldndsr000006502.intranet.barcapint.com:27118 --gssapiHostName=ldndsr000006502.intranet.barcapint.com --ssl --sslAllowInvalidHostnames --sslAllowInvalidCertificates -d DBInventory -c Paramdata --upsert --upsertFields MInstance --file=arbiter_data.txt
      2019-05-20T13:10:36.089+0100 using upsert fields: [MInstance]
      2019-05-20T13:10:36.089+0100 filesize: 808 bytes
      2019-05-20T13:10:36.089+0100 using fields:
      2019-05-20T13:10:36.101+0100 connected to: ldndsr000006502.intranet.barcapint.com:27118
      2019-05-20T13:10:36.101+0100 ns: DBInventory.Paramdata
      2019-05-20T13:10:36.104+0100 connected to node type: replset
      2019-05-20T13:10:36.104+0100 using write concern: w='majority', j=false, fsync=false, wtimeout=0
      2019-05-20T13:10:36.107+0100 using write concern: w='majority', j=false, fsync=false, wtimeout=0
      2019-05-20T13:10:36.110+0100 error inserting documents: not authorized on DBInventory to execute command { update: "Paramdata", writeConcern: { getLastError: 1, w: "majority" }, ordered: true, $db: "DBInventory" }
      2019-05-20T13:10:36.111+0100 imported 1 document
      

      We can see that mongoimport is reporting that the one and only document in the input file was imported, but it wasn't.

      The authorization problem was resolved by specifying the correct username, but this issue remains.

      I don't have confirmation, but suspect the server is running 3.4 still.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            nicholas.cottrell@mongodb.com Nic Cottrell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: