Skip to content

GH Auth fails #187

@dyakovri

Description

@dyakovri

Вхожные

{
    "thread": 6,
    "timestamp": "2024-06-21T18:12:37+00:00",
    "level": 40,
    "level_name": "ERROR",
    "message": "{'login': '<hidden>', 'id': 13213573, 'node_id': '<hidden>', 'avatar_url': 'https://avatars.githubusercontent.com/u/<hidden>?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/<hidden>', 'html_url': 'https://github.com/<hidden>', 'followers_url': 'https://api.github.com/users/<hidden>/followers', 'following_url': 'https://api.github.com/users/<hidden>/following{/other_user}', 'gists_url': 'https://api.github.com/users/<hidden>/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/<hidden>/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/<hidden>/subscriptions', 'organizations_url': 'https://api.github.com/users/<hidden>/orgs', 'repos_url': 'https://api.github.com/users/<hidden>/repos', 'events_url': 'https://api.github.com/users/<hidden>/events{/privacy}', 'received_events_url': 'https://api.github.com/users/<hidden>/received_events', 'type': 'User', 'site_admin': False, 'name': '<hidden>', 'company': None, 'blog': '<hidden>', 'location': None, 'email': '<hidden>', 'hireable': None, 'bio': None, 'twitter_username': None, 'public_repos': 9, 'public_gists': 1, 'followers': 6, 'following': 13, 'created_at': '2015-07-07T05:30:59Z', 'updated_at': '2024-06-16T10:08:39Z', 'private_gists': 1, 'total_private_repos': 10, 'owned_private_repos': 8, 'disk_usage': 612, 'collaborators': 1, 'two_factor_authentication': True, 'plan': {'name': 'free', 'space': <hidden>, 'collaborators': 0, 'private_repos': 10000}}",
    "source": "auth_backend.auth_plugins.github",
    "duration_ms": 948.0,
    "func": "_login",
    "file": "github.py"
}
{
    "thread": 6,
    "timestamp": "2024-06-21T18:12:39+00:00",
    "level": 40,
    "level_name": "ERROR",
    "message": "Exception in ASGI application\n",
    "source": "uvicorn.error",
    "duration_ms": 224.0,
    "func": "run_asgi",
    "file": "httptools_impl.py",
    "exceptions": [
        "  + Exception Group Traceback (most recent call last):\n",
        "  |   File \"/usr/local/lib/python3.11/site-packages/starlette/_utils.py\", line 87, in collapse_excgroups\n  |     yield\n",
        "  |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 190, in __call__\n  |     async with anyio.create_task_group() as task_group:\n",
        "  |   File \"/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py\", line 680, in __aexit__\n  |     raise BaseExceptionGroup(\n",
        "  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)\n",
        "  +-+---------------- 1 ----------------\n",
        "    | Traceback (most recent call last):\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py\", line 399, in run_asgi\n    |     result = await app(  # type: ignore[func-returns-value]\n    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py\", line 70, in __call__\n    |     return await self.app(scope, receive, send)\n    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/fastapi/applications.py\", line 1054, in __call__\n    |     await super().__call__(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/applications.py\", line 123, in __call__\n    |     await self.middleware_stack(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py\", line 186, in __call__\n    |     raise exc\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py\", line 164, in __call__\n    |     await self.app(scope, receive, _send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py\", line 93, in __call__\n    |     await self.simple_response(scope, receive, send, request_headers=headers)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py\", line 148, in simple_response\n    |     await self.app(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 189, in __call__\n    |     with collapse_excgroups():\n",
        "    |   File \"/usr/local/lib/python3.11/contextlib.py\", line 158, in __exit__\n    |     self.gen.throw(typ, value, traceback)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/_utils.py\", line 93, in collapse_excgroups\n    |     raise exc\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 191, in __call__\n    |     response = await self.dispatch_func(request, call_next)\n    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/fastapi_sqlalchemy/middleware.py\", line 44, in dispatch\n    |     response = await call_next(request)\n    |                ^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 165, in call_next\n    |     raise app_exc\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 151, in coro\n    |     await self.app(scope, receive_or_disconnect, send_no_error)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py\", line 65, in __call__\n    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    |     raise exc\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    |     await app(scope, receive, sender)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 756, in __call__\n    |     await self.middleware_stack(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 776, in app\n    |     await route.handle(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 297, in handle\n    |     await self.app(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 77, in app\n    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    |     raise exc\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    |     await app(scope, receive, sender)\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 72, in app\n    |     response = await func(request)\n    |                ^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/fastapi/routing.py\", line 278, in app\n    |     raw_response = await run_endpoint_function(\n    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/usr/local/lib/python3.11/site-packages/fastapi/routing.py\", line 191, in run_endpoint_function\n    |     return await dependant.call(**values)\n    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "    |   File \"/app/auth_backend/auth_plugins/github.py\", line 93, in _register\n    |     github_user_id = userinfo['user_id']\n    |                      ~~~~~~~~^^^^^^^^^^^\n",
        "    | KeyError: 'user_id'\n",
        "    +------------------------------------\n",
        "\nDuring handling of the above exception, another exception occurred:\n\n",
        "Traceback (most recent call last):\n",
        "  File \"/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py\", line 399, in run_asgi\n    result = await app(  # type: ignore[func-returns-value]\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py\", line 70, in __call__\n    return await self.app(scope, receive, send)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/fastapi/applications.py\", line 1054, in __call__\n    await super().__call__(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/applications.py\", line 123, in __call__\n    await self.middleware_stack(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py\", line 186, in __call__\n    raise exc\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py\", line 164, in __call__\n    await self.app(scope, receive, _send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py\", line 93, in __call__\n    await self.simple_response(scope, receive, send, request_headers=headers)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py\", line 148, in simple_response\n    await self.app(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 189, in __call__\n    with collapse_excgroups():\n",
        "  File \"/usr/local/lib/python3.11/contextlib.py\", line 158, in __exit__\n    self.gen.throw(typ, value, traceback)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/_utils.py\", line 93, in collapse_excgroups\n    raise exc\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 191, in __call__\n    response = await self.dispatch_func(request, call_next)\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/fastapi_sqlalchemy/middleware.py\", line 44, in dispatch\n    response = await call_next(request)\n               ^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 165, in call_next\n    raise app_exc\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py\", line 151, in coro\n    await self.app(scope, receive_or_disconnect, send_no_error)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py\", line 65, in __call__\n    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    raise exc\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    await app(scope, receive, sender)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 756, in __call__\n    await self.middleware_stack(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 776, in app\n    await route.handle(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 297, in handle\n    await self.app(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 77, in app\n    await wrap_app_handling_exceptions(app, request)(scope, receive, send)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 64, in wrapped_app\n    raise exc\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py\", line 53, in wrapped_app\n    await app(scope, receive, sender)\n",
        "  File \"/usr/local/lib/python3.11/site-packages/starlette/routing.py\", line 72, in app\n    response = await func(request)\n               ^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/fastapi/routing.py\", line 278, in app\n    raw_response = await run_endpoint_function(\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/usr/local/lib/python3.11/site-packages/fastapi/routing.py\", line 191, in run_endpoint_function\n    return await dependant.call(**values)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
        "  File \"/app/auth_backend/auth_plugins/github.py\", line 93, in _register\n    github_user_id = userinfo['user_id']\n                     ~~~~~~~~^^^^^^^^^^^\n",
        "KeyError: 'user_id'\n"
    ]
}

Metadata

Metadata

Assignees

Labels

bug 🐞Что-то не работает

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions