Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

FastAPI Issue #418

Closed
eyalabadi98 opened this issue Oct 2, 2022 · 3 comments
Closed

FastAPI Issue #418

eyalabadi98 opened this issue Oct 2, 2022 · 3 comments

Comments

@eyalabadi98
Copy link

After installing epsagon on my FastAPI application, I get the following error: (route) got an unexpected keyword argument 'epsagon_request'

My configuration is pretty straight forward:

epsagon.init(
token='token,
app_name='my-app',
metadata_only=False,
)

@ranrib
Copy link
Member

ranrib commented Oct 3, 2022

Hi @eyalabadi98, can you share your fastapi version?
It would also be helpful if you got a reproducible.

@eyalabadi98
Copy link
Author

Hi @ranrib ,

This example causes the issue:

from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException
from starlette.middleware.cors import CORSMiddleware
import uvicorn

import epsagon

epsagon.init(
    token='Test',
    app_name='Test',
    metadata_only=False,
)

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}


def start():
    """Launched with `poetry run start` at root level"""
    uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)

Versions:

python = "^3.9"
epsagon = "^1.81.0"
fastapi = "^0.85.0"
uvicorn = "^0.18.3"

@ranrib
Copy link
Member

ranrib commented Oct 6, 2022

Hi, please add the following env var:
EPSAGON_FASTAPI_ASYNC_MODE=TRUE
This should solve the issue

@ranrib ranrib closed this as completed Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants