Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download of dataset with no output format results in IndexError #105

Open
fracpete opened this issue Jun 17, 2021 · 0 comments
Open

Download of dataset with no output format results in IndexError #105

fracpete opened this issue Jun 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@fracpete
Copy link
Member

When attempting to download a dataset with no output format (e.g., omitting to-subdir-ic for image classification dataset), then the backend dies with the stacktrace below.

Fix: if no output format defined (eg when the stage_args list is empty), return an error stating that an output format is required.

Internal Server Error: /v1/classify/datasets/11/download
Traceback (most recent call last):
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/views/mixins/_DownloadableViewSet.py", line 79, in download
    return Response(data=obj.as_file(file_format, **parameters),
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 299, in as_file
    return self.as_zip()
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 358, in as_zip
    for filename, contents in self.archive_file_iterator():
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/core_app/models/_Dataset.py", line 329, in archive_file_iterator
    *annotations_args
  File "/ufdl/ufdl-backend/venv.dev/lib/python3.7/site-packages/ufdl/annotation_utils/_converted_annotations_iterator.py", line 42, in converted_annotations_iterator
    if "-o" not in stage_args[-1] and "--output" not in stage_args[-1]:
IndexError: list index out of range
@fracpete fracpete added the bug Something isn't working label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants