{"action":"opened","issue":{"url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/issues/549","labels_url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/issues/549/comments","events_url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/issues/549/events","html_url":"https://github.com/thesgc/chembiohub_helpdesk/issues/549","id":109043847,"number":549,"title":"Instructions for reindexing elasticsearch produce an error","user":{"login":"PaulBarrett79","id":1405277,"avatar_url":"https://avatars.githubusercontent.com/u/1405277?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulBarrett79","html_url":"https://github.com/PaulBarrett79","followers_url":"https://api.github.com/users/PaulBarrett79/followers","following_url":"https://api.github.com/users/PaulBarrett79/following{/other_user}","gists_url":"https://api.github.com/users/PaulBarrett79/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulBarrett79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulBarrett79/subscriptions","organizations_url":"https://api.github.com/users/PaulBarrett79/orgs","repos_url":"https://api.github.com/users/PaulBarrett79/repos","events_url":"https://api.github.com/users/PaulBarrett79/events{/privacy}","received_events_url":"https://api.github.com/users/PaulBarrett79/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/labels/app:%20AssayReg","name":"app: AssayReg","color":"ededed"},{"url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/thesgc/chembiohub_helpdesk/labels/Dev%20Specific","name":"Dev Specific","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-30T08:52:48Z","updated_at":"2015-09-30T08:52:48Z","closed_at":null,"body":"Steps:\n\nssh to staging\ngo to the elasticsearch indexes location\ndelete indexes\nrestart elasticsearch\nsudo su chembiohub\nset the correct source\npython manage.py shell\nfrom cbh_datastore_ws.resources import reindex_datapoint_classifications\nreindex_datapoint_classifications()\n\nAfter performing these steps as instructed, an error trace is shown:\n\n189\n---------------------------------------------------------------------------\nKeyError                                  Traceback (most recent call last)\n<ipython-input-2-df700151da9b> in <module>()\n----> 1 reindex_datapoint_classifications()\n\n/var/www/automated_reg_installs/test/chembiohub_ws/src/cbh_datastore_ws/cbh_datastore_ws/resources.pyc in reindex_datapoint_classifications()\n   1256     for chunk in chunked:\n   1257 \n-> 1258         index_filter_dict({\"id__in\": chunk})\n   1259 \n   1260 \n\n/var/www/automated_reg_installs/test/chembiohub_ws/src/cbh_datastore_ws/cbh_datastore_ws/resources.pyc in index_filter_dict(filter_dict)\n   1278     dpcs = res.Meta.queryset.filter(**filter_dict)\n   1279     print dpcs.count()\n-> 1280     bundle.data[\"objects\"] = [res.full_dehydrate(res.build_bundle(obj=dpc, request=request)) for dpc in dpcs]\n   1281     resp = res.create_response(request, bundle)\n   1282     elasticsearch_client.index_datapoint_classification(resp.content, refresh=False)\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/resources.pyc in full_dehydrate(self, bundle, for_list)\n    850                 field_object.resource_name = self._meta.resource_name\n    851 \n--> 852             bundle.data[field_name] = field_object.dehydrate(bundle, for_list=for_list)\n    853 \n    854             # Check for an optional method to do further dehydration.\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate(self, bundle, for_list)\n    730         self.fk_resource = self.get_related_resource(foreign_obj)\n    731         fk_bundle = Bundle(obj=foreign_obj, request=bundle.request)\n--> 732         return self.dehydrate_related(fk_bundle, self.fk_resource, for_list=for_list)\n    733 \n    734     def hydrate(self, bundle):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate_related(self, bundle, related_resource, for_list)\n    568                 objects_saved=bundle.objects_saved\n    569             )\n--> 570             return related_resource.full_dehydrate(bundle)\n    571 \n    572     def resource_from_uri(self, fk_resource, uri, request=None, related_obj=None, related_name=None):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/resources.pyc in full_dehydrate(self, bundle, for_list)\n    850                 field_object.resource_name = self._meta.resource_name\n    851 \n--> 852             bundle.data[field_name] = field_object.dehydrate(bundle, for_list=for_list)\n    853 \n    854             # Check for an optional method to do further dehydration.\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate(self, bundle, for_list)\n    730         self.fk_resource = self.get_related_resource(foreign_obj)\n    731         fk_bundle = Bundle(obj=foreign_obj, request=bundle.request)\n--> 732         return self.dehydrate_related(fk_bundle, self.fk_resource, for_list=for_list)\n    733 \n    734     def hydrate(self, bundle):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate_related(self, bundle, related_resource, for_list)\n    568                 objects_saved=bundle.objects_saved\n    569             )\n--> 570             return related_resource.full_dehydrate(bundle)\n    571 \n    572     def resource_from_uri(self, fk_resource, uri, request=None, related_obj=None, related_name=None):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/resources.pyc in full_dehydrate(self, bundle, for_list)\n    850                 field_object.resource_name = self._meta.resource_name\n    851 \n--> 852             bundle.data[field_name] = field_object.dehydrate(bundle, for_list=for_list)\n    853 \n    854             # Check for an optional method to do further dehydration.\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate(self, bundle, for_list)\n    821             m2m_bundle = Bundle(obj=m2m, request=bundle.request)\n    822             self.m2m_resources.append(m2m_resource)\n--> 823             m2m_dehydrated.append(self.dehydrate_related(m2m_bundle, m2m_resource, for_list=for_list))\n    824 \n    825         return m2m_dehydrated\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate_related(self, bundle, related_resource, for_list)\n    568                 objects_saved=bundle.objects_saved\n    569             )\n--> 570             return related_resource.full_dehydrate(bundle)\n    571 \n    572     def resource_from_uri(self, fk_resource, uri, request=None, related_obj=None, related_name=None):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/resources.pyc in full_dehydrate(self, bundle, for_list)\n    850                 field_object.resource_name = self._meta.resource_name\n    851 \n--> 852             bundle.data[field_name] = field_object.dehydrate(bundle, for_list=for_list)\n    853 \n    854             # Check for an optional method to do further dehydration.\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate(self, bundle, for_list)\n    730         self.fk_resource = self.get_related_resource(foreign_obj)\n    731         fk_bundle = Bundle(obj=foreign_obj, request=bundle.request)\n--> 732         return self.dehydrate_related(fk_bundle, self.fk_resource, for_list=for_list)\n    733 \n    734     def hydrate(self, bundle):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/fields.pyc in dehydrate_related(self, bundle, related_resource, for_list)\n    568                 objects_saved=bundle.objects_saved\n    569             )\n--> 570             return related_resource.full_dehydrate(bundle)\n    571 \n    572     def resource_from_uri(self, fk_resource, uri, request=None, related_obj=None, related_name=None):\n\n/home/chembiohub/anaconda/envs/test/lib/python2.7/site-packages/django_tastypie-0.12.0-py2.7.egg/tastypie/resources.pyc in full_dehydrate(self, bundle, for_list)\n    856 \n    857             if method:\n--> 858                 bundle.data[field_name] = method(bundle)\n    859 \n    860         bundle = self.dehydrate(bundle)\n\n/var/www/automated_reg_installs/test/chembiohub_ws/src/cbh_datastore_ws/cbh_datastore_ws/resources.pyc in dehydrate_edit_form(self, bundle)\n    282     def dehydrate_edit_form(self, bundle):\n    283         '''          '''\n--> 284         return {\"form\" : [self.get_field_values(bundle)[1]]}\n    285 \n    286     def dehydrate_edit_schema(self, bundle):\n\n/var/www/automated_reg_installs/test/chembiohub_ws/src/cbh_datastore_ws/cbh_datastore_ws/resources.pyc in get_field_values(self, bundle)\n    220     def get_field_values(self,  bundle):\n    221         obj = bundle.obj\n--> 222         data =  deepcopy(obj.FIELD_TYPE_CHOICES[obj.field_type][\"data\"])\n    223 \n    224         data[\"title\"] = obj.name\n\nKeyError: u'related'\n\n\nThese instructions should rebuild elasticsearch indexes without issue"}}