# Installation Fails for Koa.master, Koa.1 and Koa.2 with "KeyError: 'PREVIEW\_LMS\_BASE'"

**URL:** <https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257>\
**Category:** Site Operations Help\
**Tags:** koa\
**Created:** [February 11, 2021, 1:54pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257 "2021-02-11T13:54:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_Vijayvergia](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/gaurav_vijayvergia/32/1479_2.png) [@Gaurav\_Vijayvergia](https://discuss.openedx.org/u/Gaurav_Vijayvergia)\
**Post date:** [February 11, 2021, 1:54pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257/1 "2021-02-11T13:54:11Z")

</div>

Hi All,

Trying to install koa.1 and koa.2 releases and both are currently failing to installs. Below is the error log. Not sure if anyone else also facing similar issue.

```auto
TASK [edxapp : migrate] ********************************************************
failed: [localhost] (item=lms) => {"ansible_loop_var": "item", "changed": true, "cmd": ["/edx/bin/edxapp-migrate-lms"], "delta": "0:00:00.829617", "end": "2021-02-11 13:48:30.052466", "item": "lms", "msg": "non-zero return code", "rc": 1, "start": "2021-02-11 13:48:29.222849", "stderr": "Traceback (most recent call last):\n File \"manage.py\", line 119, in <module>\n startup = importlib.import_module(edx_args.startup)\n File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/ __init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\n File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/edx/app/edxapp/edx-platform/lms/startup.py\", line 10, in <module>\n settings.INSTALLED_APPS # pylint: disable=pointless-statement\n File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 79, in __getattr__ \n self._setup(name)\n File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 66, in _setup\n self._wrapped = Settings(settings_module)\n File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 157, in __init__ \n mod = importlib.import_module(self.SETTINGS_MODULE)\n File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/ __init__.py\", line 127, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\n File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/edx/app/edxapp/edx-platform/lms/envs/production.py\", line 216, in <module>\n FEATURES['PREVIEW_LMS_BASE'],\nKeyError: 'PREVIEW_LMS_BASE'", "stderr_lines": ["Traceback (most recent call last):", " File \"manage.py\", line 119, in <module>", " startup = importlib.import_module(edx_args.startup)", " File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/ __init__.py\", line 127, in import_module", " return _bootstrap._gcd_import(name[level:], package, level)", " File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import", " File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load", " File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked", " File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked", " File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module", " File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed", " File \"/edx/app/edxapp/edx-platform/lms/startup.py\", line 10, in <module>", " settings.INSTALLED_APPS # pylint: disable=pointless-statement", " File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 79, in __getattr__", " self._setup(name)", " File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 66, in _setup", " self._wrapped = Settings(settings_module)", " File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/conf/ __init__.py\", line 157, in __init__", " mod = importlib.import_module(self.SETTINGS_MODULE)", " File \"/edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/ __init__.py\", line 127, in import_module", " return _bootstrap._gcd_import(name[level:], package, level)", " File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import", " File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load", " File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked", " File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked", " File \"<frozen importlib._bootstrap_external>\", line 783, in exec_module", " File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed", " File \"/edx/app/edxapp/edx-platform/lms/envs/production.py\", line 216, in <module>", " FEATURES['PREVIEW_LMS_BASE'],", "KeyError: 'PREVIEW_LMS_BASE'"], "stdout": "", "stdout_lines": []}
changed: [localhost] => (item=cms)

```

Any pointers will be helpful.

Thanks & Regards  
Gaurav

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [February 11, 2021, 2:10pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257/2 "2021-02-11T14:10:50Z")

</div>

Hi @Gaurav_Vijayvergia,

We’ve done some testing around the new [`koa.2a`](https://discuss.openedx.org/t/koa-2a-has-been-tagged/4250) tag yesterday, and none of us ran into this particular issue. Did you follow the [native installation instructions](https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/1969455764/Koa+Native+Open+edX+platform+Ubuntu+20.04+64+bit+Installation)? If so, did you do anything different? Any settings that are different from the default, perhaps?

---

<div class="post-metadata">

**Author:** ![Gaurav\_Vijayvergia](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/gaurav_vijayvergia/32/1479_2.png) [@Gaurav\_Vijayvergia](https://discuss.openedx.org/u/Gaurav_Vijayvergia)\
**Post date:** [February 11, 2021, 2:18pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257/3 "2021-02-11T14:18:42Z")

</div>

Hi @arbrandes ,

Following the same steps mentioned on native install. This is my config.yml . Not sure if any of the variable might cause this issue.

```auto
EDXAPP_PLATFORM_NAME: 'Demo'
EDXAPP_PLATFORM_DESCRIPTION: 'Demo'

EDXAPP_LMS_BASE_SCHEME: https
EDXAPP_CMS_BASE_SCHEME: https

EDXAPP_LMS_BASE: "dev-ol.demo.com"
EDXAPP_CMS_BASE: "studio.dev-ol.demo.com"
EDXAPP_PREVIEW_LMS_BASE: "preview.dev-ol.demo.com"

INSIGHTS_BASE_URL: "https://insights.dev-ol.demo.com"
EDXAPP_INSIGHTS_HOSTNAME: "https://insights.dev-ol.demo.com"
EDXAPP_ANALYTICS_DASHBOARD_URL: "https://insights.dev-ol.demo.com/courses"

EDXAPP_SESSION_COOKIE_DOMAIN: ".dev-ol.demo.com"

EDXAPP_CSRF_COOKIE_SECURE: true
EDXAPP_SESSION_COOKIE_SECURE: true
EDXAPP_CROSS_DOMAIN_CSRF_COOKIE_DOMAIN: ".dev-ol.demo.com"
EDXAPP_CROSS_DOMAIN_CSRF_COOKIE_NAME: "cross-domain-cookie-mfe"

EDXAPP_CORS_ORIGIN_WHITELIST:
- dev-ol.demo.com
- studio.dev-ol.demo.com
- apps.dev-ol.demo.com
- insights.dev-ol.demo.com
- preview.dev-ol.demo.com

EDXAPP_CSRF_TRUSTED_ORIGINS:
- dev-ol.demo.com
- studio.dev-ol.demo.com
- apps.dev-ol.demo.com
- insights.dev-ol.demo.com

EDXAPP_LOGIN_REDIRECT_WHITELIST:
- dev-ol.demo.com
- studio.dev-ol.demo.com
- apps.dev-ol.demo.com
- insights.dev-ol.demo.com

EDXAPP_LMS_WRITABLE_GRADEBOOK_URL: https://apps.dev-ol.demo.com/gradebook

EDXAPP_PROFILE_MICROFRONTEND_URL: https://apps.dev-ol.demo.com/profile/u/

EDXAPP_ACCOUNT_MICROFRONTEND_URL: https://apps.dev-ol.demo.com/account

EDXAPP_ENABLE_OAUTH2_PROVIDER: true

EDXAPP_LMS_SSL_NGINX_PORT: 443
EDXAPP_CMS_SSL_NGINX_PORT: 443

EDXAPP_ENABLE_CORS_HEADERS: true
EDXAPP_ENABLE_CROSS_DOMAIN_CSRF_COOKIE: true

NGINX_ENABLE_SSL: yes

NGINX_SSL_CERTIFICATE: '/etc/letsencrypt/live/fullchain.pem'
NGINX_SSL_KEY: '/etc/letsencrypt/live/privkey.pem'

MFE_BASE_SCHEMA: https
MFE_DEPLOY_COMMON_HOSTNAME: "apps.dev-ol.demo.com"

EDXAPP_EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
EDXAPP_EMAIL_HOST: 'email-smtp.ap-southeast-1.amazonaws.com'
EDXAPP_EMAIL_PORT: 587
EDXAPP_EMAIL_USE_TLS: true
EDXAPP_EMAIL_HOST_USER: 'xx'
EDXAPP_EMAIL_HOST_PASSWORD: 'xxx'
EDXAPP_DEFAULT_FROM_EMAIL: 'test@test.com'
EDXAPP_FEATURES_DEFAULT:
  ENABLE_OAUTH2_PROVIDER: true
  CUSTOM_COURSES_EDX: true
EDXAPP_LMS_SITE_NAME: "dev-ol.demo.com"
EDXAPP_CMS_SITE_NAME: 'dev-ol.demo.com'
EDXAPP_INSTALL_PRIVATE_REQUIREMENTS: true

```

Thanks & Regards  
Gaurav

---

<div class="post-metadata">

**Author:** ![arbrandes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/arbrandes/32/158_2.png) [@arbrandes](https://discuss.openedx.org/u/arbrandes)\
**Post date:** [February 11, 2021, 3:25pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257/4 "2021-02-11T15:25:14Z")

</div>

> [@Gaurav\_Vijayvergia](#):
>
> EDXAPP\_PREVIEW\_LMS\_BASE: “[preview.dev-ol.demo.com](http://preview.dev-ol.demo.com)”

Have you tried simply not setting this variable?

---

<div class="post-metadata">

**Author:** ![Gaurav\_Vijayvergia](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/gaurav_vijayvergia/32/1479_2.png) [@Gaurav\_Vijayvergia](https://discuss.openedx.org/u/Gaurav_Vijayvergia)\
**Post date:** [February 11, 2021, 9:17pm UTC](https://discuss.openedx.org/t/installation-fails-for-koa-master-koa-1-and-koa-2-with-keyerror-preview-lms-base/4257/5 "2021-02-11T21:17:05Z")

</div>

Hi @arbrandes ,

Yes i already tried that. Finally manage to fix the installation issue. This property causes the actual issue. After removing it , the installation was successful.

```
EDXAPP_FEATURES_DEFAULT:
   ENABLE_OAUTH2_PROVIDER: true
   CUSTOM_COURSES_EDX: true

```

Thanks & Regards  
Gaurav
