You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Joscha Feth (JIRA)" <ji...@apache.org> on 2009/11/26 02:47:39 UTC

[jira] Created: (COUCHDB-579) Using filters on continuous feeds fails

Using filters on continuous feeds fails
---------------------------------------

                 Key: COUCHDB-579
                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
    Affects Versions: 0.10
         Environment: Mac OSX 10.6
            Reporter: Joscha Feth


When using continuous feeds, such as for example:

/mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example

CouchDB fails with a status code of 500 after putting a new document into the database.

test filter for this issue:

"example": "function(doc, req) { return true; }"

sysout from couchdb:

....PUT here....
1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /spreadsheets/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'

Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-579) Using filters on continuous feeds fails

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

Mark Beeson updated COUCHDB-579:
--------------------------------

    Attachment: stacktrace-579.txt

Log of the filter code failing.

> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>         Attachments: stacktrace-579.txt
>
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-579) Using filters on continuous feeds fails

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783681#action_12783681 ] 

Joscha Feth commented on COUCHDB-579:
-------------------------------------

More information:

1> [info] [<0.5917.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
1> [error] [<0.5771.0>] OS Process Error :: {os_process_error,"OS process timed out."}
1> [error] [<0.5771.0>] Uncaught error in HTTP request: {exit,
                                 {normal,
                                  {gen_server,call,
                                   [couch_query_servers,
                                    {ret_proc,
                                     {proc,<0.5917.0>,<<"javascript">>,
                                      {couch_os_process,prompt},
                                      {couch_os_process,set_timeout},
                                      {couch_os_process,stop}}}]}}}
1> [info] [<0.5771.0>] Stacktrace: [{gen_server,call,2},
             {couch_query_servers,ret_os_process,1},
             {couch_query_servers,end_filter,1},
             {couch_httpd_db,send_changes,8},
             {couch_httpd_db,handle_changes_req,2},
             {couch_httpd_db,do_db_req,2},
             {couch_httpd,handle_request,5},
             {mochiweb_http,headers,5}]
1> [error] [<0.47.0>] {error_report,<0.24.0>,
              {<0.47.0>,supervisor_report,
               [{supervisor,{local,couch_secondary_services}},
                {errorContext,child_terminated},
                {reason,normal},
                {offender,[{pid,<0.5779.0>},
                           {name,query_servers},
                           {mfa,{couch_query_servers,start_link,[]}},
                           {restart_type,permanent},
                           {shutdown,brutal_kill},
                           {child_type,worker}]}]}}
1> [info] [<0.5771.0>] 127.0.0.1 - - 'GET' /whatever/_changes?filter=filters/byId 500

> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-579) Using filters on continuous feeds fails

Posted by "Mark Beeson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846334#action_12846334 ] 

Mark Beeson commented on COUCHDB-579:
-------------------------------------

Scratch that -- it is still happening on 0.10.1.  It appears to be sporadic in that I can't 100% reproduce it. I'll attach a file with log lines and a stack trace.

> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>         Attachments: stacktrace-579.txt
>
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-579) Using filters on continuous feeds fails

Posted by "Eddie Corns (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863748#action_12863748 ] 

Eddie Corns commented on COUCHDB-579:
-------------------------------------

I had this same problem and google led me here so I'll comment here in case anyone else ends up here.

What I had was some code like: 

  function (doc,req) { if (doc.status && job.status == 'queued') ...

Out of context like that it is obvious that I had job.status instead of doc.status.  It turned out that this was the culprit.  Presumably some sort of JS runtime error since there was no job var.

HTH


> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>         Attachments: stacktrace-579.txt
>
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-579) Using filters on continuous feeds fails

Posted by "Mark Beeson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846306#action_12846306 ] 

Mark Beeson commented on COUCHDB-579:
-------------------------------------

Appears to have been fixed in CouchDBX 0.10.1 -- I can't replicate the issue on the newer version.

> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-579) Using filters on continuous feeds fails

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

Joscha Feth updated COUCHDB-579:
--------------------------------

    Description: 
When using continuous feeds, such as for example:

/mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example

CouchDB fails with a status code of 500 after putting a new document into the database.

test filter for this issue:

"example": "function(doc, req) { return true; }"

sysout from couchdb:

....PUT here....
1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'

Can be reproduced - as soon as feed is not filtered, the issue goes away.

  was:
When using continuous feeds, such as for example:

/mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example

CouchDB fails with a status code of 500 after putting a new document into the database.

test filter for this issue:

"example": "function(doc, req) { return true; }"

sysout from couchdb:

....PUT here....
1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /spreadsheets/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'

Can be reproduced - as soon as feed is not filtered, the issue goes away.


> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COUCHDB-579) Using filters on continuous feeds fails

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

Chris Anderson closed COUCHDB-579.
----------------------------------

    Resolution: Fixed

I've committed a test for this in r885533. 

The test passes out of the gate, so I think the bug is not related.

It looks like your stack trace indicates some issues with your javascript function (although it looks simple). Perhaps you can try again with a different set of documents. (or look at the changes.js test for the filtered continuous call and see if it's doing what you're trying.)

> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-579) Using filters on continuous feeds fails

Posted by "Mark Beeson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846187#action_12846187 ] 

Mark Beeson commented on COUCHDB-579:
-------------------------------------

This is failing for me as well, CouchDBX 0.10.0.

Here's a sample doc:

{
   "_id": "96c9fe2080b2e2717557fd1702e2b00e",
   "_rev": "1-60537eca2b27c9670c9b4ffc3bf26d8e",
   "url": "http://localhost/node.html",
   "ip_address": "127.0.0.1",
   "timestamp": 1268778817703
}


Here's the filter:

{
   "domain": "function(doc, req) { if(doc.url && doc.url.split(/\\/+/g)[1] == req.query.domain) { return true; } else return false; }"
}


Hitting /db/_changes?filter={myview}/domain&domain=localhost&feed=longpoll&since={latestnum} throws a 500 error when inserting a doc:

1> [info] [<0.5522.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
1> [error] [<0.5516.0>] OS Process Error :: {os_process_error,"OS process timed out."}



> Using filters on continuous feeds fails
> ---------------------------------------
>
>                 Key: COUCHDB-579
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-579
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.10
>         Environment: Mac OSX 10.6
>            Reporter: Joscha Feth
>
> When using continuous feeds, such as for example:
> /mydb/_changes?feed=continuous&heartbeat=1000&id=myId&since=428&filter=complete/example
> CouchDB fails with a status code of 500 after putting a new document into the database.
> test filter for this issue:
> "example": "function(doc, req) { return true; }"
> sysout from couchdb:
> ....PUT here....
> 1> [info] [<0.644.0>] OS Process :: Error converting object to JSON: TypeError: toJSON.dispatcher[val.constructor.name] is not a function
> 1> [info] [<0.642.0>] 192.168.178.45 - - 'GET' /mydb/f3cacfc2bfbf1aa0b0c8313fc7b181ec?revs_info=true 200
> 1> [info] [<0.1045.0>] 192.168.178.45 - - 'GET' / 200
> 1> [error] [<0.1039.0>] OS Process Error :: {os_process_error,"OS process timed out."}
> 1> [info] [<0.1039.0>] 192.168.178.45 - - 'GET'
> Can be reproduced - as soon as feed is not filtered, the issue goes away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.