hi thanks for the reply, that was the issue, the search was put to false. On Thu, Mar 1, 2012 at 10:05 AM, Russell Brown <russel...@basho.com> wrote: > > On 1 Mar 2012, at 07:52, Norman Khine wrote: > > I hade created a bucket 'users', which i then deleted through the > 'recon' interface (well i deleted all the keys within that bucket), > but now every time i try to push a new key, i get this error: > > { [Error: HTTP error 500: Error: > {precommit_fail,{hook_crashed,{riak_search_kv_hook,precommit,error,badarg}}} > ] statusCode: 500 } > > > What is the output of > > curl localhost:8098/riak/users
☺ curl localhost:8098/riak/users "" {"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"users","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[{"mod":"riak_search_kv_hook","fun":"precommit"}],"pw":0,"r":"quorum","rw":"quorum","small_vclock":10,"w":"quorum","young_vclock":20}}% > > ? > > Is search enabled? Do you mean for it to be enabled? You can get this error > if you have the search precommit hook installed but search is not turned on > in your app.config. > > What does it say in your app.config for the setting > > %% Riak Search Config > {riak_search, [ > %% To enable Search functionality set this 'true'. > {enabled, false} > ]}, > ? Search in my /usr/local/Cellar/riak/1.0.3/libexec/etc/app.config was set to false, i have changed this to true > > Cheers > > Russell > > here is the code: > > > origin = /\/(.*)\.gif/.exec(request.url); > if (origin) { > var ip = request.connection.remoteAddress; > city = new City(__dirname + "/GeoLiteCity.dat"); > city.lookup(ip, function(err, location) { > obj = { > city: location.city > , latitude: > location.latitude > , longitude: > location.longitude > , ip: ip > , timestamp: time > } > self.bayeux.getClient().publish('/stat', obj); > // write to riak cluster > db.save('users', 'username', obj, { index: {timestamp: time} }); > console.log('was saved in the riak cluster'); > > if i change the bucket name 'users' to anything else this works, even > if i then delete all the records from that ne bucket, i can still add > records to that new named bucket. the only problem is with this > 'users' bucket. > > is there a way to check what is going on and clean up the database? > > > What is the output of > > curl localhost:8098/riak/users > > ? > > Is there a value in the 'precommit' array? I don't know if recon would add a > hook to the bucket (or if you did?), if there are hooks that you don't want > it, you can remove all hooks with a post like > > curl -X PUT localhost:8098/riak/b -d'{"props": {"precommit":[]}}' > -H'Content-Type: application/json' > > Cheers > > Russell > > > i have a single node on my local machine, running OSX. > > thanks > > norman > > -- > %>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or > chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] ) > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > -- %>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] ) _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com