CaseUploadRecord matching query does not exist

Hi,
in my commcare-hq local installation, I’m trying to import cases from an
excel file…
After a couple of seconds, the importer crashes and I get the following
error… All the time the same error irrespective of the number of cases to
import…

DoesNotExist at /a/demo/importer/excel/commit/

CaseUploadRecord matching query does not exist.

Request Method: POST
Request URL: http://localhost:8000/a/demo/importer/excel/commit/
Django Version: 1.10.7
Exception Type: DoesNotExist
Exception Value:

CaseUploadRecord matching query does not exist.

Exception Location: /root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/db/models/query.py
in get, line 385

Environment:

Request Method: POST
Request URL: http://localhost:8000/a/demo/importer/excel/commit/

Django Version: 1.10.7
Python Version: 2.7.6
Installed Applications:
[‘corehq.apps.userhack’,
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.humanize’,
‘django.contrib.sessions’,
‘django.contrib.sites’,
‘django.contrib.staticfiles’,
‘rest_framework.authtoken’,
‘djcelery’,
‘djtables’,
‘django_prbac’,
‘djangular’,
‘captcha’,
‘couchdbkit.ext.django’,
‘crispy_forms’,
‘gunicorn’,
‘compressor’,
‘mptt’,
‘tastypie’,
‘django_otp’,
‘django_otp.plugins.otp_static’,
‘django_otp.plugins.otp_totp’,
‘two_factor’,
‘ws4redis’,
‘statici18n’,
‘raven.contrib.django.raven_compat’,
‘django_digest’,
‘auditcare’,
‘hqscripts’,
‘casexml.apps.case’,
‘corehq.apps.casegroups’,
‘casexml.apps.phone’,
‘casexml.apps.stock’,
‘corehq.apps.cleanup’,
‘corehq.apps.cloudcare’,
‘corehq.apps.couch_sql_migration’,
‘corehq.apps.smsbillables’,
‘corehq.apps.accounting’,
‘corehq.apps.appstore’,
‘corehq.apps.data_analytics’,
‘corehq.apps.data_pipeline_audit’,
‘corehq.apps.domain’,
‘corehq.apps.domainsync’,
‘corehq.apps.domain_migration_flags’,
‘corehq.apps.dump_reload’,
‘corehq.apps.hqadmin’,
‘corehq.apps.hqcase’,
‘corehq.apps.hqwebapp’,
‘corehq.apps.hqmedia’,
‘corehq.apps.locations’,
‘corehq.apps.products’,
‘corehq.apps.prelogin’,
‘corehq.apps.programs’,
‘corehq.apps.commtrack’,
‘corehq.apps.consumption’,
‘corehq.apps.tzmigration’,
‘corehq.form_processor.app_config.FormProcessorAppConfig’,
‘corehq.sql_db’,
‘corehq.sql_accessors’,
‘corehq.sql_proxy_accessors’,
‘couchforms’,
‘couchexport’,
‘dimagi.utils’,
‘formtranslate’,
‘langcodes’,
‘corehq.apps.data_dictionary’,
‘corehq.apps.analytics’,
‘corehq.apps.callcenter’,
‘corehq.apps.change_feed’,
‘corehq.apps.crud’,
‘corehq.apps.custom_data_fields’,
‘corehq.apps.receiverwrapper’,
‘corehq.apps.repeaters’,
‘corehq.apps.app_manager’,
corehq.apps.es’,
‘corehq.apps.fixtures’,
‘corehq.apps.calendar_fixture’,
‘corehq.apps.case_importer’,
‘corehq.apps.reminders’,
‘corehq.apps.translations’,
‘corehq.apps.tour’,
‘corehq.apps.users’,
‘corehq.apps.settings’,
‘corehq.apps.ota’,
‘corehq.apps.groups’,
‘corehq.apps.mobile_auth’,
‘corehq.apps.sms’,
‘corehq.apps.smsforms’,
‘corehq.apps.ivr’,
‘corehq.messaging.scheduling’,
‘corehq.messaging.scheduling.scheduling_partitioned’,
‘corehq.messaging.smsbackends.tropo’,
‘corehq.messaging.smsbackends.twilio’,
‘corehq.apps.dropbox’,
‘corehq.messaging.smsbackends.megamobile’,
‘corehq.messaging.ivrbackends.kookoo’,
‘corehq.messaging.smsbackends.sislog’,
‘corehq.messaging.smsbackends.yo’,
‘corehq.messaging.smsbackends.telerivet’,
‘corehq.messaging.smsbackends.mach’,
‘corehq.messaging.smsbackends.http’,
‘corehq.messaging.smsbackends.smsgh’,
‘corehq.messaging.smsbackends.push’,
‘corehq.messaging.smsbackends.apposit’,
‘corehq.messaging.smsbackends.test’,
‘corehq.apps.performance_sms’,
‘corehq.apps.registration’,
‘corehq.messaging.smsbackends.unicel’,
‘corehq.messaging.smsbackends.icds_nic’,
‘corehq.apps.reports.app_config.ReportsModule’,
‘corehq.apps.reports_core’,
‘corehq.apps.userreports’,
‘corehq.apps.data_interfaces’,
‘corehq.apps.export’,
‘corehq.apps.builds’,
‘corehq.apps.api’,
‘corehq.apps.indicators’,
‘corehq.apps.notifications’,
‘corehq.apps.cachehq’,
‘corehq.apps.toggle_ui’,
‘corehq.apps.hqpillow_retry’,
‘corehq.couchapps’,
‘corehq.preindex’,
‘corehq.tabs’,
‘custom.apps.wisepill’,
‘custom.fri’,
‘custom.openclinica’,
‘fluff’,
‘fluff.fluff_filter’,
‘soil’,
‘toggle’,
‘touchforms.formplayer’,
‘phonelog’,
‘pillowtop’,
‘pillow_retry’,
‘corehq.apps.style’,
‘corehq.apps.styleguide’,
‘corehq.messaging.smsbackends.grapevine’,
‘corehq.apps.dashboard’,
‘corehq.apps.dhis2’,
‘corehq.util’,
‘dimagi.ext’,
‘corehq.doctypemigrations’,
‘corehq.blobs’,
‘corehq.apps.case_search’,
‘corehq.apps.zapier.apps.ZapierConfig’,
‘a5288’,
‘custom.bihar’,
‘custom.apps.gsid’,
‘hsph’,
‘mvp’,
‘mvp_docs’,
‘mvp_indicators’,
‘custom.opm’,
‘pact’,
custom.reports.mc’,
‘custom.apps.crs_reports’,
‘custom.hope’,
‘custom.logistics’,
‘custom.ilsgateway’,
‘custom.zipline’,
‘custom.ewsghana’,
‘custom.m4change’,
‘custom.succeed’,
‘custom.ucla’,
‘custom.uth’,
‘custom.intrahealth’,
‘custom.world_vision’,
‘custom.up_nrhm’,
‘custom.care_pathways’,
‘custom.common’,
‘custom.icds’,
‘custom.icds_reports’,
‘custom.pnlppgi’,
‘custom.enikshay’,
‘custom.enikshay.integrations.ninetyninedots’,
‘custom.enikshay.nikshay_datamigration’,
‘custom.enikshay.integrations.nikshay’,
‘corehq.apps.mocha’]
Installed Middleware:
[u’raven.contrib.django.middleware.SentryMiddleware’, ‘corehq.middleware.NoCacheMiddleware’, ‘django.contrib.sessions.middleware.SessionMiddleware’, ‘django.middleware.locale.LocaleMiddleware’, ‘django.middleware.common.CommonMiddleware’, ‘django.middleware.csrf.CsrfViewMiddleware’, ‘django.contrib.auth.middleware.AuthenticationMiddleware’, ‘django.contrib.auth.middleware.SessionAuthenticationMiddleware’, ‘django.contrib.messages.middleware.MessageMiddleware’, ‘django.middleware.common.BrokenLinkEmailsMiddleware’, ‘django_otp.middleware.OTPMiddleware’, ‘corehq.middleware.OpenRosaMiddleware’, ‘corehq.util.global_request.middleware.GlobalRequestMiddleware’, ‘corehq.apps.users.middleware.UsersMiddleware’, ‘corehq.middleware.SentryContextMiddleware’, ‘corehq.apps.domain.middleware.DomainMigrationMiddleware’, ‘corehq.middleware.TimeoutMiddleware’, ‘corehq.apps.domain.middleware.CCHQPRBACMiddleware’, ‘corehq.apps.domain.middleware.DomainHistoryMiddleware’, ‘casexml.apps.phone.middleware.SyncTokenMiddleware’, ‘auditcare.middleware.AuditMiddleware’, ‘no_exceptions.middleware.NoExceptionsMiddleware’, ‘corehq.apps.locations.middleware.LocationAccessMiddleware’]

