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 .
or
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: This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor.
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

ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
BASE_URL=apps.mysite.com
CSRF_TOKEN_API_PATH=/csrf/api/v1/token
CREDENTIALS_BASE_URL=
DISCOVERY_API_BASE_URL=
ECOMMERCE_BASE_URL=
ENABLE_NEW_RELIC=false
FAVICON_URL=https://mysite.com/favicon.ico
LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
LMS_BASE_URL=https://mysite.com
LOGIN_URL=https://mysite.com/login
LOGO_URL=https://mysite.com/theming/asset/images/logo.png
LOGO_TRADEMARK_URL=https://mysite.com/theming/asset/images/logo.png
LOGO_WHITE_URL=
LOGOUT_URL=https://mysite.com/logout
MARKETING_SITE_BASE_URL=https://mysite.com
NODE_ENV=production
PUBLISHER_BASE_URL=
REFRESH_ACCESS_TOKEN_ENDPOINT=https://mysite.com/login_refresh
SEGMENT_KEY=
SITE_NAME=Let’''s\ Read
STUDIO_BASE_URL=https://studio.mysite.com
USER_INFO_COOKIE_NAME=user-info

$ 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