Upload size limit not working platform wide

Urgent help needed, please.

I created a custom plugin to increase file size upload limit in Studio and changed it to 200mb, which worked for one course but is not working for a new course I created. I also changed the contentstore.new_studio_mfe.use_new_files_uploads_page in Django admin and set “everyone” to no.

I’m not sure why I’m not able to upload larger files in my second course when it works for the first one. It’s stuck on “The file should be less than 20MB”. This is my plugin:

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item((

"openedx-cms-production-settings",

"MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB = 200"

))

hooks.Filters.ENV_PATCHES.add_item((

"caddyfile-cms",

"""

handle_path /import/* {

request_body {

    max_size 200MB

}

}

handle /assets/* {

request_body {

    max_size 200MB

}

}
“”"

))

Hi @localized and welcome to the project! Curious if you followed the instructions to save and restart as detailed in Creating a Tutor plugin — Tutor documentation?

Yes! I’ve ran tutor config save and tutor local restart multiple times. I’m just not sure why it’s being applied on one course but not the other.

Me neither :sweat_smile:

@tutor-maintainers any advice?

As far as I can tell the waffle flag contentstore.new_studio_mfe.use_new_files_uploads_page no longer has any effect and the MFE uploads page is used regardless the flag setting. According to the docs here it was targeted for removal by 2023-8-31 so this is probably a deprecated setting now.

The only way I’m aware of to work around the 20MB limit is to create a fork of the frontend-app-authoring MFE and edit the UPLOAD_FILE_MAX_SIZE constant then use your fork with a plugin like this, followed by a rebuild of the MFE container with tutor images build mfe and a restart.

from tutormfe.hooks import MFE_APPS

@MFE_APPS.add()
def _override_authoring_mfe(mfes):
    mfes["authoring"] = {
        "repository": "https://github.com/{YourGithubUsername}/frontend-app-authoring.git",
        "version": "{YourForkName}", 
        "port": 2001, 
    }
    return mfes

The last I tested it the patches for openedx-cms-production-settings and the caddyfile-cms are also still required.

In an ideal scenario the MFE’s UPLOAD_FILE_MAX_SIZE should be getting the value from MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB instead of a hard defined constant, but those relationships have not been coded out yet…

Ah, that seems not right. Tagging @kmccormick as he’s been involved in the legacy studio depr process.

Thank you for the report @localized and thanks for confirming it as a standing issue @joel.edwards . That’s an unfortunate bug, I’m sorry!

I’ve cataloged the issue here: Get `UPLOAD_FILE_MAX_SIZE` setting from the backend · Issue #2958 · openedx/frontend-app-authoring · GitHub. Seems like a good first issue that any dev could pick up.