i modify the "welcome" application to test out couchdb support.

in models/db.py
db = DAL('couchdb://admin:admin@127.0.0.1:5984')


register the first user works fine, register another user will result in 
the following error but the new user record is actually stored in couchdb.

Traceback (most recent call last):
  File "/home/web2py/gluon/restricted.py", line 209, in restricted
    exec ccode in environment
  File "/home/web2py/applications/test/controllers/default.py" 
<https://10.8.8.18/admin/default/edit/test/controllers/default.py>, line 75, in 
<module>
  File "/home/web2py/gluon/globals.py", line 186, in <lambda>
    self._caller = lambda f: f()
  File "/home/web2py/applications/test/controllers/default.py" 
<https://10.8.8.18/admin/default/edit/test/controllers/default.py>, line 37, in 
user
    return dict(form=auth())
  File "/home/web2py/gluon/tools.py", line 1194, in __call__
    return getattr(self,args[0])()
  File "/home/web2py/gluon/tools.py", line 2151, in register
    self.add_membership(group_id, form.vars.id)
  File "/home/web2py/gluon/tools.py", line 2934, in add_membership
    record = membership(user_id = user_id,group_id = group_id)
  File "/home/web2py/gluon/dal.py", line 7646, in __call__
    return self._db(query).select(limitby=(0,1),for_update=for_update).first()
  File "/home/web2py/gluon/dal.py", line 8766, in select
    return adapter.select(self.query,fields,attributes)
  File "/home/web2py/gluon/dal.py", line 4713, in select
    rows = [cols['value'] for cols in ctable.query(fn)]
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 984, in __iter__
    return iter(self.rows)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 1003, in rows
    self._fetch()
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 990, in _fetch
    data = self.view._exec(self.options)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 914, in _exec
    }, **self._encode_options(options))
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
399, in post_json
    status, headers, data = self.post(*a, **k)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
381, in post
    **params)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
419, in _request
    credentials=self.credentials)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
310, in request
    raise ServerError((status, error))
ServerError: (500, ('compilation_error', 'Expression does not eval to a 
function. ((new 
String("(function(auth_membership){if(((auth_membership.group_id == 
241941851531426793913477551088460735945L) && (auth_membership.user_id == 
248642394256806072494078744897341947048L)))emit(auth_membership._id,[auth_membership._id,auth_membership.user_id,auth_membership.group_id]);})")))'))


also, it will always return invalid login when login. when i check out the db, 
password field stored as 

'pbkdf2(1000,20,sha512)$a6cac362671ec7bb$c8795363970bd2014f525150f476aa506ae51bb4'


any idea?

-vince

-- 



Reply via email to