Replies: 4 comments 4 replies
-
Hi Tigran, This kind of error can happen in some situations where several loops are running, like in unit tests for example. I'm surprised you get this using the full example. Would you mind sharing your code so we can check if there is something wrong? And also give us the command you use to run Uvicorn? For the record, I've setup a working Repl.it using the full example: https://replit.com/@frankie567/fastapi-users-mongodb |
Beta Was this translation helpful? Give feedback.
-
Hello! i am having the same error but in this project i can run it in local with uvicron but when i run in a container using gunicorn it shows up :(
dockerfile: `FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 ADD . /app EXPOSE 8080` main.py: `import os if name == 'main': I also share the dockerfile and the main.py and finally comment that I was trying python 3.7 and 3.9 and I get the same thing. Greetings and thanks Victor PS: I am connected to a database in mongodb atlas |
Beta Was this translation helpful? Give feedback.
-
@victorgerardodominguez did you find any solution on your problem? I have the same error on a server using nginx and guvicorn. |
Beta Was this translation helpful? Give feedback.
-
The issue could also be creating |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thanks for all the work on fastapi-users.
I'm just starting with it, but the road began kind of bumpy :/
I'm running the Full Example posted in the docs and just added a uvicorn to run the app.
when sending a request to auth/jwt/login I get this error:
RuntimeError: Task <Task pending name='Task-15' coro=<RequestResponseCycle.run_asgi() running at /Users/tigrankhazhakyan/dev/playground/fastapi-users/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py:369> cb=[set.discard()]> got Future <Future pending cb=[_chain_future.<locals>._call_check_cancel() at /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/futures.py:360]> attached to a different loop
The error is thrown when awaiting for get_by_email() method
the thing is that I don't explicitly create new loops, so the only existing loop I assume should be the main one.
I tried adding my own loop to motor class constructor, but it didn't change anything.
Can you please help?
Thanks,
Tigran
Beta Was this translation helpful? Give feedback.
All reactions