Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 启用riak搜索的存储桶中的崩溃(riak\u搜索\u kv\u挂钩、预提交、错误)_Python_Riak - Fatal编程技术网

Python 启用riak搜索的存储桶中的崩溃(riak\u搜索\u kv\u挂钩、预提交、错误)

Python 启用riak搜索的存储桶中的崩溃(riak\u搜索\u kv\u挂钩、预提交、错误),python,riak,Python,Riak,我有一个启用搜索的riak桶。大多数情况下,它似乎工作得相当好,但对于某些资源来说,它现在失败了。我看不出失败的资源有什么特别之处 我得到了一个真正的例外: >>> key = '/data/v2/search_show/TMS.Person.1485' >>> item = b.get(key) >>> item.get_data() {u'type': u'person', u'expires': u'9999999999', u'sub

我有一个启用搜索的riak桶。大多数情况下,它似乎工作得相当好,但对于某些资源来说,它现在失败了。我看不出失败的资源有什么特别之处

我得到了一个真正的例外:

>>> key = '/data/v2/search_show/TMS.Person.1485'
>>> item = b.get(key)
>>> item.get_data()
{u'type': u'person', u'expires': u'9999999999', u'subject_name': u'Paul Rodriguez', u'sub_type': u'__None__', u'topic': u'__ref--/data/v2/topic/TMS.Person.1485:r1382637028.194730', u'person': u'__None__', u'searchable_key': u'rodriguez paulrodriguez paul', u'date': u'0000-00-00', u'sport': u'__None__', u'genre': u'__None__', u'id': u'/data/v2/search_show/TMS.Person.1485'}
>>> item.get_siblings()
[]
>>> item.store()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py", line 438, in store
    if_none_match=if_none_match)
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http.py", line 173, in put
    key=robj.get_key())
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http.py", line 182, in do_put
    return self.parse_body(response, [200, 201, 300])
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http.py", line 383, in parse_body
    self.check_http_code(response, expected_statuses)
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http.py", line 369, in check_http_code
    (expected_statuses, status, response[1]))
