8000 Handling 500 Errors · Issue #71 · ethyca/fideslog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Handling 500 Errors #71
Open
Open
@pattisdr

Description

@pattisdr

Bug Description

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

  1. Do this...
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0