Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'get' #7586

Closed
MarcSkovMadsen opened this issue Jan 5, 2025 · 1 comment
Closed

AttributeError: 'NoneType' object has no attribute 'get' #7586

MarcSkovMadsen opened this issue Jan 5, 2025 · 1 comment
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

panel==1.5.5

I'm trying to configure azure oauth. Its hard for me to understand how to configure the azure side.

But I do currently see a bug in Panel

Traceback (most recent call last):
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/panel/auth.py", line 225, in _fetch_access_token
    response = await http.fetch(req)
               ^^^^^^^^^^^^^^^^^^^^^
tornado.httpclient.HTTPClientError: HTTP 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
    result = await result
             ^^^^^^^^^^^^
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/panel/auth.py", line 391, in get
    user = await self.get_authenticated_user(**params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/panel/auth.py", line 141, in get_authenticated_user
    user, _, _, _ = await self._fetch_access_token(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/panel/auth.py", line 228, in _fetch_access_token
    self._raise_error(e.response, status=401)
  File "/home/jovyan/repos/mt-ai-assistant/.venv/lib/python3.11/site-packages/panel/auth.py", line 455, in _raise_error
    body.get('error_description', str(body)),
    ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

I do believe the Panel code does not handle the 401 error and body==None well:

Image

@philippjfr
Copy link
Member

Fixed in #7587

@philippjfr philippjfr added this to the v1.6.0 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants