Am I using the riak http interface wrong?

Matthew Curry mjcurry at gmail.com
Wed Jan 6 13:25:42 EST 2010


Hello all:

I'm exploring different of these "nosql" map/reduce datastores, and
riak looks promising.  So I'm following along in the README, and I've
had a few problems.

First, there are some typos in the README, mainly that I had to
binary-ize the strings (e.g. "groceries" should be <<"groceries">>
etc.), hg diff attached.

Second, after I managed to get through the README example, I pointed
telnet at the server to issue a GET request to pull out the value of
the key, and I get a 500 internal server error.  Just doing a GET
request on the bucket (not giving a key) seems to work.  My session is
below.
Anyone know what the error message means?  I can see the value
["bread"] in the error response body, however, for some reason the
conversion from riak_object to jiak_object seems to fail, judging from
the stack trace.

-Matt


===================== successful bucket request =============================
1 /tmp
mcurry at strawhat # telnet 127.0.0.1 8098
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /jiak/groceries

HTTP/1.1 200 OK
Vary: Accept, Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.5.1 (hack the charles gibson)
Link: </jiak/groceries/mine>; riaktag="contained"
Last-Modified: Wed, 06 Jan 2010 17:57:08 GMT
Expires: Wed, 06 Jan 2010 18:07:08 GMT
ETag: f467d0d68759c10b57e8408ef767304f2c2ed7c6
Date: Wed, 06 Jan 2010 17:57:08 GMT
Content-Type: application/json
Content-Length: 103

{"schema":{"allowed_fields":"*","required_fields":[],"read_mask":"*","write_mask":"*"},"keys":["mine"]}Connection
closed by foreign host.

===================== unsuccessful bucket and key request =====================
1 /tmp
mcurry at strawhat # telnet 127.0.0.1 8098
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /jiak/groceries/mine

HTTP/1.1 500 Internal Server Error
Vary: Accept, Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.5.1 (hack the charles gibson)
Date: Wed, 06 Jan 2010 18:20:51 GMT
Content-Type: text/html
Content-Length: 1083

<html><head><title>500 Internal Server
Error</title></head><body><h1>Internal Server Error</h1>The server
encountered an error while processing this
request:<br><pre>{error,{badmatch,{{dict,2,16,16,8,80,48,
                        {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
                        {{[],[],[],[],[],[],[],[],[],[],
                          [[<<"X-Riak-VTag">>,103,54,110,112,101,112,79,122,
                            50,99,79,108,53,51,51,107,79,49,110,87,84]],
                          [],[],
                          [[<<"X-Riak-Last-Modified">>|{1262,797013,455926}]],
                          [],[]}}},
                  ["bread"]}},
       [{jiak_object,from_riak_object,1},
        {jiak_client,get,5},
        {jiak_resource,retrieve_object,2},
        {jiak_resource,resource_exists,2},
        {webmachine_resource,resource_call,3},
        {webmachine_resource,do,3},
        {webmachine_decision_core,resource_call,1},
        {webmachine_decision_core,decision,1}]}</pre><P><HR><ADDRESS>mochiweb+webmachine
web server</ADDRESS></body></html>Connection closed by foreign host.

1 /tmp
mcurry at strawhat #
-------------- next part --------------
A non-text attachment was scrubbed...
Name: README-typos.diff
Type: application/octet-stream
Size: 2145 bytes
Desc: not available
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20100106/c39ac35a/attachment.diff>


More information about the riak-users mailing list