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

SeedDB bulk import file upload crashes #2025

Closed
lunkwill42 opened this issue Nov 26, 2019 · 0 comments
Closed

SeedDB bulk import file upload crashes #2025

lunkwill42 opened this issue Nov 26, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@lunkwill42
Copy link
Member

Describe the bug
Attempting to upload a file to bulk import seed data under NAV 5.0.0 crashes the SeedDB page with an AttributeError (which is masked by a broken custom 500 error handler view, which @hmpf is working on separately).

To Reproduce
Steps to reproduce the behavior:

  1. Create an organization bulk import file, containing only a single line, e.g. foobar
  2. Go to the SeedDB in the NAV web ui
  3. Click on Organization -> Bulk Import -> Choose file
  4. Select the bulk import file you created.
  5. Click Preview import.
  6. See error

Expected behavior

A preview of the bulk import results, as would happen if the import data was entered manually into the text area below the Choose file button.

Environment (please complete the following information):

  • OS on the NAV server: Debian 10
  • NAV 5.0.0
  • Method of installation: Debian package

Additional context

This is the logged traceback:

Internal Server Error: /seeddb/organization/bulk/
Traceback (most recent call last):
  File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/seeddb/page/organization.py", line 92, in organization_bulk
    extra_context=info.template_context)
  File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/seeddb/utils/bulk.py", line 34, in render_bulkimport
    form = BulkImportForm(parser_cls, request.POST, request.FILES)
  File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/seeddb/forms/bulk.py", line 45, in __init__
    self.data['bulk_data'] = bulk_file.read()
  File "/opt/venvs/nav/lib/python3.7/site-packages/django/http/request.py", line 435, in __setitem__
    self._assert_mutable()
  File "/opt/venvs/nav/lib/python3.7/site-packages/django/http/request.py", line 432, in _assert_mutable
    raise AttributeError("This QueryDict instance is immutable")
AttributeError: This QueryDict instance is immutable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant