Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-6729

newline before form data in buckets POST gives back confusing and wrong errors

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: bug-backlog
    • Component/s: ns_server
    • Security Level: Public
    • Labels:
    • Triage:
      Untriaged

      Description

      For some reason this request is not working and the rest api gives me back a bad error so I don't even know where to look. This happens for many different requests. Below is one example.

      POST /pools/default/buckets HTTP/1.1
      Host: localhost:9000
      Accept-Encoding: identity
      Content-Length: 92
      Content-Type: application/x-www-form-urlencoded
      Accept: /
      Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==

      bucketType=membase&proxyPort=11211&authType=none&name=default&replicaNumber=0&ramQuotaMB=200HTTP/1.1 400 Bad Request
      Server: Couchbase Server 2.0.0r_353_gc2ea2fa
      Pragma: no-cache
      Date: Tue, 25 Sep 2012 23:47:31 GMT
      Content-Type: application/json
      Content-Length: 319
      Cache-Control: no-cache

      {"errors":

      {"ramQuotaMB":"RAM quota cannot be less than 100 MB"}

      ,"summaries":{"ramSummary":

      {"total":536870912,"otherBuckets":0,"nodesCount":1,"perNodeMegs":2,"thisAlloc":2097152,"thisUsed":0,"free":534773760}

      ,"hddSummary":

      {"total":499763888128,"otherData":69966944337,"otherBuckets":0,"thisUsed":0,"free":429796943791}

      }}

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        Your request is actually working for me. Please attach diags and better instructions on how to reproduce.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - Your request is actually working for me. Please attach diags and better instructions on how to reproduce.
        Hide
        mikew Mike Wiederhold added a comment -

        Turns out the reason was that I had an extra new line after the end of the header. In general I think it would be good to give back a different error or no error if the problem isn't with the actual parameters. Something like "Bad Entity" or "Incorrectly formed body" would be much more help. The error I got simply had me looking in the wrong place. On another note. I also had a different issue where I didn't use the "Content-Type: application/x-www-form-urlencoded". If the Content-Type is anything other than this then I get and error about one of the other fields being wrong.

        Show
        mikew Mike Wiederhold added a comment - Turns out the reason was that I had an extra new line after the end of the header. In general I think it would be good to give back a different error or no error if the problem isn't with the actual parameters. Something like "Bad Entity" or "Incorrectly formed body" would be much more help. The error I got simply had me looking in the wrong place. On another note. I also had a different issue where I didn't use the "Content-Type: application/x-www-form-urlencoded". If the Content-Type is anything other than this then I get and error about one of the other fields being wrong.
        Hide
        mikew Mike Wiederhold added a comment -

        See my comment.

        Show
        mikew Mike Wiederhold added a comment - See my comment.
        Hide
        alkondratenko Aleksey Kondratenko (Inactive) added a comment -

        Thanks for finding this out.

        Show
        alkondratenko Aleksey Kondratenko (Inactive) added a comment - Thanks for finding this out.

          People

          • Assignee:
            Aliaksey Artamonau Aliaksey Artamonau
            Reporter:
            mikew Mike Wiederhold
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes