casdoor / casdoor-python-sdk

Python client SDK for Casdoor
https://pypi.org/project/casdoor
Apache License 2.0
32 stars 33 forks source link

Unclosed client session #86

Closed CHEN-Jing194 closed 1 week ago

CHEN-Jing194 commented 1 week ago
File "/root/cms4_be/apps/modules/auth/router.py", line 66, in user_info
    data = await sdk.get_user(user["name"])
  File "/usr/local/lib/python3.10/site-packages/casdoor/async_main.py", line 354, in get_user
    async with self._session as session:
  File "/usr/local/lib/python3.10/site-packages/casdoor/async_main.py", line 52, in __aexit__
    raise exc_val
  File "/usr/local/lib/python3.10/site-packages/casdoor/async_main.py", line 355, in get_user
    user = await session.get(path, headers=self.headers, params=params)
  File "/usr/local/lib/python3.10/site-packages/casdoor/async_main.py", line 40, in get
    return await self.fetch(path, method="GET", **kwargs)
  File "/usr/local/lib/python3.10/site-packages/casdoor/async_main.py", line 34, in fetch
    async with self.session.request(method, url, **kwargs) as response:
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 976, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 640, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
[2024-06-26 22:01:38 +0800] [2480482]: [ERROR] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f3f6d78a8f0>

What is the problem? Is it an issue with my server or with the source code?

casbin-bot commented 1 week ago

@tangyang9464 @JalinWang @imp2002

hsluoyz commented 1 week ago

@CHEN-Jing194 it's more of your Casdoor server issue