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

Problem: Unable to download big files from "Review Normalization" panel #1669

Open
5 tasks
scollazo opened this issue Feb 28, 2024 · 1 comment
Open
5 tasks

Comments

@scollazo
Copy link

Expected behaviour
When reviewing normalized files, the files can be downloaded

Current behaviour
Downloading a big mp4 file (6gb) shows an internal server error, and the following message in the dashboard log file:

ERROR     2024-02-XX XX:XX:XX  django.request:exception:handle_uncaught_exception:135:  Internal Server Error: /filesystem/download_fs/
Traceback (most recent call last):
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/archivematica/archivematica/src/dashboard/src/components/filesystem_ajax/views.py", line 1069, in download_fs
    return helpers.send_file(request, requested_filepath)
  File "/opt/archivematica/archivematica/src/dashboard/src/components/helpers.py", line 270, in send_file
    response = HttpResponse(wrapper)
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/http/response.py", line 303, in __init__
    self.content = content
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.6/site-packages/django/http/response.py", line 329, in content
    content = b''.join(self.make_bytes(chunk) for chunk in value)
MemoryError

Steps to reproduce

  • Set "Approve normalization" to "None"
  • Run a transfer with a big enough file
  • In the "Approve normalization" job, click "Review" and try downloading a big file

Your environment (version of Archivematica, operating system, other relevant details)
Ubuntu 20.04 with Archivematica 1.14.1


For Artefactual use:

Before you close this issue, you must check off the following:

  • All pull requests related to this issue are properly linked
  • All pull requests related to this issue have been merged
  • A testing plan for this issue has been implemented and passed (testing plan information should be included in the issue body or comments)
  • Documentation regarding this issue has been written and merged (if applicable)
  • Details about this issue have been added to the release notes (if applicable)
@scollazo
Copy link
Author

As a workaround, the format can be added to a list of formats that are always streamed to the client:

diff --git a/src/dashboard/src/components/helpers.py b/src/dashboard/src/components/helpers.py
index 97e59cdd..d3fc9ff8 100644
--- a/src/dashboard/src/components/helpers.py
+++ b/src/dashboard/src/components/helpers.py
@@ -270,7 +270,7 @@ def send_file(request, filepath, force_download=False):
     response = HttpResponse(wrapper)
 
     # force download for certain filetypes
-    extensions_to_download = [".7z", ".zip"]
+    extensions_to_download = [".7z", ".zip", ".mp4"]
 
     if force_download or (extension in extensions_to_download):
         response["Content-Type"] = "application/force-download"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant