CouchDB
  1. CouchDB
  2. COUCHDB-1053

missing_named_view for reduce fxns that compile but throw runtime errors

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: JavaScript View Server
    • Labels:
      None
    • Environment:

      OSX, prebuilt

    • Skill Level:
      New Contributors Level (Easy)

      Description

      Attempting to query a map-only view with reduce=false yields the same error message as (1) a view that is undefined and (2) a view that has a defined, compile-time valid, but run-time invalid reduce function. So if your reduce function throws a TypeError, you get this cryptic error (cryptic b/c so many problems yield the same error) instead of an error to that effect. Errors do show up in the log, and this is what the view gives:

      {"error":"not_found","reason":"missing_named_view"}

      Might be fixed in 1.0.2 but I cant use the built-in updater anymore after corporate firewall changes!

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Yep. Fixed in 1.0.2

        • Allow reduce=false parameter in map-only views

        http://couchdb.apache.org/downloads.html

        Show
        Paul Joseph Davis added a comment - Yep. Fixed in 1.0.2 Allow reduce=false parameter in map-only views http://couchdb.apache.org/downloads.html
        Hide
        Paul Joseph Davis added a comment -

        Oh look, comments for resolving. And its in a lightbox. New JIRA is so future.

        Show
        Paul Joseph Davis added a comment - Oh look, comments for resolving. And its in a lightbox. New JIRA is so future.
        Hide
        Ryan Richt added a comment -

        confirm that #2. You also get the error on a view whose map works perfectly well, but that has a malformed reduce function a la:

        Log :: function raised exception (new TypeError("keys.reduce is not a function", ""))

        Especially confusing in that case.

        Show
        Ryan Richt added a comment - confirm that #2. You also get the error on a view whose map works perfectly well, but that has a malformed reduce function a la: Log :: function raised exception (new TypeError("keys.reduce is not a function", "")) Especially confusing in that case.
        Hide
        Paul Joseph Davis added a comment -

        Oh missed that second point. Yeah, feel free to reopen and edit the title to be more specific to that and someone will get on it.

        Show
        Paul Joseph Davis added a comment - Oh missed that second point. Yeah, feel free to reopen and edit the title to be more specific to that and someone will get on it.
        Hide
        Jan Lehnardt added a comment -

        Bump to 1.3.x.

        Show
        Jan Lehnardt added a comment - Bump to 1.3.x.
        Hide
        Joan Touzet added a comment -

        Bob asked for a couple of simple tickets, so here's a fun one for him. Looks straightforward.

        Show
        Joan Touzet added a comment - Bob asked for a couple of simple tickets, so here's a fun one for him. Looks straightforward.
        Hide
        Joan Touzet added a comment -

        In 1.3.x and master, we no longer throw missing_named_view.

        If you have a run-time error in a reduce or map function, the error is logged to the logfile as, for example:

        [info] [<0.638.0>] OS Process #Port<0.3197> Log :: function raised exception (new TypeError("This is a fake TypeError.", "undefined", 1))

        , but we still return a 200 with any results that manage to successfully return. If no results are returned, it looks like:

        {"rows":[

        {"key":null,"value":null}

        ]}

        for a reduce=true and

        {"rows":[ ]}

        for a reduce=false.

        Recommend closing as the error reported by the original poster is no longer accurate. This is about the best we can do, though in the future we could consider a 5xx upon any thrown errors.

        Show
        Joan Touzet added a comment - In 1.3.x and master, we no longer throw missing_named_view. If you have a run-time error in a reduce or map function, the error is logged to the logfile as, for example: [info] [<0.638.0>] OS Process #Port<0.3197> Log :: function raised exception (new TypeError("This is a fake TypeError.", "undefined", 1)) , but we still return a 200 with any results that manage to successfully return. If no results are returned, it looks like: {"rows":[ {"key":null,"value":null} ]} for a reduce=true and {"rows":[ ]} for a reduce=false. Recommend closing as the error reported by the original poster is no longer accurate. This is about the best we can do, though in the future we could consider a 5xx upon any thrown errors.

          People

          • Assignee:
            Joan Touzet
            Reporter:
            Ryan Richt
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development