Unexpected EOF while looking for matching `'' when run tutor local quickstart

I am encountering an issue when installing tutor 14.0.5 and 14.1.1 on to ubuntu 20.04 (digitalocean) using docker 20.10.21 and docker-compose 2.12.2.
Can anyone provide a direction to debug this?

I have tried both from source or pip package.
git clone GitHub - overhangio/tutor: The docker-based Open edX distribution designed for peace of mind
cd tutor
git checkout tags/v14.0.5
pip install -e .
pip install “tutor[full]==v14.1.1”

tutor local quickstart (it will pass if disable mfe), will give following error.
(the discussion board only allows new user to put 5 links, so I didn’t show the message before this)

=> [profile 2/3] RUN touch /openedx/env/production.override && echo “ENABLE_LEARNER_RECORD_MFE=‘true’” >> /openedx/ 0.5s
=> ERROR [profile 3/3] RUN bash -c "set -a && source /openedx/env/production && source /openedx/env/production.overri 0.6s

[profile 3/3] RUN bash -c “set -a && source /openedx/env/production && source /openedx/env/production.override && npm run build”:
#0 0.472 /openedx/env/production: line 22: unexpected EOF while looking for matching `‘’
#0 0.472 /openedx/env/production: line 26: syntax error: unexpected end of file

failed to solve: executor failed running [/bin/sh -c bash -c “set -a && source /openedx/env/production && source /openedx/env/production.override && npm run build”]: exit code: 2
Error: Command failed with status 17: docker compose -f /home/user1/.local/share/tutor/env/local/docker-compose.yml -f /home/user1/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/user1/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local up --remove-orphans --build -d

To me, this looks like a configuration mistypes or a corrupt file.

To confirm this, can you start by deleting your configuration file (default location: ~/.local/share/tutor/config.yml) then do another tutor local quickstart? If the problem persists, then it might be a bug with MFE plugin.

Yes there is a know issue for tutor-mfe regarding bash escape hell… The current fix 14.0.1 suppose to fix it for production. But for development it might be buggy but also suppose to work.
Can you tell us whats your mfe version i.e. pip show tutor-mfe

$ pip show tutor-mfe
Name: tutor-mfe
Version: 14.0.1
Summary: mfe plugin for Tutor
Home-page: GitHub - overhangio/tutor-mfe
Author: Overhang.IO
Author-email: None
License: AGPLv3
Location: /home/user1/.local/lib/python3.8/site-packages
Requires: tutor
Required-by: tutor-ecommerce

it is a production build.

The default language code for the platform is zh-tw. if that matters.

This did not make a difference. Thanks for your suggestion.

I suspect it might have something to do with encoding, it seems to me the " might not be in the right foramt… Could you below answer the following questions:

What is The output of the following commad

  • cat "$(tutor config printroot)"/env/plugins/mfe/build/mfe/env/production
  • tutor config printvalue MFE_PROFILE_MFE_APP

$ cat “$(tutor config printroot)”/env/plugins/mfe/build/mfe/env/production
cat: /home/user1/.local/share/tutor/env/plugins/mfe/build/mfe/env/production: No such file or directory

$ tutor config printvalue MFE_PROFILE_MFE_APP
Error: Missing configuration value: MFE_PROFILE_MFE_APP

The above was when disable mfe. if I enable mfe, I got
$ tutor plugins enable mfe
$ tutor config save
$ tutor local quickstart
(language code zh-tw) (en also will fail the same)
(still fail the same way)

$ cat “$(tutor config printroot)”/env/plugins/mfe/build/mfe/env/production

SITE_NAME=Let’''s\ Read

$ tutor config printvalue MFE_PROFILE_MFE_APP
{‘name’: ‘profile’, ‘repository’: ‘https://github.com/edx/frontend-app-profile’, ‘port’: 1995, ‘env’: {‘production’: {‘ENABLE_LEARNER_RECORD_MFE’: ‘true’}}}

Aha, I think as I guess its something realted (, ) which should be replaced with '.

Quick fix:

Manaually replace the occurance of (, ) to ' . This can be done probably by

tutor config save tutor config save  --set MFE_PROFILE_MFE_APP="{'name': 'profile', 'repository': 'https://github.com/edx/frontend-app-profile', 'port': 1995, 'env': {'production': {'ENABLE_LEARNER_RECORD_MFE': 'true'}}}"

You might need to do that for all other MFEs you are using, you just check the content and replace it like above, the default MFEs are MFE_PROFILE_MFE_APP, MFE_ACCOUNT_MFE_APP, MFE_GRADEBOOK_MFE_APP, MFE_LEARNING_MFE_APP, and MFE_PROFILE_MFE_APP.

Lastly regarding the configuration for you in /production I see the value of SITE_NAME has also a weired character, this can be change by config varaible PLATFORM_NAME.

1 Like

Change the SITE_NAME by removing the special character (apostrophe) alone fixed the problem. I really appreciate your help.

1 Like