http 400 while addings links(and python client bug)

Alexander Sicular siculars at gmail.com
Sun Apr 25 11:48:55 EDT 2010


Ther is no similar limitation in protobuffs, is there?


@siculars on twitter
http://siculars.posterous.com

Sent from my iPhone

On Apr 25, 2010, at 9:40, Sean Cribbs <sean at basho.com> wrote:

> Alexander,
>
> The solution is to send multiple instances of the same header, which  
> is valid HTTP.  Split your  long headers (I'm guessing "Link"?) into  
> < 8K chunks.
>
> Sean Cribbs <sean at basho.com>
> Developer Advocate
> Basho Technologies, Inc.
> http://basho.com/
>
> On Apr 25, 2010, at 6:28 AM, alexander krohn wrote:
>
>> hi.
>>
>> sorry for replying myself ;)
>>
>> the header hits the 8k size mark, that causes the 400.
>>
>> is there a way to configure the max header length for the rest  
>> api's http server? like apache's LimitRequestFieldsize?
>>
>> also there's a bug in the python client lib, the links are qouted  
>> but not unquoted. this leads to "growing" and wrong tag names.
>>
>> patch for __init__.py:
>>
>> 1650c1650,1653
>> <                                 link = RiakLink(matches.group(2),  
>> matches.group(3), matches.group(4))
>> ---
>>>                                bucket = urllib.unquote_plus 
>>> (matches.group(2))
>>>                                key = urllib.unquote_plus 
>>> (matches.group(3))
>>>                                tag = urllib.unquote_plus 
>>> (matches.group(4))
>>>                                link = RiakLink(bucket, key, tag)
>>
>>
>> cheers,
>>
>> alexander
>>
>> alexander krohn wrote:
>>> hi.
>>> (i already posted this yesterday in irc, mailing-list subscribe  
>>> was pending)
>>> i'm using python to insert several items to riak. the code i'm  
>>> using[1] receives an http 400 exactly while inserting the 238th  
>>> link to an object.
>>> the response tells no additional errors, also the erlang-log  
>>> doesn't show anything.
>>> something wrong on my side or bug?
>>> can anyone reproduce this 400?
>>> thanks in advance.
>>> cheers,
>>> alexander
>>> [1] used code:
>>> import riak
>>> client = riak.RiakClient('127.0.0.1',
>>>                        8098,
>>>                        transport_class=riak.RiakHttpTransport)
>>> print "client alive: ", client.is_alive()
>>> bucket = client.bucket('t1')
>>> a = bucket.new('a', (1, 2, 3))
>>> for i in range(1000):
>>>   x = bucket.new('x_%i' % i, i)
>>>   x.store()
>>>   print "stored", i + 1, "items"
>>>   a.add_link(x, 'dings').store()
>>>   print "stored", i + 1, "links"
>>> _______________________________________________
>>> riak-users mailing list
>>> riak-users at lists.basho.com
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users at lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



More information about the riak-users mailing list