CouchDB
  1. CouchDB
  2. COUCHDB-1193

Inconsistent decoding of rewritten query parameters

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: HTTP Interface
    • Labels:
    • Skill Level:
      New Contributors Level (Easy)

      Description

      {
      "from": "/",
      "to": "_view/q",
      "method": "GET",
      "query":

      { "limit": 30 }

      }
      (exact rule: http://pastebin.com/tjyR5e9R)

      throws

      {"error":"unknown_error","reason":"badarg"}

      (complete trace: http://pastebin.com/rKQgbmeq)

      As daleharvey pointed out on irc, this is due to inconsitent JSON decoding of query params. daleharvey suggests a fix like in
      http://pastebin.me/0ed2942f6953cb00cab1bd53861c1568

      A temporarily fix is to quote the parameters:
      {
      "from": "/",
      "to": "_view/q",
      "method": "GET",
      "query":

      { "limit": "30" }

      }

        Activity

        Hide
        Marcos Zanona added a comment - - edited

        I am trying with the following:

        {
        "from" : "_view/model",
        "to": "_view/type",
        "query" :

        { "startkey" : ["test"], "endkey" : ["test_"], "group_level" : "1" }

        }

        it seems the group_level really doesn't change at all, actually it is acting really weird, it changes the first time, when you move back to the old value it doesn't change at all...

        It seems that for the rewrite output update after any change in the file I have to create an error, like saving a wrong formatted json, render the page in the browser which will emit the error message, then update the rewrite again with the proper data. This way the view output will be refreshed too.

        I found it very weird...
        You can easily replicate the error by toggling between group_levels and you will notice it won't update all all, instead you provoque some error and then render it again.

        Show
        Marcos Zanona added a comment - - edited I am trying with the following: { "from" : "_view/model", "to": "_view/type", "query" : { "startkey" : ["test"], "endkey" : ["test_"], "group_level" : "1" } } it seems the group_level really doesn't change at all, actually it is acting really weird, it changes the first time, when you move back to the old value it doesn't change at all... It seems that for the rewrite output update after any change in the file I have to create an error, like saving a wrong formatted json, render the page in the browser which will emit the error message, then update the rewrite again with the proper data. This way the view output will be refreshed too. I found it very weird... You can easily replicate the error by toggling between group_levels and you will notice it won't update all all, instead you provoque some error and then render it again.

          People

          • Assignee:
            Unassigned
            Reporter:
            Johannes J. Schmidt
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development