Error building openedx image with Tutor redwood

Hi, I’m trying to build a Redwood devstack with Tutor, but building the openedx-dev image fails:

 => [production 32/39] RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.                                                                                                                                                                                                                  0.7s
 => ERROR [production 33/39] RUN npm run compile-sass -- --skip-themes                                                                                                                                                                                                                                                                                 0.6s
------
 > importing cache manifest from openedx-dev:18.2.2-cache:
------
------
 > [production 33/39] RUN npm run compile-sass -- --skip-themes:
0.462
0.462 > edx@0.1.0 compile-sass
0.462 > scripts/compile_sass.py --env=${NODE_ENV:-production} --skip-themes
0.462
0.507 USING ENV: production
0.507
0.507
0.507 Compiling default Sass...
0.507   Compiling default LMS Sass...
0.507     Source: lms/static/sass
0.507     Target: lms/static/css
0.507     Include paths:
0.507       common/static
0.507       common/static/sass
0.507       node_modules/@edx
0.507       node_modules
0.507       lms/static/sass/partials
0.507       lms/static/sass
0.507     Files:
0.507       lms/static/sass/lms-footer.scss -> lms/static/css/lms-footer.css
0.507 Traceback (most recent call last):
0.507   File "/openedx/edx-platform/scripts/compile_sass.py", line 503, in <module>
0.508     main(prog_name="npm run compile-sass --")
0.508   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
0.508     return self.main(*args, **kwargs)
0.508            ^^^^^^^^^^^^^^^^^^^^^^^^^^
0.508   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
0.508     rv = self.invoke(ctx)
0.508          ^^^^^^^^^^^^^^^^
0.508   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
0.508     return ctx.invoke(self.callback, **ctx.params)
0.508            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.508   File "/openedx/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
0.508     return __callback(*args, **kwargs)
0.508            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.508   File "/openedx/venv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
0.508     return f(get_current_context(), *args, **kwargs)
0.508            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.508   File "/openedx/edx-platform/scripts/compile_sass.py", line 335, in main
0.508     compile_sass_dir(
0.508   File "/openedx/edx-platform/scripts/compile_sass.py", line 239, in compile_sass_dir
0.508     from _sass import compile_filename  # pylint: disable=protected-access
0.508     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.508 ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /openedx/venv/lib/python3.11/site-packages/_sass.cpython-311-x86_64-linux-gnu.so)
------
Dockerfile:207
--------------------
 205 |     # will be processed. This makes the docker image lighter and faster to build.
 206 |     RUN npm run postinstall  # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.
 207 | >>> RUN npm run compile-sass -- --skip-themes
 208 |     RUN npm run webpack
 209 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c npm run compile-sass -- --skip-themes" did not complete successfully: exit code: 1

Tutor version is 18.2.2.

Has anyone else run into this issue?

Hi @samuelallan, you may want to check out this forum post—it describes a similar issue to yours.

1 Like

Thanks @Abdul_Muqadim , unfortunately I don’t think this is related.

I’m running the correct Tutor version for redwood:

$ tutor --version
tutor, version 18.2.2

Hello @samuelallan , Please find the below details which may helpful to resolve above issue:

For Open edX Redwood with Tutor 18.2.2, the underlying container images are based on Ubuntu 22.04. However, there is defined ubuntu image version at this path:
tutor/env/build/openedx/Dockerfile is ubuntu:20.04 which causes this issue.

So, change/apply patch in Dockerfile in this line:
FROM docker.io/ubuntu:20.04 AS minimal
and change the ubuntu image version to this:
FROM docker.io/ubuntu:22.04 AS minimal

Which is compatible for Redwood and resolves this error.

1 Like

Thanks @meet1 that makes sense.

That fixes the particular libc mismatch error.

It did unveil a further error about a missing package:

 > [python 1/4] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked     --mount=type=cache,target=/var/lib/apt,sharing=locked     apt update &&     apt install -y libssl-dev zlib1g-dev libbz2-dev     libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev     xz-utils tk-dev libffi-dev liblzma-dev python-openssl git:
0.312
0.312 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.312
1.015 Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
1.064 Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
1.253 Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
1.495 Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
1.553 Reading package lists...
2.093 Building dependency tree...
2.206 Reading state information...
2.213 All packages are up to date.
2.220
2.220 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2.220
2.290 Reading package lists...
2.856 Building dependency tree...
2.965 Reading state information...
2.975 E: Unable to locate package python-openssl
------
Dockerfile:17
--------------------
  16 |     # https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites
  17 | >>> RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
  18 | >>>     --mount=type=cache,target=/var/lib/apt,sharing=locked \
  19 | >>>     apt update && \
  20 | >>>     apt install -y libssl-dev zlib1g-dev libbz2-dev \
  21 | >>>     libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
  22 | >>>     xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
  23 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c apt update &&     apt install -y libssl-dev zlib1g-dev libbz2-dev     libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev     xz-utils tk-dev libffi-dev liblzma-dev python-openssl git" did not complete successfully: exit code: 100

I can fix that by changing python-openssl to python3-openssl.

Then I can get it to build by:

tutor images build openedx-dev
tutor dev launch -I --skip-build

Tutor auto regenerates the files under env/ when you run dev launch. So I needed to use --skip-build to not try rebuilding the openedx-dev image, without my temporary changes. EDIT: I could also patch the Dockerfile template in Tutor itself, that made it easier. EDIT2: actually I still need --skip-build, because otherwise I get TypeError: expected string object, got 'Sentinel'.

Then it launches successfully, but there is a runtime error:

lms-1            | RuntimeError: Model class openedx.core.djangoapps.content_libraries.models.ContentLibrary doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

It appears to be the same as Django Installed Apps Error after Quickstart on M1. I can’t try running something in the lms or cms containers, because they’re stuck in restarting status. I’ll have to try the other solution from the thread which is to not use a locally mounted edx-platform…

1 Like

Hello @samuelallan , In that case when your LMS and CMS both are restarting continuously you can just run same command using tutor dev run.

For eg: tutor dev run lms bash -c “cd /openedx/edx-platform && pip install -e .”

Most probably this works in most of the cases, Just try to run it for the LMS and CMS and then restart the services.

1 Like