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

mongoimport fails when record contains dates before epoch with "Assertion: 10338:Invalid use of reserved field name"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: Legacy C++ Implementation
    • Fix Version/s: 2.8.0-rc0
    • Component/s: mongoimport
    • Labels:
    • Environment:
      OS X Snow Leopard, Windows 2003 R2 (32-bit)

      Description

      When importing JSON files containing dates before epoch, import fails with "Assertion: 10338:Invalid use of reserved field name"

      Repro steps:

      ~>: echo '{ "d":

      {"$date":-1}

      }' > before_epoch.json
      ~>: cat before_epoch.json
      { "d":

      {"$date":-1}

      }
      ~>: bin/mongoimport -d test -c date2 --file before_epoch.json
      Mon Apr 5 09:43:37 Assertion: 10338:Invalid use of reserved field name

      Reproduced on OS X 1.4.0-x64, 1.5.1-pre-x64, Windows 2003R2 v1.4.0-x32

        Issue Links

          Activity

          Hide
          jakewharton Jake Wharton added a comment -

          The assertion failure occurs at https://github.com/mongodb/mongo/blob/master/db/json.cpp#L229
          because of https://github.com/mongodb/mongo/blob/master/db/json.cpp#L527-L530
          using an unsigned integer parser.

          I'm going to take a look at it and see if I can update it to correctly interpret signed values.

          Show
          jakewharton Jake Wharton added a comment - The assertion failure occurs at https://github.com/mongodb/mongo/blob/master/db/json.cpp#L229 because of https://github.com/mongodb/mongo/blob/master/db/json.cpp#L527-L530 using an unsigned integer parser. I'm going to take a look at it and see if I can update it to correctly interpret signed values.
          Hide
          bjartek Bjarte Stien Karlsen added a comment -

          Greetings,

          I am still seeing this issue in 2.0.4. My notes are here in this gist: https://gist.github.com/2314294

          It works when i create a new Date in mongoshell but not when importing is the gist of it.

          Show
          bjartek Bjarte Stien Karlsen added a comment - Greetings, I am still seeing this issue in 2.0.4. My notes are here in this gist: https://gist.github.com/2314294 It works when i create a new Date in mongoshell but not when importing is the gist of it.
          Hide
          eliot Eliot Horowitz added a comment -

          Note this bug has not been marked fixed yet.

          Show
          eliot Eliot Horowitz added a comment - Note this bug has not been marked fixed yet.
          Hide
          mpobrien Michael O'Brien added a comment -

          confirmed that this is fixed in the new tools as of 2.8.0-rc0.

          Show
          mpobrien Michael O'Brien added a comment - confirmed that this is fixed in the new tools as of 2.8.0-rc0.

            People

            • Assignee:
              Unassigned
              Reporter:
              ian@10gen.com Ian Whalen
            • Votes:
              17 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: