<html><head></head><body bgcolor="#FFFFFF"><div>Both the bucket name, key, and value should be binary format<br><br>Best regards,<div>Zheng Zhibin</div></div><div><br>在 2011-11-13,上午6:19,Geeth Narayanan <<a href="mailto:gnarayan1@gmail.com">gnarayan1@gmail.com</a>> 写道:<br><br></div><div></div><blockquote type="cite"><div><div>Hi,</div><div><br></div><div>I am trying to put some erlang record item to my dev riak nodes. I get the following error at the bottom. Can you please help?</div><div><br></div><div>1> code:which(riakc_pb_socket).</div>
<div>"/Users/geeth/Apps/riak-erlang-client/ebin/riakc_pb_socket.beam"</div><div><br></div><div>2> {ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8081).</div><div>{ok,<0.34.0>}</div><div><br>
</div><div>3> rd(item, {id, name, desc}).     </div><div>item</div><div><br></div><div>4>     </div><div>4> It = #item{id=1, name="Item1", desc="Some desc"}.</div><div>#item{id = 1,name = "Item1",desc = "Some desc"}</div>
<div><br></div><div>5> MyRec = riakc_obj:new(<<"Items">>, list_to_binary(integer_to_list(It#<a href="http://item.id">item.id</a>)), It).   </div><div>{riakc_obj,<<"Items">>,<<"1">>,undefined,[],undefined,</div>
<div>           #item{id = 1,name = "Item1",desc = "Some desc"}}</div><div><br></div></div></blockquote>Try term_to_binary(It)<br><blockquote type="cite"><div><div>6> Rec = riakc_pb_socket:put(Pid, MyRec).</div><div>** exception exit: {noproc,</div><div>                    {gen_server,call,</div>
<div>                     [<0.34.0>,</div><div>                      {req,</div><div>                       {rpbputreq,<<"Items">>,<<"1">>,undefined,</div><div>                        {rpbcontent,</div>
<div>                         <<131,104,4,100,0,4,105,116,101,109,97,1,107,...>>,</div><div>                         "application/x-erlang-binary",undefined,undefined,</div><div>                         undefined,undefined,undefined,undefined,undefined,</div>
<div>                         undefined},</div><div>                        undefined,undefined,undefined,undefined,undefined,</div><div>                        undefined,undefined},</div><div>                       60000},</div>
<div>                      infinity]}}</div><div>     in function  gen_server:call/3</div><div><br></div><div><div><br class="Apple-interchange-newline">Thanks.</div><div>Geeth</div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>riak-users mailing list</span><br><span><a href="mailto:riak-users@lists.basho.com">riak-users@lists.basho.com</a></span><br><span><a href="http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com">http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com</a></span><br></div></blockquote></body></html>