Missing js/css files missing from openedx Docker image (in studio)

After building this image, I find that the files & Uploads can not work.
http://studio.local.overhang.io/assets/course-v1:pu+cs101+2022/

In normal version, there should be in /openedx/staticfile/common/js/vendor
But in this version. these file are missed.

http://studio.local.overhang.io/static/studio/common/js/vendor/runtime.min.js
http://studio.local.overhang.io/static/studio/common/js/vendor/common.min.js
http://studio.local.overhang.io/static/studio/common/js/vendor/assets.min.js

In previously, I can build and work fine.
But right now,I don’t what is the different. each time I build it, these files are missing.

right now, only these files:
app@8193ee0ed41e:~/staticfiles/common/js/vendor$

backbone.222432686a33.js jquery.js require.e7199843dfd4.js
backbone.js jquery-migrate.351c89ef1b09.js require.js
backbone.paginator.e3292f22e57f.js jquery-migrate.js sinon.13eb38efdb17.js
backbone.paginator.js jquery.scrollTo.525edcc52fe8.js sinon.js
bootstrap.bundle.6866f102282d.js jquery.scrollTo.js Squire.6b82cd99daf8.js
bootstrap.bundle.js moment-timezone-with-data.60142e6c4416.js Squire.js
hls.5e0c7e1b3bfd.js moment-timezone-with-data.js underscore.f893e294cde6.js
hls.js moment-with-locales.e3cc27d412a1.js underscore.js
index.55c2f095862b.js moment-with-locales.js underscore.string.09290e54cc04.js
index.js picturefill.1d4a46c343cb.js underscore.string.js
jquery.888d4551b8db.js picturefill.js

normally should have :
accessibilityPolicy.min.6ed21ceeb8c5.js hls.5e0c7e1b3bfd.js
accessibilityPolicy.min.js hls.js
accessibilityPolicy.min.js.ec9076436b1d.map i18nMessages.min.328c46f83e32.js
accessibilityPolicy.min.js.map i18nMessages.min.js
ar.e694d008b122.json i18nMessages.min.js.ff71861378bc.map
ar.json i18nMessages.min.js.map
assets.min.b62a8df5a8dd.js index.55c2f095862b.js
assets.min.js index.js
assets.min.js.4e5bf55d622a.map jquery.888d4551b8db.js
assets.min.js.map jquery.js
backbone.222432686a33.js jquery-migrate.351c89ef1b09.js
backbone.js jquery-migrate.js
backbone.paginator.e3292f22e57f.js jquery.scrollTo.525edcc52fe8.js
backbone.paginator.js jquery.scrollTo.js
bootstrap.bundle.6866f102282d.js moment-timezone-with-data.60142e6c4416.js
bootstrap.bundle.js moment-timezone-with-data.js
common.min.1158603b80f5.js moment-with-locales.e3cc27d412a1.js
common.min.js moment-with-locales.js
common.min.js.c29db3e5b80d.map picturefill.1d4a46c343cb.js
common.min.js.map picturefill.js
courseHealthCheck.min.f3309b55bfe7.js require.e7199843dfd4.js
courseHealthCheck.min.js require.js
courseHealthCheck.min.js.bc6d881731b8.map runtime.min.0fc95669347a.js
courseHealthCheck.min.js.map runtime.min.js
courseOutlineHealthCheck.min.1b49356b6325.js runtime.min.js.86ed3dfa5d25.map
courseOutlineHealthCheck.min.js runtime.min.js.map
courseOutlineHealthCheck.min.js.259e8ceeb039.map sinon.13eb38efdb17.js
courseOutlineHealthCheck.min.js.map sinon.js
editImageModal.min.706669698cc1.js Squire.6b82cd99daf8.js
editImageModal.min.js Squire.js
editImageModal.min.js.ee35da03198d.map underscore.f893e294cde6.js
editImageModal.min.js.map underscore.js
es_419.5e7a47c23b2a.json underscore.string.09290e54cc04.js
es_419.json underscore.string.js
fr.b482b4a5c417.json zh_CN.159604f8b813.json
fr.json zh_CN.json

I run:
tutor images build openedx
How could I check the logs?

1 Like

This exact issue just happened to me and I am still running Lilac. All the assets.min.js, runtime.min.js files were missing from the CMS.

I just noticed that I also have the same problem in my development instance running Lilac.

Hi @ToddLichty and @uetuluk
I had same issue on Maple as detailed here: Files & Uploads page is blank

By pulling the docker image I was able to resolve it. See my reply at the end and change your version number according to your config

I am using a fork of edx-platform, so I cannot use the prebuilt docker image unfortunately.

I am using a fork as well. What I don’t understand is what would have changed from last week to this week?

Does anyone know how those files are generated and minified?

So I continued to do some more investigation. Maybe this will help someone figure out what is going on.

I restored a snapshot I had from last week when the page loaded fine. Doing a view source on the page, I can see this piece of code:

    <div id="root" class="SFE"></div>
        <script type="text/javascript" src="/static/studio/common/js/vendor/runtime.min.0fc95669347a.js"></script>
        <script type="text/javascript" src="/static/studio/common/js/vendor/common.min.1158603b80f5.js"></script>
        <script type="text/javascript" src="/static/studio/common/js/vendor/assets.min.b62a8df5a8dd.js"></script>

    </div>

