From 00c58e7a9ed143f24e9cac3bbac3287d891d9d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 13 Sep 2023 11:01:04 +0200 Subject: [PATCH] chore: upgrade nodeenv to fix nodejs install We upgrade nodeenv as an attempt to fix incomplete reads. From time to time we face the following error: #67 [linux/amd64 nodejs-requirements 2/4] RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt #67 0.338 * Install prebuilt node (16.14.0) .Incomplete read while readingfrom https://nodejs.org/download/release/v16.14.0/node-v16.14.0-linux-x64.tar.gz #67 204.1 . #67 204.1 Traceback (most recent call last): #67 204.1 File "/openedx/venv/bin/nodeenv", line 8, in #67 204.1 sys.exit(main()) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 1104, in main #67 204.1 create_environment(env_dir, args) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 980, in create_environment #67 204.1 install_node(env_dir, src_dir, args) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 739, in install_node #67 204.1 install_node_wrapped(env_dir, src_dir, args) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 762, in install_node_wrapped #67 204.1 download_node_src(node_url, src_dir, args) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 602, in download_node_src #67 204.1 with ctx as archive: #67 204.1 File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 113, in __enter__ #67 204.1 return next(self.gen) #67 204.1 File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 573, in tarfile_open #67 204.1 tf = tarfile.open(*args, **kwargs) #67 204.1 File "/opt/pyenv/versions/3.8.15/lib/python3.8/tarfile.py", line 1601, in open #67 204.1 saved_pos = fileobj.tell() #67 204.1 AttributeError: 'bytes' object has no attribute 'tell' This change was added to 1.8.0 as an attempt to resolve the issue: https://github.com/ekalinin/nodeenv/pull/329 We are not sure it will work every time, but it can't hurt. --- tutor/templates/build/openedx/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index f515550b66..7475926521 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -120,7 +120,7 @@ ENV PATH /openedx/nodeenv/bin:/openedx/venv/bin:${PATH} # Install nodeenv with the version provided by edx-platform # https://github.com/openedx/edx-platform/blob/master/requirements/edx/base.txt # https://github.com/pyenv/pyenv/releases -RUN pip install nodeenv==1.7.0 +RUN pip install nodeenv==1.8.0 RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt # Install nodejs requirements