fabric8-analytics / fabric8-analytics-worker

fabric8-analytics worker for gathering raw data
GNU General Public License v3.0
8 stars 45 forks source link

[keywords_tagging] LookupError(resource_not_found) #270

Closed jpopelka closed 7 years ago

jpopelka commented 7 years ago

Not sure whether the exception should be catched in worker or tagger:

worker-ingestion_1      | Traceback (most recent call last):
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/corpus/util.py", line 80, in __load
worker-ingestion_1      |     try: root = nltk.data.find('{}/{}'.format(self.subdir, zip_name))
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/data.py", line 653, in find
worker-ingestion_1      |     raise LookupError(resource_not_found)
worker-ingestion_1      | LookupError: 
worker-ingestion_1      | **********************************************************************
worker-ingestion_1      |   Resource 'corpora/wordnet.zip/wordnet/' not found.  Please use
worker-ingestion_1      |   the NLTK Downloader to obtain the resource:  >>> nltk.download()
worker-ingestion_1      |   Searched in:
worker-ingestion_1      |     - '/workdir/nltk_data'
worker-ingestion_1      |     - '/usr/share/nltk_data'
worker-ingestion_1      |     - '/usr/local/share/nltk_data'
worker-ingestion_1      |     - '/usr/lib/nltk_data'
worker-ingestion_1      |     - '/usr/local/lib/nltk_data'
worker-ingestion_1      | **********************************************************************
worker-ingestion_1      | 
worker-ingestion_1      | During handling of the above exception, another exception occurred:
worker-ingestion_1      | 
worker-ingestion_1      | Traceback (most recent call last):
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/celery/app/trace.py", line 367, in trace_task
worker-ingestion_1      |     R = retval = fun(*args, **kwargs)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/celery/app/trace.py", line 622, in __protected_call__
worker-ingestion_1      |     return self.run(*args, **kwargs)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/selinon/selinonTaskEnvelope.py", line 170, in run
worker-ingestion_1      |     raise self.retry(max_retries=0, exc=exc)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/celery/app/task.py", line 668, in retry
worker-ingestion_1      |     raise_with_context(exc)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/selinon/selinonTaskEnvelope.py", line 115, in run
worker-ingestion_1      |     result = task.run(node_args)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_worker/base.py", line 38, in run
worker-ingestion_1      |     result = self.execute(node_args)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_worker/workers/keywords_tagging.py", line 128, in execute
worker-ingestion_1      |     **self._LOOKUP_CONF)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_tagger/recipes.py", line 167, in lookup_text
worker-ingestion_1      |     stemmer)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_tagger/recipes.py", line 38, in _prepare_lookup
worker-ingestion_1      |     chief = KeywordsChief(keywords_file, lemmatizer=lemmatizer_instance, stemmer=stemmer_instance)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_tagger/keywords_chief.py", line 74, in __init__
worker-ingestion_1      |     synonyms = [self._lemmatizer.lemmatize(t) for t in synonyms]
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/f8a_tagger/keywords_chief.py", line 74, in <listcomp>
worker-ingestion_1      |     synonyms = [self._lemmatizer.lemmatize(t) for t in synonyms]
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/stem/wordnet.py", line 40, in lemmatize
worker-ingestion_1      |     lemmas = wordnet._morphy(word, pos)
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/corpus/util.py", line 116, in __getattr__
worker-ingestion_1      |     self.__load()
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/corpus/util.py", line 81, in __load
worker-ingestion_1      |     except LookupError: raise e
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/corpus/util.py", line 78, in __load
worker-ingestion_1      |     root = nltk.data.find('{}/{}'.format(self.subdir, self.__name))
worker-ingestion_1      |   File "/usr/lib/python3.4/site-packages/nltk/data.py", line 653, in find
worker-ingestion_1      |     raise LookupError(resource_not_found)
worker-ingestion_1      | LookupError: 
worker-ingestion_1      | **********************************************************************
worker-ingestion_1      |   Resource 'corpora/wordnet' not found.  Please use the NLTK
worker-ingestion_1      |   Downloader to obtain the resource:  >>> nltk.download()
worker-ingestion_1      |   Searched in:
worker-ingestion_1      |     - '/workdir/nltk_data'
worker-ingestion_1      |     - '/usr/share/nltk_data'
worker-ingestion_1      |     - '/usr/local/share/nltk_data'
worker-ingestion_1      |     - '/usr/lib/nltk_data'
worker-ingestion_1      |     - '/usr/local/lib/nltk_data'
worker-ingestion_1      | **********************************************************************
jpopelka commented 7 years ago

Fixed with #297