Exception: Expected status [200, 201, 300], received 500 : <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,badarg,
        [{erlang,iolist_to_binary,
             [{hook_crashed,
                  {riak_search_kv_hook,precommit,error,
                      {badmatch,
                          [{{dict,3,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],
                                  [[<<"X-Riak-VTag">>,51,57,117,77,117,89,54,
                                    81,83,81,89,67,98,52,84,80,86,50,99,115,
                                    55,116]],
                                  [[<<"index">>]],
                                  [],
                                  [[<<"X-Riak-Last-Modified">>|
                                    {1382,637028,329550}]],
                                  [],[]}}},
                            {riak_idx_doc,<<"ctv_tvdata">>,
                                <<"/data/v2/search_show/TMS.Person.1485">>,
                                [{<<"date">>,<<"0000-00-00">>,
                                  [{<<"0000-00-00">>,[0]}]},
                                 {<<"expires">>,<<"9999999999">>,
                                  [{<<"9999999999">>,[0]}]},
                                 {<<"genre">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"id">>,
                                  <<"/data/v2/search_show/TMS.Person.1485">>,
                                  [{<<"/data/v2/search_show/TMS.Person.1485">>,
                                    [0]}]},
                                 {<<"person">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"searchable_key">>,
                                  <<"rodriguez paulrodriguez paul">>,
                                  [{<<"paulrodriguez">>,[1]},
                                   {<<"paul">>,[2]},
                                   {<<"rodriguez">>,[0]}]},
                                 {<<"sport">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"sub_type">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"subject_name">>,<<"Paul Rodriguez">>,
                                  [{<<"Paul">>,[0]},{<<"Rodriguez">>,[1]}]},
                                 {<<"topic">>,
                                  <<"__ref--/data/v2/topic/TMS.Person.1485:r1382637028.194730">>,
                                  [{<<"__ref--/data/v2/topic/TMS.Person.1485:r1382637028.194730">>,
                                    [0]}]},
                                 {<<"type">>,<<"person">>,
                                  [{<<"person">>,[0]}]}],
                                [],
                                [{<<"expires">>,<<"9999999999">>,
                                  [<<"9999999999">>]},
                                 {<<"type">>,<<"person">>,[<<"person">>]}],
                                true}},
                           {{dict,3,16,16,8,80,48,
                                {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 []},
                                {{[],[],[],[],[],[],[],[],[],[],
                                  [[<<"X-Riak-VTag">>,113,51,102,55,90,82,113,
                                    56,73,51,90,69,116,53,115,68,51,49,52,75,
                                    115]],
                                  [[<<"index">>]],
                                  [],
                                  [[<<"X-Riak-Last-Modified">>|
                                    {1382,637028,329664}]],
                                  [],[]}}},
                            {riak_idx_doc,<<"ctv_tvdata">>,
                                <<"/data/v2/search_show/TMS.Person.1485">>,
                                [{<<"date">>,<<"0000-00-00">>,
                                  [{<<"0000-00-00">>,[0]}]},
                                 {<<"expires">>,<<"9999999999">>,
                                  [{<<"9999999999">>,[0]}]},
                                 {<<"genre">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"id">>,
                                  <<"/data/v2/search_show/TMS.Person.1485">>,
                                  [{<<"/data/v2/search_show/TMS.Person.1485">>,
                                    [0]}]},
                                 {<<"person">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"searchable_key">>,
                                  <<"rodriguez paulrodriguez paul">>,
                                  [{<<"paulrodriguez">>,[1]},
                                   {<<"paul">>,[2]},
                                   {<<"rodriguez">>,[0]}]},
                                 {<<"sport">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"sub_type">>,<<"__None__">>,
                                  [{<<"__None__">>,[0]}]},
                                 {<<"subject_name">>,<<"Paul Rodriguez">>,
                                  [{<<"Paul">>,[0]},{<<"Rodriguez">>,[1]}]},
                                 {<<"topic">>,
                                  <<"__ref--/data/v2/topic/TMS.Person.1485:r1382637028.194730">>,
                                  [{<<"__ref--/data/v2/topic/TMS.Person.1485:r1382637028.194730">>,
                                    [0]}]},
                                 {<<"type">>,<<"person">>,
                                  [{<<"person">>,[0]}]}],
                                [],
                                [{<<"expires">>,<<"9999999999">>,
                                  [<<"9999999999">>]},
                                 {<<"type">>,<<"person">>,[<<"person">>]}],
                                true}}]}}}],
             []},
         {wrq,append_to_response_body,2,[{file,"src/wrq.erl"},{line,210}]},
         {riak_kv_wm_object,handle_common_error,3,
             [{file,"src/riak_kv_wm_object.erl"},{line,1046}]},
         {webmachine_resource,resource_call,3,
             [{file,"src/webmachine_resource.erl"},{line,186}]},
         {webmachine_resource,do,3,
             [{file,"src/webmachine_resource.erl"},{line,142}]},
         {webmachine_decision_core,resource_call,1,
             [{file,"src/webmachine_decision_core.erl"},{line,48}]},
         {webmachine_decision_core,accept_helper,1,
             [{file,"src/webmachine_decision_core.erl"},{line,615}]},
         {webmachine_decision_core,decision,1,
             [{file,"src/webmachine_decision_core.erl"},{line,518}]}]}}</pre><P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></body></html>
