Tutor local launch Internal Server Error for url: http://lms:8000/oauth2/access_token

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

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.

Traceback (most recent call last):
  File "/openedx/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py", line 37, in execute_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
  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

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

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):

# 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

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. HOWEVER! Upon running
tutor images build all, I encountered this error:

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 (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


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.)