# Tutor local launch Internal Server Error for url: http://lms:8000/oauth2/access\_token

**URL:** <https://discuss.openedx.org/t/tutor-local-launch-internal-server-error-for-url-http-lms-8000-oauth2-access-token/12486>\
**Category:** Development\
**Created:** [March 9, 2024, 12:33am UTC](https://discuss.openedx.org/t/tutor-local-launch-internal-server-error-for-url-http-lms-8000-oauth2-access-token/12486 "2024-03-09T00:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engr\_James\_Lusuegro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/engr_james_lusuegro/32/4908_2.png) [@Engr\_James\_Lusuegro](https://discuss.openedx.org/u/Engr_James_Lusuegro)\
**Post date:** [March 9, 2024, 12:33am UTC](https://discuss.openedx.org/t/tutor-local-launch-internal-server-error-for-url-http-lms-8000-oauth2-access-token/12486/1 "2024-03-09T00:33:20Z")

</div>

Let me explain it first.  
We are currently on the nutmeg version. Then, we experienced an issue in `tutor image build openedx`.  
The solution to this problem was explained here:  
[Please update your git URLs for edx-platform and several other repos - Announcements - Open edX discussions](https://discuss.openedx.org/t/please-update-your-git-urls-for-edx-platform-and-several-other-repos/12387/2)

However, we are taking too much time in performing this fix, so we considered upgrading instead.  
Upon upgrading from nutmeg to olive and olive to palm, we experienced an error on running the `tutor local launch` command.

```auto
Traceback (most recent call last):
  File "/openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py", line 37, in execute_loader
    run_loader()
  File "/openedx/venv/lib/python3.8/site-packages/backoff/_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
  File "/openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py", line 34, in run_loader
    return loader_class(*loader_args).ingest()
  File "/openedx/discovery/course_discovery/apps/course_metadata/data_loaders/init.py", line 36, in init
    self.username = self.get_username_from_client(self.api_client)
  File "/openedx/discovery/course_discovery/apps/course_metadata/data_loaders/init.py", line 46, in get_username_from_client
    token = client.get_jwt_access_token()
  File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 270, in get_jwt_access_token
    self._ensure_authentication()
  File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 249, in _ensure_authentication
    oauth_access_token_response = get_and_cache_oauth_access_token(
  File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 164, in get_and_cache_oauth_access_token
    oauth_access_token_response = get_oauth_access_token(
  File "/openedx/venv/lib/python3.8/site-packages/edx_rest_api_client/client.py", line 115, in get_oauth_access_token
    response.raise_for_status() # Raise an exception for bad status codes.
  File "/openedx/venv/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://lms:8000/oauth2/access_token

```

It occurred at the point

```auto
CommandError: One or more of the data loaders above failed.
Error: Command failed with status 1: docker compose -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.yml -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.override.yml --project-name tutor_local -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm discovery-job sh -e -c make migrate

# Development partners
./manage.py create_or_update_partner \
  --site-id 1 \
  --site-domain discovery.tmtg-clone.click:8381 \
  --code dev \
  --name "Open edX - development" \
  --lms-url="http://lms:8000" \
  --studio-url="http://cms:8000" \
  --courses-api-url "http://tmtg-clone.click:8000/api/courses/v1/" \
  --organizations-api-url "http://tmtg-clone.click:8000/api/organizations/v1/"

# Production partner
./manage.py create_or_update_partner \
  --site-id 2 \
  --site-domain discovery.tmtg-clone.click \
  --code openedx \
  --name "Open edX" \
  --lms-url="http://lms:8000" \
  --studio-url="http://cms:8000" \
  --courses-api-url "https://tmtg-clone.click/api/courses/v1/" \
  --organizations-api-url "https://tmtg-clone.click/api/organizations/v1/"

./manage.py refresh_course_metadata --partner_code=$DEFAULT_PARTNER_CODE
./manage.py update_index --disable-change-limit

```

---

<div class="post-metadata">

**Author:** ![Engr\_James\_Lusuegro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/engr_james_lusuegro/32/4908_2.png) [@Engr\_James\_Lusuegro](https://discuss.openedx.org/u/Engr_James_Lusuegro)\
**Post date:** [April 17, 2024, 1:56pm UTC](https://discuss.openedx.org/t/tutor-local-launch-internal-server-error-for-url-http-lms-8000-oauth2-access-token/12486/2 "2024-04-17T13:56:30Z")

</div>

UPDATE: Regarding this issue, I managed to bypass this by continuing on upgrading from nutmeg to olive, then olive to palm. However, I experienced another issue.

Here’s the commands I ran (since our version is on binary release, I did it like this):

```auto
# from nutmeg to olive
tutor local stop
sudo curl -L "https://github.com/overhangio/tutor/releases/download/v15.3.7/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor
sudo chmod 0755 /usr/local/bin/tutor
tutor --version

tutor config save
tutor local upgrade --from=nutmeg
tutor local launch

# we have custom overrides on our platform so we removed it for a while
rm -rf $(tutor config printroot)/env/local/docker-compose.override.yml

# from olive to palm
tutor local stop
sudo curl -L "https://github.com/overhangio/tutor/releases/download/v16.0.0/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor
sudo chmod 0755 /usr/local/bin/tutor
tutor --version

```

AT THIS POINT, I cannot run

```auto
tutor config save
tutor images build all
tutor local upgrade --from=olive
tutor local launch

```

because it says an error something about docker or something. I fixed it by applying these [Upgrading tutor to Palm - Site Operators / Tutor Help - Open edX discussions](https://discuss.openedx.org/t/upgrading-tutor-to-palm/10194/18). HOWEVER! Upon running  
`tutor images build all`, I encountered this error:

```auto
Step 11/288 : ADD https://api.github.com/repos/openedx/frontend-app-authn/git/refs/tags/open-release/palm.4 /tmp/gitref-authn
ADD failed: failed to GET https://api.github.com/repos/openedx/frontend-app-authn/git/refs/tags/open-release/palm.4 with status 403 Forbidden: {"message":"API rate limit exceeded for 3.115.138.109. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}
Error: Command failed with status 1: docker build --tag=docker.io/overhangio/openedx-orders-dev:16.1.2 --target=orders-dev /home/ubuntu/.local/share/tutor/env/plugins/mfe/build/mfe

```

CAN SOMEONE PLEASE HELP ME?

---

<div class="post-metadata">

**Author:** ![ABC](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/abc/32/4946_2.png) [@ABC](https://discuss.openedx.org/u/ABC)\
**Post date:** [April 17, 2024, 9:08pm UTC](https://discuss.openedx.org/t/tutor-local-launch-internal-server-error-for-url-http-lms-8000-oauth2-access-token/12486/3 "2024-04-17T21:08:18Z")

</div>

That last error just seems to be a rate limit issue from the process accessing git too fast. Maybe just try again after it was left alone for an hour or so? (Since it says the rate limit is 60 requests per hour.)
