CouchDB
  1. CouchDB
  2. COUCHDB-1104

POST on a doc with the wrong id gives an obtuse error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux

      Description

      Had this problem during a couchdb training.

      [thomas@otto ~]$ curl -X GET http://localhost:5984/bank/_all_docs{"total_rows":5,"offset":0,"rows":[
      {"id":"fe4a1382596a9071d66412f9f100183c","key":"fe4a1382596a9071d66412f9f100183c","value":{"rev":"1-1e3f1ca41010f7cc641337fa3ea88593"}},
      {"id":"fe4a1382596a9071d66412f9f1001c67","key":"fe4a1382596a9071d66412f9f1001c67","value":{"rev":"1-ea8b064f341943d19776e63201b6d0c4"}},
      {"id":"fe4a1382596a9071d66412f9f1002209","key":"fe4a1382596a9071d66412f9f1002209","value":{"rev":"1-1c8d66f0baf7b022a63d62b99db5f133"}},
      {"id":"fe4a1382596a9071d66412f9f1002da8","key":"fe4a1382596a9071d66412f9f1002da8","value":{"rev":"2-2d03d5121b4df02423cece5432de16cc"}},
      {"id":"fe4a1382596a9071d66412f9f100388a","key":"fe4a1382596a9071d66412f9f100388a","value":{"rev":"1-e194aaf299e9ac452d2db072584271f6"}}
      ]}
      [thomas@otto ~]$ curl -X PUT -H "Content-Type:image/jpeg" "http://localhost:5984/bank/fe4a1382596a9071d66412f9f100183c/picture.jpg?rev=2-2d03d5121b4df02423cece5432de16cc" --data-binary @ik/thomasvs.jpg
      {"error":"

      {not_found,missing}

      ","reason":"

      {2,<<45,3,213,18,27,77,240,36,35,206,206,84,50,222,22,204>>}

      "}
      [thomas@otto ~]$ curl -X PUT -H "Content-Type:image/jpeg" "http://localhost:5984/bank/fe4a1382596a9071d66412f9f100183c/picture.jpg?rev=1-1e3f1ca41010f7cc641337fa3ea88593" --data-binary @ik/thomasvs.jpg

      {"ok":true,"id":"fe4a1382596a9071d66412f9f100183c","rev":"2-650721e13f38e481e1839525cf0caa56"}

      The second command (first put) gives an unreadable reason. The reason is I supplied a non-existing revid for that doc.

        Activity

        Hide
        Jan Lehnardt added a comment -

        This has been fixed in trunk a while ago.

        Show
        Jan Lehnardt added a comment - This has been fixed in trunk a while ago.

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Vander Stichele
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development