aparo / pyes

Python connector for ElasticSearch - the pythonic way to use ElasticSearch
BSD 3-Clause "New" or "Revised" License
607 stars 270 forks source link

No handlers could be found for logger "pyes" Exception ReferenceError: 'weakly-referenced object no longer exists' in <bound method ES.__del__ of <pyes.es.ES object at 0x7fadda8638d0>> ignored #517

Open OPSTime opened 7 years ago

OPSTime commented 7 years ago

ENV:

Python 2.7.5 pyes (0.99.6) elasticsearch-2.4.4

script:

!/bin/env python

import pyes

conn = pyes.es.ES("http://xxx.xxx.xxx.xxx:9200/",basic_auth={"username":"username","password":"password"}) search = pyes.query.MatchAllQuery().search(bulk_read=1000) hits = conn.search(search, 'logstash-nginxlog2017-07-14', scan=True, scroll="90m", model=lambda ,hit: hit) for hit in hits: hit['_source']['cmd'] = int(hit['_source']['status'])

print hit['_source']

 conn.index(hit['_source'], 'logstash-nginxlog_2017-07-14_new', 'bullet-chat', hit['_id'], bulk=True)

Error output:

No handlers could be found for logger "pyes" Exception ReferenceError: 'weakly-referenced object no longer exists' in <bound method ES.del of <pyes.es.ES object at 0x7fadda8638d0>> ignored

result:

logstash-nginxlog_2017-07-14 doc:64000034 logstash-nginxlog_2017-07-14_new doc:6400000