Everything loads fine. Looking at the same page on the latest build, I see this:

    <div id="root" class="SFE"></div>
        <script type="text/javascript" src="/static/studio/common/js/vendor/runtime.min.js"></script>
        <script type="text/javascript" src="/static/studio/common/js/vendor/common.min.js"></script>
        <script type="text/javascript" src="/static/studio/common/js/vendor/assets.min.js"></script>

    </div>

As was originally pointed out by @gostdio , those files are now missing. Also, the corresponding css (assets.min.cs, common.min.css) files are missing as well.

I believe the files are generated during the openedx-assets script section of the Dockerfile.

I have attached the Lilac version of the Dockerfile for reference.

The openedx-assets script from Tutor uses the following Python file for managing the assets: pavelib/assets.py

https://github.com/openedx/edx-platform/blob/open-release/lilac.3/pavelib/assets.py

After further probing, I found that the @edx/studio-frontend npm module does not include a dist folder anymore. The dist folder includes most of the files mentioned by @gostdio as missing.

A quick solution that I found is to pin the @edx/studio-frontend to 1.17.0 which is the latest version that comes with the dist folder.

2 Likes

@uetuluk Can I ask what file you modified to pin the @edx/studio-frontend to 1.17.0?

For anyone else that comes across this, I modified the package.json in my edx-platform fork:

I changed this line:

"@edx/studio-frontend": "^1.16.22",

to this:

"@edx/studio-frontend": "1.17.0",

Great work @uetuluk for figuring this out!

3 Likes

We have wasted 2 days resolving this thing.

Thanks, @uetuluk @ToddLichty

@ToddLichty @uetuluk @jramnai

Hello guys, how are you?

I’m using open-release/maple.2 with Tutor 13.1.8 and I’m having this problem.
This release already has @edx/studio-frontend 1.17.0.

These are the missing files that I noticed:

static/studio/common/css/vendor/common.min.css
static/studio/common/css/vendor/courseOutlineHealthCheck.min.css
static/studio/common/css/vendor/assets.min.css
static/studio/common/js/vendor/runtime.min.js
static/studio/common/js/vendor/common.min.js
static/studio/common/js/vendor/courseOutlineHealthCheck.min.js
static/studio/common/js/vendor/assets.min.js

Affected pages:

  • Files & Uploads
  • Content / Outline
  • Tools / Checklist

I can confirm this problem also exists with open-release/maple.3.

@erickhgm The @edx/studio-frontend should be pinned to 1.17.0. The default package.json file has the line “^1.17.0” which will use the most updated version of the package.

1 Like

@regis Sorry for bothering you.

This problem also exists with open-release/maple.3 using Tutor 13.1.11.

Do you know why the dist folder is not included in new versions of the @edx/studio-frontend package?

Thank you.

It’s true, I hadn’t noticed that detail. I will test …
Thank you @uetuluk

@regis @uetuluk
Do we have an issue with this?
Is a problem of edx/studio-frontend or tutor build?

Thanks for your work and your investigation everyone! Please let me know if I understand the problem correctly:

  • The @edx/studio-frontend package is a requirement of edx-platform, with version ^1.17.0, which basically mean “anything between 1.0.0 (included) and 2.0.0 (excluded)” (see: https://semver.npmjs.com/).
  • The @edx/studio-frontend package was recently (~ April 4th) updated to 1.18.2. Because of the unpinned required requirement in edx-platform, this causes new builds of Docker images to upgrade to the newest release.
  • The 1.18.2 release does not ship with some required files, such as node_modules/@edx/studio-frontend/dist/common.min.js, thus causing errors in the studio.
  • The files that are missing in 1.18.2 were present in 1.17.0, as we can see by running:
$ find node_modules/@edx/studio-frontend/ -name "common*.css"
node_modules/@edx/studio-frontend/dist/common.min.js

It seems to me that there are two bugs here, both upstream:

  1. The @edx/studio-frontend package should have a version pinned to 1.17.0 in edx-platform’s package.json.
  2. The 1.18.* versions of package @edx/studio-frontend should include the dist/ folder.

I have no idea why edX.org is not affected by (2). My guess is that npm packages are either installed in place or stored in a CDN, which caches older versions for some reason.

I propose to fix the issue in Tutor by pinning the studio-frontend version in the open-release/maple.master branch of edx-platform. Would someone like to open a pull request on edx-platform to that effect? You should link to this comment in your PR description. Then, open a PR on Tutor to cherry-pick your commit.

Thanks again for your work!

I can open the pull request for the edx-platform.

Thank you @regis for organizing the findings in an easy to present format.

Edit: I have opened the following PR for this issue: Pin npm package @edx/studio-frontend to 1.17.0 to fix missing assets by uetuluk · Pull Request #30309 · openedx/edx-platform · GitHub

2 Likes

Shouldn’t the new version of edx/studio-frontend be fixed?
Using the 1.17.0 in edx-platform’s package.json would be a temporary solution, right?


I started working with Open edX about 3 months ago and I see many opportunities for improvement, especially in the documentation.
It will be a pleasure to contribute …

Everything working fine, I can open the PR to git cherry-pick.