Traceback:

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/core/handlers/exception.py"
in inner
42. response = get_response(request)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _legacy_get_response
249. response = self._get_response(request)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _get_response
187. response = self.process_exception_by_middleware(e,
request)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in _get_response
185. response = wrapped_callback(request, *callback_args,
**callback_kwargs)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/views/decorators/http.py"
in inner
40. return func(request, *args, **kwargs)

File “/root/commcare-hq/corehq/apps/domain/decorators.py” in _inner
103. return view_func(req, domain_name, *args,
**kwargs)

File “/root/commcare-hq/corehq/apps/users/decorators.py” in _inner
21. return view_func(request, domain, *args, **kwargs)

File “/root/commcare-hq/corehq/apps/case_importer/views.py” in excel_commit
214. case_upload.trigger_upload(domain, config)

File
"/root/commcare-hq/corehq/apps/case_importer/tracking/case_upload_tracker.py"
in trigger_upload
49. task = bulk_import_async.delay(config, domain, self.upload_id)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in delay
453. return self.apply_async(args, kwargs)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in apply_async
551. link=link, link_error=link_error,
**options)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in apply
743. request=request,
propagate=throw)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in eager_trace_task
355. uuid, args, kwargs, request)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in trace_task
253. I, R, state, retval = on_error(task_request,
exc, uuid)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in trace_task
240. R = retval = fun(*args, **kwargs)

