{"action":"created","issue":{"url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/715","repository_url":"https://api.github.com/repos/Cadasta/cadasta-platform","labels_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/715/comments","events_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/715/events","html_url":"https://github.com/Cadasta/cadasta-platform/issues/715","id":178575351,"number":715,"title":"Catch jsonattrs KeyError","user":{"login":"oliverroick","id":159510,"avatar_url":"https://avatars.githubusercontent.com/u/159510?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverroick","html_url":"https://github.com/oliverroick","followers_url":"https://api.github.com/users/oliverroick/followers","following_url":"https://api.github.com/users/oliverroick/following{/other_user}","gists_url":"https://api.github.com/users/oliverroick/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverroick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverroick/subscriptions","organizations_url":"https://api.github.com/users/oliverroick/orgs","repos_url":"https://api.github.com/users/oliverroick/repos","events_url":"https://api.github.com/users/oliverroick/events{/privacy}","received_events_url":"https://api.github.com/users/oliverroick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-22T10:40:14Z","updated_at":"2016-09-26T15:54:58Z","closed_at":null,"body":"### Steps to reproduce the error\r\n\r\nThis one is hard to reproduce, maybe @dpalomino can clarify what he did before project broke. \r\n\r\n### Actual behavior\r\n\r\nAn internal server error is returned when accessing the project.\r\n\r\nError log:\r\n\r\n```\r\nInternal Server Error: /organizations/david-org-second-org/projects/jei-testing/\r\n\r\nKeyError at /organizations/david-org-second-org/projects/jei-testing/\r\n'close_railroad_details'\r\n\r\nRequest Method: GET\r\nRequest URL: https://platform-staging-api.cadasta.org/organizations/david-org-second-org/projects/jei-testing/\r\nDjango Version: 1.9.6\r\nPython Executable: /usr/local/bin/uwsgi\r\nPython Version: 3.5.1\r\nPython Path: ['.', '', '/opt/cadasta/env/lib/python3.5', '/opt/cadasta/env/lib/python3.5/plat-x86_64-linux-gnu', '/opt/cadasta/env/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/opt/cadasta/env/lib/python3.5/site-packages']\r\nServer time: Thu, 22 Sep 2016 07:45:42 +0000\r\nInstalled Applications:\r\n('django.contrib.auth',\r\n'django.contrib.contenttypes',\r\n'django.contrib.sessions',\r\n'django.contrib.messages',\r\n'django.contrib.staticfiles',\r\n'django.contrib.sites',\r\n'django.contrib.gis',\r\n'corsheaders',\r\n'core',\r\n'geography',\r\n'accounts',\r\n'organization',\r\n'spatial',\r\n'questionnaires',\r\n'resources',\r\n'buckets',\r\n'party',\r\n'xforms',\r\n'crispy_forms',\r\n'widget_tweaks',\r\n'django_countries',\r\n'leaflet',\r\n'rest_framework',\r\n'rest_framework_gis',\r\n'rest_framework.authtoken',\r\n'rest_framework_docs',\r\n'djoser',\r\n'tutelary',\r\n'allauth',\r\n'allauth.account',\r\n'allauth.socialaccount',\r\n'sass_processor',\r\n'simple_history',\r\n'jsonattrs')\r\nInstalled Middleware:\r\n('corsheaders.middleware.CorsMiddleware',\r\n'django.contrib.sessions.middleware.SessionMiddleware',\r\n'django.middleware.locale.LocaleMiddleware',\r\n'django.middleware.common.CommonMiddleware',\r\n'django.middleware.csrf.CsrfViewMiddleware',\r\n'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\r\n'django.contrib.messages.middleware.MessageMiddleware',\r\n'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n'django.middleware.security.SecurityMiddleware',\r\n'audit_log.middleware.UserLoggingMiddleware',\r\n'simple_history.middleware.HistoryRequestMiddleware')\r\n\r\n\r\nTraceback:  \r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/core/handlers/base.py\" in get_response\r\n 149.                     response = self.process_exception_by_middleware(e, request)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/core/handlers/base.py\" in get_response\r\n 147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/views/generic/base.py\" in view\r\n 68.             return self.dispatch(request, *args, **kwargs)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/tutelary/mixins.py\" in dispatch\r\n 108.         return super().dispatch(request, *args, **kwargs)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/views/generic/base.py\" in dispatch\r\n 88.         return handler(request, *args, **kwargs)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/views/generic/detail.py\" in get\r\n 118.         context = self.get_context_data(object=self.object)\r\n\r\nFile \"./organization/views/default.py\" in get_context_data\r\n 372.                 self.object.spatial_units.all(), many=True).data\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/rest_framework_gis/serializers.py\" in data\r\n 20.         return super(ListSerializer, self).data\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/rest_framework/serializers.py\" in data\r\n 239.                 self._data = self.to_representation(self.instance)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/rest_framework_gis/serializers.py\" in to_representation\r\n 28.             (\"features\", super(GeoFeatureModelListSerializer, self).to_representation(data))\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/rest_framework/serializers.py\" in to_representation\r\n 614.             self.child.to_representation(item) for item in iterable\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/db/models/query.py\" in __iter__\r\n 258.         self._fetch_all()\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/db/models/query.py\" in _fetch_all\r\n 1074.             self._result_cache = list(self.iterator())\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/db/models/query.py\" in __iter__\r\n 69.             obj = model_cls.from_db(db, init_list, row[model_fields_start:model_fields_end])\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/db/models/base.py\" in from_db\r\n 460.             new = cls(*values)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/db/models/base.py\" in __init__\r\n 453.         signals.post_init.send(sender=self.__class__, instance=self)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/django/dispatch/dispatcher.py\" in send\r\n 192.             response = receiver(signal=self, sender=sender, **named)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/jsonattrs/decorators.py\" in fixup_instance\r\n 21.             fld.setup_from_dict(fi)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/jsonattrs/fields.py\" in setup_from_dict\r\n 30.                 self._check_key(k)\r\n\r\nFile \"/opt/cadasta/env/lib/python3.5/site-packages/jsonattrs/fields.py\" in _check_key\r\n 113.             raise KeyError(key)\r\n\r\nException Type: KeyError at /organizations/david-org-second-org/projects/jei-testing/\r\nException Value: 'close_railroad_details'\r\nRequest information:\r\nGET: No GET data\r\n\r\nPOST: No POST data\r\n\r\nFILES: No FILES data\r\n\r\nCOOKIES: No cookie data\r\n\r\nMETA:\r\nREQUEST_SCHEME = 'https'\r\nwsgi.version = \r\nREMOTE_ADDR = '66.249.79.46'\r\nuwsgi.node = b'ip-10-0-0-92'\r\nCONTENT_LENGTH = ''\r\nwsgi.errors = <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'>\r\nREQUEST_URI = '/organizations/david-org-second-org/projects/jei-testing/'\r\nHTTP_USER_AGENT = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'\r\nHTTPS = 'on'\r\nQUERY_STRING = ''\r\nPATH_INFO = '/organizations/david-org-second-org/projects/jei-testing/'\r\nREMOTE_PORT = '45515'\r\nwsgi.url_scheme = 'https'\r\nHTTP_ACCEPT_ENCODING = 'gzip,deflate,br'\r\nREQUEST_METHOD = 'GET'\r\nHTTP_FROM = 'googlebot(at)googlebot.com'\r\nSCRIPT_NAME = ''\r\nSERVER_PORT = '443'\r\nSERVER_NAME = 'platform-staging-api.cadasta.org'\r\nCONTENT_TYPE = ''\r\nHTTP_HOST = 'platform-staging-api.cadasta.org'\r\nwsgi.multithread = False\r\nuwsgi.version = b'2.0.13.1'\r\nwsgi.multiprocess = True\r\nHTTP_CONNECTION = 'Keep-alive'\r\nHTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'\r\nwsgi.file_wrapper = ''\r\nSERVER_PROTOCOL = 'HTTP/1.1'\r\nwsgi.run_once = False\r\nDOCUMENT_ROOT = '/usr/share/nginx/html'\r\nwsgi.input = <uwsgi._Input object at 0x7f94c2ac5648>\r\n```\r\n\r\n### Expected behavior\r\n\r\nThe exception should be caught and an appropriate error message should be presented to the user.\r\n"},"comment":{"url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/comments/249612265","html_url":"https://github.com/Cadasta/cadasta-platform/issues/715#issuecomment-249612265","issue_url":"https://api.github.com/repos/Cadasta/cadasta-platform/issues/715","id":249612265,"user":{"login":"dpalomino","id":17198051,"avatar_url":"https://avatars.githubusercontent.com/u/17198051?v=3","gravatar_id":"","url":"https://api.github.com/users/dpalomino","html_url":"https://github.com/dpalomino","followers_url":"https://api.github.com/users/dpalomino/followers","following_url":"https://api.github.com/users/dpalomino/following{/other_user}","gists_url":"https://api.github.com/users/dpalomino/gists{/gist_id}","starred_url":"https://api.github.com/users/dpalomino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpalomino/subscriptions","organizations_url":"https://api.github.com/users/dpalomino/orgs","repos_url":"https://api.github.com/users/dpalomino/repos","events_url":"https://api.github.com/users/dpalomino/events{/privacy}","received_events_url":"https://api.github.com/users/dpalomino/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T15:54:58Z","updated_at":"2016-09-26T15:54:58Z","body":"Hi @oliverroick, sorry for the late replay. \r\n\r\nThere was a change in the partner's questionnaire (removing one field, and adding others). I guess removing the field caused this to fail. I will email to you the questionnaires by mail now (due to partner's privacy). \r\n\r\nCheers!\r\nDavid\r\n\r\n"}}
{"actor":{"display_login":"dpalomino"}}