baidu / AnyQ

FAQ-based Question Answering System
Apache License 2.0
2.59k stars 672 forks source link

solr error #145

Open Elliebababa opened 5 years ago

Elliebababa commented 5 years ago

Hi, I come across the following problem when running this: $ sh solr_script/anyq_solr.sh solr_script/sample_docs

faq-file trans done nohup: appending output to ‘nohup.out’ solr[8900] start success! [{'indexed': True, 'stored': True, 'type': 'text_multi_lang', 'name': 'question'}, {'indexed': False, 'stored': True, 'type': 'string', 'name': 'answer'}] Traceback (most recent call last): File "solr_script/solr_api.py", line 24, in solr_tools.set_engine_schema(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 117, in set_engine_schema _get_error_message(err.read()) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 53, in _get_error_message respond_dict = json.loads(respond_str.strip()) File "/usr/lib64/python2.7/json/init.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded Traceback (most recent call last): File "solr_script/solr_api.py", line 30, in solr_tools.clear_documents(sys.argv[2], sys.argv[3], sys.argv[4]) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 219, in clear_documents _get_error_message(err.read()) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 53, in _get_error_message respond_dict = json.loads(respond_str.strip()) File "/usr/lib64/python2.7/json/init.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 765, in run self.target(*self.args, **self.__kwargs) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 140, in thread_upload _get_error_message(err.read()) File "/web/workspace/huangyufen/AnyQ/build/solr_script/solr_tools.py", line 53, in _get_error_message respond_dict = json.loads(respond_str.strip()) File "/usr/lib64/python2.7/json/init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

could you please tell me how to solve it?

zpc1995 commented 5 years ago

i think the solr is not run success. you can add the code at solr_tools.py

def _get_error_message(respond_str): """ Extract error information """ print(respond_str) respond_dict = json.loads(respond_str.strip()) errmsg = respond_dict.get('error', dict()).get('msg', '') print _make_smart_hint(HINT_TYPE_REQ_ERR, errmsg)

maybe you will see the respond_str is not a json string(404 errer page) so maybe you can find something in nohup.out.

zhangyanbo2007 commented 5 years ago

一起讨论下anyQ,15821444815加我微信吧!

WelcomeLi commented 5 years ago

hi, I met the same problem, have you solved it?

yinweichong commented 5 years ago

检查下(1)solr是否启动成功,"ps f -ef | grep solr" (2) 是否满足jdk>=1.8

ljcnh commented 3 years ago

I encountered the same problem as you. How did you solve it in the end?