Excel Analyzer doesn't work for xlsforms without choices sheet

38 views
Skip to first unread message

Chroma

unread,
Aug 18, 2015, 7:44:35 AM8/18/15
to KoBo Developers
Hi. Bug Report! Create a new form a single question of type Photo. Publish it, (do or don't submit anything,) generate an XLS export then try to export as Excel Analyzer. On kc.kobotoolbox.org, you'll get a 502 Bad Gateway error. On our own deployment, we get a 500 error with this explanation: (paths removed by me; line numbers may not be exact)

Traceback (most recent call last):

  File "/<virtual env path>/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/<sources path>/kobocat/onadata/apps/logger/views.py", line 533, in download_excel_analyser
    analyser_io= generate_analyser(xlsform_io, data_file_xlsx)

  File "/<sources path>/kobocat/onadata/libs/utils/analyser_export.py", line 203, in generate_analyser
    insert_xlsform_worksheets(analyser_shared_strings, survey_worksheet_file_path, choices_worksheet_file_path, survey_file_xls)

  File "/<sources path>/kobocat/onadata/libs/utils/analyser_export.py", line 146, in insert_xlsform_worksheets
    choices_sheet_path= 'xl/worksheets/sheet' + worksheet_indices['choices'] + '.xml'

KeyError: 'choices'


Which basically points out the fact that there aren't multiple-choice or other kinds of questions to generate a 'choices' sheet.

The error can be avoided by checking if 'choices' exists in sheets before blindly trying to copy it to excel analyzer sheets, however I don't know how excel analyzer works; does lacking a 'choices' sheet break it? Please review this issue.

Cheers; Hossein.

Esmail Fadae

unread,
Sep 1, 2015, 6:10:28 PM9/1/15
to KoBo Developers
Hi, Hossein; thanks for the report. I've created a issue for this (https://github.com/kobotoolbox/kobocat/issues/78) so we can track it. No estimate on when it'll be fixed, though since I'm focusing on getting our system into Docker for the time being.
Reply all
Reply to author
Forward
0 new messages