couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Hinrichs - DM&T" <dunde...@gmail.com>
Subject Re: Problem with python view server
Date Mon, 23 Feb 2009 22:37:40 GMT
On Mon, Feb 23, 2009 at 2:19 PM, Simon Metson
<simonmetson@googlemail.com> wrote:
> Hi All,
>        Got it all working (thanks to Jeff and the docs...). It was something
> stupid on my part, I blame jet lag and a Chicago blues club...
> Cheers
> Simon
>
> On 22 Feb 2009, at 20:23, Jeff Hinrichs - DM&T wrote:
>
>> On Sun, Feb 22, 2009 at 12:42 PM, Simon Metson
>> <simonmetson@googlemail.com> wrote:
>>>
>>> Hi All,
>>>      Using CouchDB 0.9.0a722639-incubating I get the following error when
>>> trying to access a python view server:
>>>
>>>
>>> {"error":"{badmatch,{start_array,{decoder,null,37,1,38,trim}}}","reason":"[{mochijson2,json_decode,2},\n
>>> {couch_query_servers,read_json,1},\n {couch_query_servers,prompt,2},\n
>>> {couch_query_servers,'-map_docs/2-fun-1-',2},\n {lists,map,2},\n
>>> {couch_query_servers,map_docs,2},\n {couch_view,view_compute,2},\n
>>> {couch_view,update_group,1}]"}
>>>
>>> http://localhost:5984/_config/query_servers/ has:
>>>
>>> {"python":"/Users/metson/Documents/Workspace/PlayGround/couchdb-python/build/lib/couchdb/view.py","javascript":"/Users/metson/Documents/Workspace/PlayGround/couchdb/install/bin/couchjs
>>> /Users/metson/Documents/Workspace/PlayGround/couchdb/install/share/couchdb/server/main.js"}
>>
>> You want to use couchpy as your view server.
>> Assuming python-couchdb 0.5
>>>
>>> which is from the latest trunk of couchdb-python, and the view is:
>>> def mapfun(doc): yield doc
>>
>> You will want to yield  key,values -- you would actually want something
>> like:
>>  yield None, doc
>>
>>>
>>> The script is executable, and, as far as I can tell the python path is
>>> correct (I can import all the libs).
>>> Am I doing something obviously wrong? Should I update to a more recent
>>> couch build?
>>> Cheers
>>> Simon
>>
>> Regards,
Glad I could help.

-Jeff

Mime
View raw message