Limitations on keys

Jay Doane jay at
Fri Sep 4 14:19:38 EDT 2009


My application needs to use URLs as keys, but I'm forced to quote them  
for it to work, as demonstrated below.

 >>> import jiak
 >>> jc = jiak.JiakClient('localhost', 8098)
 >>> jc.set_bucket_schema('test', [])
 >>> jc.list_bucket('test')
{u'keys': [],
  u'schema': {u'allowed_fields': [],
              u'read_mask': [],
              u'required_fields': [],
              u'write_mask': []}}
 >>> jo = jiak.JiakObject('test', '')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Users/jay/Library/Python/2.6/site-packages/", line  
94, in store
     {"Content-Type": "application/json"}))
   File "/Users/jay/Library/Python/2.6/site-packages/", line  
69, in _expect
     raise JiakException(Resp.status, Resp.reason,
jiak.JiakException: (405, 'Method Not Allowed', '')
 >>> jo = jiak.JiakObject('test', urllib.quote_plus('http://'))
 >>> jc.fetch('test', urllib.quote_plus('')).key

The problem seems to occur because the key is simply appended to the  
JSON request, implying that any key containing characters with special  
meaning to a request may also fail to work.

My naive approach would be to quote the keys (and buckets as well?) in  
the client and unquote them at the server so the actual values would  
not change.  Is this a change the riak developers would accept, or is  
there a better approach?  Or are keys just limited by design (I hope  


More information about the riak-users mailing list