mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.52k stars 459 forks source link

Bug when changing base media folder via local_settings.py #931

Open tdsotm opened 7 months ago

tdsotm commented 7 months ago

Describe the issue I had a smb share mounted inside the root folder, which I followed from instructions. When uploading a file it fails on encoding

To Reproduce Steps to reproduce the issue: Add different MEDIA_ROOT directory Expected behavior Files are properly encoded

Environment (please complete the following information):

Looking at the logs, encoding fails because it can't find the file. Which is correct because the file was uploaded to the new media location, but the app doesn't seem to be aware of it.

[2023-12-03 01:41:14,338: ERROR/ForkPoolWorker-7] Task chunkize_media[754ed501-13b7-411d-868f-ef935588d587] raised unexpected: FileNotFoundError(2, 'No such file or directory')
Traceback (most recent call last):
  File "/home/mediacms.io/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/mediacms.io/lib/python3.10/site-packages/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/mediacms.io/mediacms/files/tasks.py", line 77, in chunkize_media
    ret = run_command(cmd, cwd=cwd)
  File "/home/mediacms.io/mediacms/files/helpers.py", line 212, in run_command
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mediacms.io/mediacms/media_files/original/user/admin'

Maybe there's another setting I need to change, but I couldn't find it in the settings file.

Expected behaviour is for all the app to be aware of the location change.