500 Internal Server Error when performing link walking

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

500 Internal Server Error when performing link walking

Ivaylo Panitchkov

Hi guys,

I'm playing with the examples on
http://blog.basho.com/2010/02/24/link-walking-by-example/ and just
realized that the following request

http://192.168.1.69:8098/riak/hb/first/_,_,1/_,_,0

breaks my riak server with

<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,{error,{badmatch,{[{'_','_',false}],[]}},
               [{riak_kv_wm_link_walker,execute_query,3},
                {riak_kv_wm_link_walker,to_multipart_mixed,2},
                {webmachine_resource,resource_call,3},
                {webmachine_resource,do,3},
                {webmachine_decision_core,resource_call,1},
                {webmachine_decision_core,decision,1},
                {webmachine_decision_core,handle_request,2},
               
{webmachine_mochiweb,loop,1}]}}</pre><P><HR><ADDRESS>mochiweb+webmachine
web server</ADDRESS></body></html>

I'm running riak_1.0.0rc1-1_i386 on Linux UBUNTU 2.6.35-30-generic-pae
#59-Ubuntu SMP Tue Aug 30 16:16:14 UTC 2011 i686 GNU/Linux

Regards,
Ivaylo

--
Ivaylo Panitchkov
Software developer
Hibernum Creations Inc.


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: 500 Internal Server Error when performing link walking

bryan-basho
Administrator
On Tue, Sep 27, 2011 at 10:51 AM, Ivaylo Panitchkov
<[hidden email]> wrote:
> http://192.168.1.69:8098/riak/hb/first/_,_,1/_,_,0

Hi, Ivaylo.  What Riak is trying to tell you (though it's being rather
obtuse about it) is that the query you sent doesn't make sense to it.
The problem is that '0' on the final link step.  The link walker
resource doesn't know why that query would be sent, because it's doing
extra work for nothing.

That is, asking for keep=false (_,_,0) on the last phase would cause
riak to traverse those links, but then do nothing with the results it
found.  This wasn't an expected use case, so it ends in error.  I've
filed a bug to make this error more friendly:

https://issues.basho.com/show_bug.cgi?id=1223

If you really do want only the objects found in the first step of the
walk, chop off the second step:

   http://192.168.1.69:8098/riak/hb/first/_,_,1

If you want the object from the final step as well, set that keep to
either 1 or _:

   http://192.168.1.69:8098/riak/hb/first/_,_,1/_,_,1

-Bryan

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: 500 Internal Server Error when performing link walking

Ivaylo Panitchkov

Hi Bryan,

I know the request we are talking about doesn't have any sense but in a
theory could be performed.
The server should not respond with 500 and it's not even mentioned on
http://wiki.basho.com/HTTP-Link-Walking.html.
Also if you run curl http://192.168.1.69:8098/riak/hb/first/_,_,0 the
result is the same as if you put 1 (return result from this phase).
My own opinion is that you should return 400 (Bad request) if keep = 0
in the final phase or something that explains the case.
You rock guys. Riak is so amazing. Already deployed few apps with it
handling millions of records.

Regards,
Ivaylo



On 11-09-27 01:14 PM, Bryan Fink wrote:

> On Tue, Sep 27, 2011 at 10:51 AM, Ivaylo Panitchkov
> <[hidden email]>  wrote:
>> http://192.168.1.69:8098/riak/hb/first/_,_,1/_,_,0
> Hi, Ivaylo.  What Riak is trying to tell you (though it's being rather
> obtuse about it) is that the query you sent doesn't make sense to it.
> The problem is that '0' on the final link step.  The link walker
> resource doesn't know why that query would be sent, because it's doing
> extra work for nothing.
>
> That is, asking for keep=false (_,_,0) on the last phase would cause
> riak to traverse those links, but then do nothing with the results it
> found.  This wasn't an expected use case, so it ends in error.  I've
> filed a bug to make this error more friendly:
>
> https://issues.basho.com/show_bug.cgi?id=1223
>
> If you really do want only the objects found in the first step of the
> walk, chop off the second step:
>
>     http://192.168.1.69:8098/riak/hb/first/_,_,1
>
> If you want the object from the final step as well, set that keep to
> either 1 or _:
>
>     http://192.168.1.69:8098/riak/hb/first/_,_,1/_,_,1
>
> -Bryan


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com