File “/root/commcare-hq/corehq/apps/case_importer/tasks.py” in
bulk_import_async
48. store_task_result.delay(excel_id)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in delay
453. return self.apply_async(args, kwargs)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in apply_async
551. link=link, link_error=link_error,
**options)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/task.py"
in apply
743. request=request,
propagate=throw)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in eager_trace_task
355. uuid, args, kwargs, request)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in trace_task
253. I, R, state, retval = on_error(task_request,
exc, uuid)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/celery/app/trace.py"
in trace_task
240. R = retval = fun(*args, **kwargs)

File “/root/commcare-hq/corehq/apps/case_importer/tasks.py” in
store_task_result
54. case_upload.store_task_result()

File
"/root/commcare-hq/corehq/apps/case_importer/tracking/case_upload_tracker.py"
in store_task_result
64. if
self._case_upload_record.set_task_status_json_if_finished():

File “./submodules/dimagi-utils-src/dimagi/utils/decorators/memoized.py” in
_inner
10. return m(*args, **kwargs)

File “./submodules/dimagi-utils-src/dimagi/utils/decorators/memoized.py” in
call
127. value = self.func( *args, **kwargs)

File
"/root/commcare-hq/corehq/apps/case_importer/tracking/case_upload_tracker.py"
in _case_upload_record
28. return CaseUploadRecord.objects.get(upload_id=self.upload_id)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/db/models/manager.py"
in manager_method
85. return getattr(self.get_queryset(), name)(*args,
**kwargs)

File
"/root/.virtualenvs/cchq/local/lib/python2.7/site-packages/django/db/models/query.py"
in get
385. self.model._meta.object_name

Exception Type: DoesNotExist at /a/demo/importer/excel/commit/
Exception Value: CaseUploadRecord matching query does not exist.