Unable to install Xblocks or rebuild docker image

In a thread here I have been trying to figure out how to install the IBL Education Jupyter NB Viewer xblock. The instructions are to do:

/edx/bin/pip.edxapp install git+https://github.com/ibleducation/jupyter-viewer-xblock.git

but I receive this error:
-bash: /edx/bin/pip.edxapp: No such file or directory
I then try:

sudo -H -u edxapp bash
source ~/edxapp_env
pip install git+https://github.com/ibleducation/jupyter-viewer-xblock.git

but after the first line I receive this error:
sudo: unknown user: edxapp
sudo: unable to initialize policy plugin

Just as a test, I am able to do:

echo "git+https://github.com/open-craft/xblock-poll.git" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt"`

but when I try to rebuild the docker image with:
tutor images build openedx
I get this error:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=docker.io%2Foverhangio%2Fopenedx%3A11.1.3&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied

Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:11.1.3 /home/ubuntu/.local/share/tutor/env/build/openedx

I next tried:
tutor config save --interactive
and went through the steps that followed with no issue. But the same error persists when I try to install the IBL xblock. When I install the opencraft text xblock and then do:
sudo tutor images build openedx
I get this error:

Error: Project root does not exist. Make sure to generate the initial configuration with `tutor config save --interactive` or `tutor local quickstart` prior to running other commands.

which is the step that I just completed.

This is a totally default, brand-new install of Tutor on AWS EC2. Any help would be appreciated.

Hi @wjkowalski! In the EC2 AMI all commands should be run as user “tutor”. Thus, prior to any command, you should run:

sudo su tutor

And then:

echo "git+https://github.com/open-craft/xblock-poll.git" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt"`
 tutor images build openedx
tutor local start -d

Hi @regis and thanks, but still having issues.
After I do: sudo su tutor
And then I do:

echo "git+https://github.com/open-craft/xblock-poll.git" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt"

so far so good, and then: tutor images build openedx

results in this error:

Collecting psutil==5.7.3

Downloading psutil-5.7.3.tar.gz (465 kB)

ERROR: Could not find a version that satisfies the requirement py2neo==3.1.2 (from -r ./requirements/edx/base.txt (line 178)) (from versions: 4.0.0, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.2.0, 4.3.0, 2020.0.0, 2020.1.0, 2020.1.1, 2021.0.0, 2021.0.1, 2021.1.0, 2021.1.1, 2021.1.2, 2021.1.3, 2021.1.4, 2021.1.5)

ERROR: No matching distribution found for py2neo==3.1.2 (from -r ./requirements/edx/base.txt (line 178))

WARNING: You are using pip version 20.0.2; however, version 21.1.3 is available.

You should consider upgrading via the '/openedx/venv/bin/python -m pip install --upgrade pip' command.

The command '/bin/sh -c pip install -r ./requirements/edx/base.txt' returned a non-zero code: 1

Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:11.1.3 /home/tutor/.local/share/tutor/env/build/openedx

Any thoughts?

Right. Unfortunately this error started to appear a couple months ago and was only fixed in v11.2.5. I suggest you upgrade:

sudo systemctl stop tutor-webui
sudo curl -L "https://github.com/overhangio/tutor/releases/download/v11.3.1/tutor-Linux_x86_64" -o /usr/local/bin/tutor
sudo chmod +x /usr/local/bin/tutor
sudo systemctl restart tutor-webui
tutor local quickstart -I 

The upgrade went smoothly. I then did:

echo "git+https://github.com/open-craft/xblock-poll.git" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt"

and receive no output, which I think is normal. But then when I do:
tutor images build openedx
This is the result:

Step 57/90 : COPY --from=python-requirements /openedx/venv /openedx/venv
failed to copy files: failed to copy directory: Error processing tar file(exit status 1): write /lib/python3.8/site-packages/sympy/categories/diagram_drawing.py: no space left on device
Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:11.3.1 /home/tutor/.local/share/tutor/env/build/openedx

In case “No space left on device” refers to my EC2 instance, I did follow your recommendation and get a t3a.large instance.

You should clear some space before you can try again. For instance, you can clear unused images and containers:

docker system prune

I ran docker system prune and gained almost 5 GB. I have literally nothing else on this server except tutor, but I’m still getting the same error.

Step 57/90 : COPY --from=python-requirements /openedx/venv /openedx/venv
Error processing tar file(exit status 1): write /openedx/venv/lib/python3.8/site-packages/urllib3/contrib/__pycache__/securetransport.cpython-38.pyc: no space left on device
Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:11.3.1 /home/tutor/.local/share/tutor/env/build/openedx

Hi again @regis, I see you have released a new update of tutor just now. I attempted to download and install the upgrade both using cURL and pip install and again got the no space on device error. At this point maybe it makes more sense for me just to wipe the entire AWS server and just reinstall this latest version of tutor. We won’t lose anything. However, as a noob, it’s not quite clear to me how to do that. Can you help with that?

@regis I have terminated that first instance and started another one. Now I’m receiving this error from the web UI:

Error: No such command 'ui'.

It is then impossible to enter any commands. This error does not appear in your troubleshooting section. What is the best thing to do here please? I really need to get this up and running.

I was finally able to resolve this with a fresh install of Tutor on a new instance, although I am still getting the Error: No such command 'ui'.

@wjkowalski That ui error was due to an older release of the webui plugin. You should upgrade your Tutor installation to get the latest fix.

A post was split to a new topic: “Unable to load XBlock” error

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