Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1440

Permanent Erlang views not working on CouchDB 1.1.1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.1.1
    • None
    • View Server Support
    • Microsoft Windows 7

    • Regular Contributors Level (Easy to Medium)

    Description

      Erlang views are fully enabled and work when they are temporary views. When they are saved into my design document via futon they no longer work.
      An example view that I am trying to use is

      fun (

      {Doc}) ->
      case proplists:get_value(<<"doctype">>, Doc) of
      <<"collections">> ->
      Emit(proplists:get_value(<<"_id">>, Doc), {Doc}

      );
      _ ->
      ok
      end
      end.

      The copy inside the design document looks like this when it is saved from futon or pushed using couchapp

      "map": "fun (

      {Doc}) ->\r\n case proplists:get_value(<<\"doctype\">>, Doc) of\r\n <<\"collections\">> ->\r\n Emit(proplists:get_value(<<\"_id\">>, Doc), {Doc}

      );\r\n _ ->\r\n ok\r\n end\r\nend."

      When the view is run directly via the url (ie. localhost:5984/couchapp/_design/jobs/_view/fields) there is no response inside couch.log and nothing loads.
      When the view is run in futon the error recieved is

      Error: An error occurred accessing the view
      no response

      and it spits out a huge logfile (see attachment)

      It is interesting to note that after futon fails to render the view, I can edit the temporary view and add some whitespace and it will run, so it seems like it is an issue only with permanent views.

      Attachments

        1. jira-couch.log
          130 kB
          Nick Kitto

        Activity

          People

            Unassigned Unassigned
            ftdbur Nick Kitto
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: