Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in ASGI application at /api/v2/farms/[id] #117

Open
mstenta opened this issue May 6, 2022 · 1 comment
Open

Exception in ASGI application at /api/v2/farms/[id] #117

mstenta opened this issue May 6, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@mstenta
Copy link
Member

mstenta commented May 6, 2022

Noticed today that browsing (through the frontend UI in browser) to the /main/farm/farms/edit/[id] endpoint causes the following error in the backend service:

172.18.0.5:33248 - "GET /api/v2/farms/12 HTTP/1.0" 500
[2022-05-06 14:44:40 +0000] [10] [ERROR] Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 367, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 208, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 61, in app
    response = await func(request)
  File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 234, in app
    response_data = await serialize_response(
  File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 137, in serialize_response
    raise ValidationError(errors, field.type_)
pydantic.error_wrappers.ValidationError: 3 validation errors for AllFarmInfo
response -> info -> name
  field required (type=value_error.missing)
response -> info -> url
  field required (type=value_error.missing)
response -> info -> api_version
  field required (type=value_error.missing)

The farm in question (id: 12) DOES have name, url, and api_version in the database.

@mstenta mstenta added the bug Something isn't working label May 6, 2022
@mstenta
Copy link
Member Author

mstenta commented May 6, 2022

The same error occurs when making the API call directly:

curl -X 'GET' \
  'https://surveystack.farmos.group/api/v2/farms/12' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer [redacted]'

@mstenta mstenta changed the title Exception in ASGI application when viewing /main/farm/farms/edit/[id] Exception in ASGI application at /api/v2/farms/[id] Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant