Build image for openedx-dev fail

My colleague build image for openedx-dev fail. Here are steps he did:

  1. Install Tutor from Source (with local launch)
  2. Set up open-edx development. (we cloned open-edx source inside the host folder)
  3. add mount
  4. Build image via “tutor images build openedx-dev --no-cache”

Here is the error message:

1.254   File "/openedx/edx-platform/scripts/compile_sass.py", line 335, in main
1.254     compile_sass_dir(
1.254   File "/openedx/edx-platform/scripts/compile_sass.py", line 252, in compile_sass_dir
1.254     raise Exception(f"Failed to compile {source}: {output_text}")
1.255 Exception: Failed to compile lms/static/sass/lms-main-v1-rtl.scss: Error: Invalid CSS after "": expected 1 selector or at-rule, was "./../common/sta..."
1.255         on line 1 of lms/static/sass/_mixins.scss
1.255 >> ../../../common/static/sass/_mixins.scss
1.255    ^
1.255
------
Dockerfile:206
--------------------
 204 |     # will be processed. This makes the docker image lighter and faster to build.
 205 |     RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.
 206 | >>> RUN npm run compile-sass -- --skip-themes
 207 |     RUN npm run webpack
 208 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run compile-sass -- --skip-themes" did not complete successfully: exit code: 1
Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx:18.1.2-indigo --no-cache --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx:18.1.2-indigo-cache --build-context=edx-platform=C:\OpenEdX\Prod\edx-platform C:\OpenEdX\Prod\env\build\openedx

We try to uninstall tutor and install again. The same error happens. Is there any thing we make it incorrectly?

Thank you very much in advance.

Hi @N_V have you tried with tutor images build openedx (without dev) command?

Yes, I did. I reinstall Tutor. Tutor local/dev launch works fine.
Later, I clone edx-platform from git and mount this folder. I add file docker-compose.override.yml to both local and dev. Here is the content of override file.

services:
  lms:
    volumes:
      - C:/Host/edx-platform:/openedx/edx-platform
  cms: 
    volumes:
      - C:/Host/edx-platform:/openedx/edx-platform

Then I build image openedx and it fails.
I try again and again (on either openedx-dev or openedx). It is found errors as following:

 => CACHED [production 10/37] COPY --link --chown=1000:1000 --from=nodejs-requirements /openedx/edx-platform/node_modules /openedx/node_modules         0.0s
 => ERROR [production 31/37] RUN npm run compile-sass -- --skip-themes                                                                                  0.8s
------
 > [production 31/37] RUN npm run compile-sass -- --skip-themes:
0.521
0.521 > edx@0.1.0 compile-sass
0.521 > scripts/compile_sass.py --env=${NODE_ENV:-production} --skip-themes
0.521
0.587 USING ENV: production
0.587
0.587
0.587 Compiling default Sass...
0.587   Compiling default LMS Sass...
0.587     Source: lms/static/sass
0.587     Target: lms/static/css
0.589     Include paths:
0.589       common/static
0.589       common/static/sass
0.589       node_modules/@edx
0.589       node_modules
0.589       lms/static/sass/partials
0.589       lms/static/sass
0.589     Files:
0.590       lms/static/sass/lms-footer-rtl.scss -> lms/static/css/lms-footer-rtl.css
0.675       lms/static/sass/lms-main-v1-rtl.scss -> lms/static/css/lms-main-v1-rtl.css
0.757 Traceback (most recent call last):
0.757   File "/openedx/edx-platform/scripts/compile_sass.py", line 503, in <module>
0.757     main(prog_name="npm run compile-sass --")
0.757   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
0.758     return self.main(*args, **kwargs)
0.758            ^^^^^^^^^^^^^^^^^^^^^^^^^^
0.758   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
0.758     rv = self.invoke(ctx)
0.758          ^^^^^^^^^^^^^^^^
0.758   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
0.759     return ctx.invoke(self.callback, **ctx.params)
0.759            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.759   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
0.759     return __callback(*args, **kwargs)
0.759            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.759   File "/openedx/venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
0.759     return f(get_current_context(), *args, **kwargs)
0.760            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.760   File "/openedx/edx-platform/scripts/compile_sass.py", line 335, in main
0.760     compile_sass_dir(
0.760   File "/openedx/edx-platform/scripts/compile_sass.py", line 252, in compile_sass_dir
0.760     raise Exception(f"Failed to compile {source}: {output_text}")
0.760 Exception: Failed to compile lms/static/sass/lms-main-v1-rtl.scss: Error: Invalid CSS after "": expected 1 selector or at-rule, was "./../common/sta..."
0.760         on line 1 of lms/static/sass/_mixins.scss
0.760 >> ../../../common/static/sass/_mixins.scss
0.760    ^
0.760
------
Dockerfile:202
--------------------
 200 |     # will be processed. This makes the docker image lighter and faster to build.
 201 |     RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.
 202 | >>> RUN npm run compile-sass -- --skip-themes
 203 |     RUN npm run webpack
 204 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run compile-sass -- --skip-themes" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/x6c03zls239poqb2tqj06el6m
Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx:18.1.3-indigo --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx:18.1.3-indigo-cache --build-context=edx-platform=C:\Host\edx-platform C:\Host\env\build\openedx

C:\Host>

Now, I do not know what else I can do. Is there any idea?

NOTE: I use Tutor master, and openedx master.

Hi, a few questions:

1st question:
Yes.

2nd question:
I used master branch of tutor and openedx

Today I install tutor 18.1.2 and setup work environment (checkout branch redwood/master. after adding mount, I build image openedx-dev and it is still failed. I do not know why.

 => [production 30/37] RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.                                  1.3s
 => ERROR [production 31/37] RUN npm run compile-sass -- --skip-themes                                                                                                 0.8s
------
 > importing cache manifest from openedx-dev:18.1.2-cache:
------
------
 > [production 31/37] RUN npm run compile-sass -- --skip-themes:
0.582
0.582 > edx@0.1.0 compile-sass
0.582 > scripts/compile_sass.py --env=${NODE_ENV:-production} --skip-themes
0.582
0.626 USING ENV: production
0.626
0.626
0.626 Compiling default Sass...
0.626   Compiling default LMS Sass...
0.626     Source: lms/static/sass
0.626     Target: lms/static/css
0.626     Include paths:
0.626       common/static
0.626       common/static/sass
0.626       node_modules/@edx
0.626       node_modules
0.626       lms/static/sass/partials
0.626       lms/static/sass
0.626     Files:
0.626       lms/static/sass/lms-footer-rtl.scss -> lms/static/css/lms-footer-rtl.css
0.701       lms/static/sass/lms-main-v1-rtl.scss -> lms/static/css/lms-main-v1-rtl.css
0.801 Traceback (most recent call last):
0.801   File "/openedx/edx-platform/scripts/compile_sass.py", line 503, in <module>
0.801     main(prog_name="npm run compile-sass --")
0.801   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
0.801     return self.main(*args, **kwargs)
0.801            ^^^^^^^^^^^^^^^^^^^^^^^^^^
0.801   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
0.801     rv = self.invoke(ctx)
0.801          ^^^^^^^^^^^^^^^^
0.801   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
0.801     return ctx.invoke(self.callback, **ctx.params)
0.801            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.801   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
0.802     return __callback(*args, **kwargs)
0.802            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.802   File "/openedx/venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
0.802     return f(get_current_context(), *args, **kwargs)
0.803            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.803   File "/openedx/edx-platform/scripts/compile_sass.py", line 335, in main
0.804     compile_sass_dir(
0.804   File "/openedx/edx-platform/scripts/compile_sass.py", line 252, in compile_sass_dir
0.804     raise Exception(f"Failed to compile {source}: {output_text}")
0.805 Exception: Failed to compile lms/static/sass/lms-main-v1-rtl.scss: Error: Invalid CSS after "": expected 1 selector or at-rule, was "./../common/sta..."
0.805         on line 1 of lms/static/sass/_mixins.scss
0.805 >> ../../../common/static/sass/_mixins.scss
0.805    ^
0.805
------
Dockerfile:206
--------------------
 204 |     # will be processed. This makes the docker image lighter and faster to build.
 205 |     RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.
 206 | >>> RUN npm run compile-sass -- --skip-themes
 207 |     RUN npm run webpack
 208 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run compile-sass -- --skip-themes" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/uye4k57p1fnpkuoxmsg76mwv0
Error: Command failed with status 1: docker buildx build --tag=openedx-dev:18.1.2 --output=type=docker --target=development --build-arg=APP_USER_ID=1000 --cache-from=type=registry,ref=openedx-dev:18.1.2-cache --build-context=edx-platform=C:\Host\edx-platform C:\Host\env\build\openedx

C:\Host>code .

C:\Host>

It seems you are using Windows? If so, Tutor does not work on Windows out of box. There is some documentation update work in progress to add troubleshooting for running Tutor on Windows.

Thanks for answering.

On our local machine, I have wsl2 installed. Today, I found that:

  1. Building image openedx-dev without mounting cloned edx-platform code can be done successfully.
  2. Building image openedx-dev with mounting always fail.

I still have no idea what to do.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.