Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Aldryn Haystack: Error updating aldryn_people #141

Open
macolo opened this issue Jul 14, 2016 · 2 comments
Open

Aldryn Haystack: Error updating aldryn_people #141

macolo opened this issue Jul 14, 2016 · 2 comments

Comments

@macolo
Copy link

macolo commented Jul 14, 2016

it seems there is an incompatibility with django-haystack using the elastic search beta on Aldryn:

When I run ./manage.py rebuild_index on the docker container (with the production env vars set in .env-local). I am using Aldryn with Docker for Mac.

I run django-parler version: 1.6.5

POST https://search-aldryn-whatdigital-es-7tayzqk3v7g44dz7avjkq5kfje.eu-central-1.es.amazonaws.com:443/local_en/_refresh [status:200 request:0.053s]
Indexing 29 People
Error updating aldryn_people using de 
Traceback (most recent call last):
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 188, in handle_label
    self.update_backend(label, using)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 233, in update_backend
    do_update(backend, index, qs, start, end, total, verbosity=self.verbosity, commit=self.commit)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 96, in do_update
    backend.update(index, current_qs, commit=commit)
  File "/virtualenv/lib/python3.5/site-packages/haystack/backends/elasticsearch_backend.py", line 166, in update
    prepped_data = index.full_prepare(obj)
  File "/virtualenv/lib/python3.5/site-packages/haystack/indexes.py", line 212, in full_prepare
    self.prepared_data = self.prepare(obj)
  File "/virtualenv/lib/python3.5/site-packages/aldryn_search/base.py", line 42, in prepare
    self.prepared_data['text'] = self.get_search_data(obj, current_language, request)
  File "/virtualenv/lib/python3.5/site-packages/aldryn_people/search_indexes.py", line 34, in get_search_data
    return strip_tags(self.get_description(obj)).strip()
  File "/virtualenv/lib/python3.5/site-packages/aldryn_people/search_indexes.py", line 21, in get_description
    return obj.description
  File "/virtualenv/lib/python3.5/site-packages/parler/fields.py", line 92, in __get__
    translation = instance._get_translated_model(use_fallback=True, meta=meta)
  File "/virtualenv/lib/python3.5/site-packages/parler/models.py", line 471, in _get_translated_model
    lang_dict = get_language_settings(language_code)
  File "/virtualenv/lib/python3.5/site-packages/parler/utils/i18n.py", line 80, in get_language_settings
    return appsettings.PARLER_LANGUAGES.get_language(language_code, site_id)
  File "/virtualenv/lib/python3.5/site-packages/parler/utils/conf.py", line 114, in get_language
    if lang_dict['code'].split('-')[0] == language_code.split('-')[0]:
AttributeError: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "manage.py", line 7, in <module>
    startup.manage(path=os.path.dirname(os.path.abspath(__file__)))
  File "/virtualenv/lib/python3.5/site-packages/aldryn_django/startup.py", line 11, in manage
    utility.execute()
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/rebuild_index.py", line 26, in handle
    call_command('update_index', **options)
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 183, in handle
    return super(Command, self).handle(*items, **options)
  File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 623, in handle
    label_output = self.handle_label(label, **options)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 188, in handle_label
    self.update_backend(label, using)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 233, in update_backend
    do_update(backend, index, qs, start, end, total, verbosity=self.verbosity, commit=self.commit)
  File "/virtualenv/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 96, in do_update
    backend.update(index, current_qs, commit=commit)
  File "/virtualenv/lib/python3.5/site-packages/haystack/backends/elasticsearch_backend.py", line 166, in update
    prepped_data = index.full_prepare(obj)
  File "/virtualenv/lib/python3.5/site-packages/haystack/indexes.py", line 212, in full_prepare
    self.prepared_data = self.prepare(obj)
  File "/virtualenv/lib/python3.5/site-packages/aldryn_search/base.py", line 42, in prepare
    self.prepared_data['text'] = self.get_search_data(obj, current_language, request)
  File "/virtualenv/lib/python3.5/site-packages/aldryn_people/search_indexes.py", line 34, in get_search_data
    return strip_tags(self.get_description(obj)).strip()
  File "/virtualenv/lib/python3.5/site-packages/aldryn_people/search_indexes.py", line 21, in get_description
    return obj.description
  File "/virtualenv/lib/python3.5/site-packages/parler/fields.py", line 92, in __get__
    translation = instance._get_translated_model(use_fallback=True, meta=meta)
  File "/virtualenv/lib/python3.5/site-packages/parler/models.py", line 471, in _get_translated_model
    lang_dict = get_language_settings(language_code)
  File "/virtualenv/lib/python3.5/site-packages/parler/utils/i18n.py", line 80, in get_language_settings
    return appsettings.PARLER_LANGUAGES.get_language(language_code, site_id)
  File "/virtualenv/lib/python3.5/site-packages/parler/utils/conf.py", line 114, in get_language
    if lang_dict['code'].split('-')[0] == language_code.split('-')[0]:
AttributeError: 'NoneType' object has no attribute 'split'
@politoxela
Copy link

Has this incident been fixed? I have the same error when I run./manage.py rebuild_index

@tehfink
Copy link

tehfink commented Oct 9, 2018

@politoxela & @macolo Here's a workaround:
divio/aldryn-search#70 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants