You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
500 Errors in Fidesops are hard to debug without turning off fideslog logging, because we get a RuntimeError: asyncio.run() cannot be called from a running event loop error from fideslog.
/usr/local/lib/python3.9/site-packages/requests/sessions.py:659: in patch
return self.request("PATCH", url, data=data, **kwargs)
/usr/local/lib/python3.9/site-packages/starlette/testclient.py:476: in request
return super().request(
/usr/local/lib/python3.9/site-packages/requests/sessions.py:587: in request
resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.9/site-packages/requests/sessions.py:701: in send
r = adapter.send(request, **kwargs)
/usr/local/lib/python3.9/site-packages/starlette/testclient.py:270: in send
raise exc
/usr/local/lib/python3.9/site-packages/starlette/testclient.py:267: in send
portal.call(self.app, scope, receive, send)
/usr/local/lib/python3.9/site-packages/anyio/from_thread.py:283: in call
return cast(T_Retval, self.start_task_soon(func, *args).result())
/usr/local/lib/python3.9/concurrent/futures/_base.py:446: in result
return self.__get_result()
/usr/local/lib/python3.9/concurrent/futures/_base.py:391: in __get_result
raise self._exception
/usr/local/lib/python3.9/site-packages/anyio/from_thread.py:219: in _call_func
retval = await retval
/usr/local/lib/python3.9/site-packages/fastapi/applications.py:269: in __call__
await super().__call__(scope, receive, send)
/usr/local/lib/python3.9/site-packages/starlette/applications.py:124: in __call__
await self.middleware_stack(scope, receive, send)
/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py:184: in __call__
raise exc
/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py:162: in __call__
await self.app(scope, receive, _send)
/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py:68: in __call__
response = await self.dispatch_func(request, call_next)
src/fidesops/main.py:77: in dispatch_log_request
prepare_and_log_request(
src/fidesops/main.py:100: in prepare_and_log_request
send_analytics_event(
src/fidesops/analytics.py:43: in send_analytics_event
analytics_client.send(event)
/usr/local/lib/python3.9/site-packages/fideslog/sdk/python/client.py:88: in send
run(self.__send(event))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
main = <coroutine object AnalyticsClient.__send at 0x4031765ac0>
def run(main, *, debug=None):
"""Execute the coroutine and return the result.
This function runs the passed coroutine, taking care of
managing the asyncio event loop and finalizing asynchronous
generators.
This function cannot be called when another asyncio event loop is
running in the same thread.
If debug is True, the event loop will be run in debug mode.
This function always creates a new event loop and closes it at the end.
It should be used as a main entry point for asyncio programs, and should
ideally only be called once.
Example:
async def main():
await asyncio.sleep(1)
print('hello')
asyncio.run(main())
"""
if events._get_running_loop() is not None:
> raise RuntimeError(
"asyncio.run() cannot be called from a running event loop")
E RuntimeError: asyncio.run() cannot be called from a running event loop
Steps to Reproduce
Do this...
Then This...
Expected behavior
A description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Version:
OS:
Python Version:
Docker Version:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@pattisdr can you please provide more context in the issue description? What is the usage of the .send() method in your codebase that's causing this exception to be raised? How can I reproduce this?
@PSalant726, this wasn't calling out a specific usage per se, just if the fidesops API encounters an unhandled exception, this is the trace you will get now, instead of the actual exception. So I see this now during development when I'm working out my edge cases, but users can get 500's too if they stumble onto something we haven't handled.
To duplicate, I'd take any fidesops endpoint, add {}["hi"] anywhere in the view to force a KeyError, and then ping that endpoint and check your fidesops container.
Bug Description
500 Errors in Fidesops are hard to debug without turning off
fideslog
logging, because we get aRuntimeError: asyncio.run() cannot be called from a running event loop
error fromfideslog
.Steps to Reproduce
Expected behavior
A description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: