microsoft / microsoft/simplechat

500 Internal Server Error on login related to Redis auth

Open
#540 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
152
Forks
116
Avg merge
7h 7m
Merged PRs (30d)
122

Description

I am using SimpleChat with a "custom" Azure_Environment. The start page appears and when I click Login I get an HTTP 500 error, Internal Server Error, on https://appsc.appservice.customdomain/getAToken.

I am using Managed Identity with Redis.

The App Service Log Stream shows no errors.

App Insights has the error:
ClientAuthenticationError
Exception on /robots933456.txt [GET]
Traceback (most recent call last):
File "/app/venv/lib/python3.13/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/app/venv/lib/python3.13/site-packages/flask/app.py", line 1815, in full_dispatch_request
self.ensure_sync(func)()
File "/app/app.py", line 89, in before_first_request
token = credential.get_token(f"https://{redis_hostname}.{REDIS_URL_VALUE}:10225/appid")
15 more lines...

I am using custom endpoints, where REDIS_URL_VALUE equals the App Service environment variable CUSTOM_REDIS_URL_VALUE. I've tried these variations on CUSTOM_REDIS_URL_VALUE to no avail:

  1. cacheinfra.windows.net
  2. cacheinfra.customdomain
  3. cacheinfra.cloudapi.customdomain

At this point, the SimpleChat UI doesn't come up so I can change the Redis auth back to keys.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in /app/app.py at before_first_request, especially the credential.get_token call that builds the Redis endpoint from REDIS_URL_VALUE, and review the custom endpoint values in the issue. Reproduce the custom Azure environment login flow and verify that /getAToken no longer returns HTTP 500 or produces ClientAuthenticationError in App Insights.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, flask, python, redis
Domain
authentication, backend, cloud, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.