To learn ray I’m following along this tutorial:
After successful deployment of it into my K8s based ray cluster (using the official helm chart) I was wondering how I can craft a valid HTTP request towards it.
It expects a GET request, but sending it like
curl "http://127.0.0.1:8080/generate?query=Hello%20friend%2C%20how"
gives back:
Internal Server Error
Looking at the logs of the webserver / FastAPI logs shows:
[2021-06-28 08:44:06 +0000] [8] [ERROR] Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 398, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/applications.py", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 580, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 241, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 52, in app
response = await func(request)
File "/usr/local/lib/python3.7/site-packages/fastapi/routing.py", line 231, in app
is_coroutine=is_coroutine,
File "/usr/local/lib/python3.7/site-packages/fastapi/routing.py", line 138, in serialize_response
return jsonable_encoder(response_content)
File "/usr/local/lib/python3.7/site-packages/fastapi/encoders.py", line 149, in jsonable_encoder
sqlalchemy_safe=sqlalchemy_safe,
File "/usr/local/lib/python3.7/site-packages/fastapi/encoders.py", line 96, in jsonable_encoder
sqlalchemy_safe=sqlalchemy_safe,
File "/usr/local/lib/python3.7/site-packages/fastapi/encoders.py", line 127, in jsonable_encoder
return ENCODERS_BY_TYPE[type(obj)](obj)
File "pydantic/json.py", line 51, in pydantic.json.lambda
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 2: invalid continuation byte
I’m pretty sure I am sending the request in a wrong format here - but I am unsure how to debug this further.