>>key='/data/v2/search\u show/TMS.Person.1485'
>>>item=b.get(键)
>>>item.get_data()
“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u“u”类型:u”类型:u“u”类型:u“u”类型:u“u”类型:u”类型:u“u”类型:u“u“u”u”类型:u“u”类型:u”u“u“u”u”类型:u“u“u”u”u“u“u”u”u”u“u”u“u“u”u“u“u“u”u”u“u”u“无任何人无任何人”,u”无任何人”,u“u“u”无任何人”,u“u“u“u“u“u“u”无任何人”,u”,u“u“u“u“u”u烧焦CHU show/TMS.Person.1485'}
>>>item.get_兄弟姐妹()
[]
>>>item.store()
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/usr/local/lib/python2.7/dist packages/riak/riak_object.py”,第438行,存储中
if_none_match=if_none_match)
文件“/usr/local/lib/python2.7/dist packages/riak/transports/http.py”,第173行,输入
key=robj.get_key())
文件“/usr/local/lib/python2.7/dist packages/riak/transports/http.py”,第182行,在do_put中
返回self.parse_body(响应[200201300])
parse_body中的文件“/usr/local/lib/python2.7/dist packages/riak/transports/http.py”,第383行
自检\u http\u代码(响应、预期\u状态)
文件“/usr/local/lib/python2.7/dist packages/riak/transports/http.py”,第369行,在check\u http\u代码中
(预期的_状态、状态、响应[1]))
异常:预期状态[200201300],收到500:500内部服务器错误内部服务器错误服务器在处理此请求时遇到错误:
{error,
#The bucket had allow_mult set to true:
$ curl 'http://10.1.2.95:8098/buckets/_rsid_ctv_tvdata/props'
{"props": "name":"_rsid_ctv_tvdata","allow_mult":true,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dw":0,"last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"notfound_ok":false,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":1,"rw":1,"small_vclock":50,"w":1,"young_vclock":20}}

#I fixed it in the python console since that is where I'm more comfortable.  And just to be sure I attempted the same riak PUT both before and after.

>>> import riak
>>> r = riak.RiakClient()
>>> b = r.bucket('ctv_tvdata')
>>> o = b.get('/data/v2/search_show/TMS.Show.9838380')
>>> o.store()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py", line 281, in store
timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line 127, in wrapper
    return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line 69, in _with_retries
return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line 125, in thunk
return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py", line 289, in put
timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http/transport.py", line 144, in put
return self._parse_body(robj, response, [200, 201, 204, 300])
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http/codec.py", line 64, in _parse_body
self.check_http_code(status, expected_statuses)
  File "/usr/local/lib/python2.7/dist-packages/riak/transports/http/transport.py", line 446, in check_http_code
    (expected_statuses, status))
Exception: Expected status [200, 201, 204, 300], received 500
>>> b2 = r.bucket('_rsid_ctv_tvdata')
>>> b2.get_properties()
{'old_vclock': 86400, 'pr': 0, 'allow_mult': True, 'big_vclock': 50, 'name': '_rsid_ctv_tvdata', 'chash_keyfun': {'fun': 'chash_std_keyfun', 'mod': 'riak_core_util'}, 'n_val': 3, 'notfound_ok': False, 'linkfun': {'fun': 'mapreduce_linkfun', 'mod': 'riak_kv_wm_link_walker'}, 'pw': 0, 'last_write_wins': False, 'r': 1, 'small_vclock': 50, 'rw': 1, 'basic_quorum': False, 'postcommit': [], 'dw': 0, 'w': 1, 'young_vclock': 20, 'precommit': []}
>>> b2.set_property('allow_mult', False)
>>> o = b.get('/data/v2/search_show/TMS.Show.9838380')
>>> o.store()
<riak.riak_object.RiakObject object at 0x250ca10>
{错误,巴达格, [{erlang,iolist_to_binary, [hook_崩溃, {riak_search_kv_hook,预提交,错误, {糟糕的比赛, [dict,3,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[], [[,51,57,117,77,117,89,54, 81,83,81,89,67,98,52,84,80,86,50,99,115, 55,116]], [[]], [], [[| {1382,637028,329550}]], [],[]}}}, {riak_idx_doc,, , [{,, [{,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]}]}, {, , [{, [0]}]}, {,, [{,[0]}]}, {, , [{,[1]}, {,[2]}, {,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]},{,[1]}]}, {, , [{, [0]}]}, {,, [{,[0]}]}], [], [{,, []}, {,,[]}], 真的}}, {{dict,3,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[], [[,113,51,102,55,90,82,113, 56,73,51,90,69,116,53,115,68,51,49,52,75, 115]], [[]], [], [[| {1382,637028,329664}]], [],[]}}}, {riak_idx_doc,, , [{,, [{,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]}]}, {, , [{, [0]}]}, {,, [{,[0]}]}, {, , [{,[1]}, {,[2]}, {,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]}]}, {,, [{,[0]},{,[1]}]}, {, , [{, [0]}]}, {,, [{,[0]}]}], [], [{,,