Error on import cases from excel

I have been trying to close cases using the page ‘import cases from excel’ and I am facing an error.

This functionality used to work a week ago but not now. How can I fix this?

It’s odd that there aren’t any details describing the errors - I’d guess this is an infrastructure problem rather than an issue with the upload itself. This feature uses celery to process the uploads asynchronously.

I’d ensure celery is running and check the logs for error messages. You can find more information about that here:

1 Like

@Ethan_Soergel , Thank You Very Much for the reply ,
Here is the celery log for corehq.apps.case_importer.tasks.bulk_import_async

Traceback (most recent call last): File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/celery/app/", line 375, in trace_task R = retval = fun(*args, **kwargs) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/celery/app/", line 632, in __protected_call__ return*args, **kwargs) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/sentry_sdk/integrations/", line 138, in _inner reraise(*exc_info) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/sentry_sdk/", line 54, in reraise raise value File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/sentry_sdk/integrations/", line 133, in _inner return f(*args, **kwargs) File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/apps/case_importer/", line 25, in bulk_import_async case_upload.check_file() File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/apps/case_importer/tracking/", line 51, in check_file open_spreadsheet_download_ref(tempfile) File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/apps/case_importer/", line 174, in open_spreadsheet_download_ref with get_spreadsheet(filename): File "/usr/lib/python3.6/", line 81, in __enter__ return next(self.gen) File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/apps/case_importer/", line 181, in get_spreadsheet with open_any_workbook(filename) as workbook: File "/usr/lib/python3.6/", line 81, in __enter__ return next(self.gen) File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/util/workbook_reading/adapters/", line 13, in open_any_workbook with open_xlsx_workbook(filename) as workbook: File "/usr/lib/python3.6/", line 81, in __enter__ return next(self.gen) File "/home/cchq/www/echis/releases/2019-09-11_23.48/corehq/util/workbook_reading/adapters/", line 31, in open_xlsx_workbook openpyxl_workbook = openpyxl.load_workbook(f, read_only=True, data_only=True) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/openpyxl/reader/", line 311, in load_workbook data_only, keep_links) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/openpyxl/reader/", line 126, in __init__ self.archive = _validate_archive(fn) File "/home/cchq/www/echis/releases/2019-09-11_23.48/python_env-3.6/lib/python3.6/site-packages/openpyxl/reader/", line 98, in _validate_archive archive = ZipFile(filename, 'r') File "/usr/lib/python3.6/", line 1131, in __init__ self._RealGetContents() File "/usr/lib/python3.6/", line 1216, in _RealGetContents, 0) OSError: [Errno 22] Invalid argument

It looks like the task is unable to open that file. Is it for sure a valid xlsx file? You might also try uploading a different file, such as one which has worked in the past, which would help identify the issue.