You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Nick Kitto (Created) (JIRA)" <ji...@apache.org> on 2012/03/15 04:03:37 UTC

[jira] [Created] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Permanent Erlang views not working on CouchDB 1.1.1
---------------------------------------------------

                 Key: COUCHDB-1440
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
             Project: CouchDB
          Issue Type: Bug
          Components: View Server Support
    Affects Versions: 1.1.1
         Environment: Microsoft Windows 7
            Reporter: Nick Kitto


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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Nick Kitto (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Kitto updated COUCHDB-1440:
--------------------------------

    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.

  was:
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)

    
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>         Attachments: jira-couch.log
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Nick Kitto (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Kitto closed COUCHDB-1440.
-------------------------------

    Resolution: Invalid

The issue was because of an incorrect configuration.
                
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>         Attachments: jira-couch.log
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230098#comment-13230098 ] 

Dave Cottlehuber commented on COUCHDB-1440:
-------------------------------------------

Hi Nick,

Missed you on irc.

Deep in those logs is the key:

erl_parse,["syntax error before: ","'{'"]},{1,erl_parse,["syntax error before: ","'{'"]}]},[{couch_query_servers,'-start_doc_map/3-fun-0-',2},{lists,foreach,2},{couch_query_servers,start_doc

Without seeing the whole of the ddoc, I suspect what's happening is that you are trying to mix erlang and javascript in the same ddoc. This IIRC is not supported; each ddoc needs a unique language. If you don't specify one, JS is assumed. Take a look at the first image http://guide.couchdb.org/draft/design.html and see how the language is specified right at the top, even though there are filters etc further down. Pop in on irc again and you should be sorted out in no time.

BTW in future you can:

stop couch running as a service (if you have)
open a command prompt, then:

bin\couchdb.bat

Which allows you to see the couchdb logs whizz past in real time. Hint: change the font & background.

                
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>         Attachments: jira-couch.log
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Nick Kitto (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Kitto updated COUCHDB-1440:
--------------------------------

    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)

  was:
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

    
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Nick Kitto (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Kitto updated COUCHDB-1440:
--------------------------------

    Attachment: jira-couch.log

The associated logfile when it is viewed inside Futon
                
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>         Attachments: jira-couch.log
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1440) Permanent Erlang views not working on CouchDB 1.1.1

Posted by "Nick Kitto (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230110#comment-13230110 ] 

Nick Kitto commented on COUCHDB-1440:
-------------------------------------

Hey Dave,
I created a new copy with just one view and it seems to work fine. I was just changing one of the views (and the language) in order to test whether or not it worked in the specific situation. However it looks like the filter function or the other views (which aren't being used, but are written in js) caused this error to pop up. When I'm back in the office I'll take the plunge and convert all of the views and the filters to erlang and it should work.
I will reopen this ticket if I cannot sort out the problem.
Thanks!
                
> Permanent Erlang views not working on CouchDB 1.1.1
> ---------------------------------------------------
>
>                 Key: COUCHDB-1440
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1440
>             Project: CouchDB
>          Issue Type: Bug
>          Components: View Server Support
>    Affects Versions: 1.1.1
>         Environment: Microsoft Windows 7
>            Reporter: Nick Kitto
>              Labels: Bug, Erlang, Error
>         Attachments: jira-couch.log
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira