Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack trace on deleting index not in database #57

Open
codekiln opened this issue Nov 18, 2018 · 0 comments
Open

stack trace on deleting index not in database #57

codekiln opened this issue Nov 18, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@codekiln
Copy link
Contributor

codekiln commented Nov 18, 2018

In 0.8.0, if there is an index only-in-es created in elasticsearch that doesn't exist in the database, it can be listed with ./manage.py es_list --es-only. In theory, ./manage.py es_drop only-in-es --exact should delete it, however, this currently errors out:

$ ./manage.py es_drop test_localdev_movies-1 --exact
[2018-11-18 01:03:48.353449]: While completing drop_index, encountered exception: 
 - message: 'NoneType' object has no attribute 'is_active' 
 - exception doc: Attribute not found. 
 - exception stack: Traceback (most recent call last):
  File "/Users/pnore/hbx/django-elastic-migrations/django_elastic_migrations/models.py", line 312, in start_action
    result = self.perform_action(dem_index, *args, **kwargs)
  File "/Users/pnore/hbx/django-elastic-migrations/django_elastic_migrations/models.py", line 726, in perform_action
    if self.index_version.is_active and not self.force:
AttributeError: 'NoneType' object has no attribute 'is_active'

Looking deeper, it seems as though the dem_index that is received in the drop index action doesn't have access to the full, exact name provided:

> dem_index.get_es_index_name()
None

This is a bug. A test should be written for this scenario and it should be fixed.

@codekiln codekiln added the bug Something isn't working label Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant