The Kelvin API returns 204 for a successful DELETE operation. The returned body must be empty, and we do not return anything. But still there is an error logged: --------------------------------------------------------------------------- 2021-02-17 12:40:36 INFO 172.17.42.1:33944 - "DELETE /ucsschool/kelvin/v1/classes/dummy/dummyclass HTTP/1.1" 204 2021-02-17 12:40:36 ERROR Exception in ASGI application Traceback (most recent call last): File "/kelvin/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 389, in run_asgi result = await app(self.scope, self.receive, self.send) File "/kelvin/venv/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__ return await self.app(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/fastapi/applications.py", line 140, in __call__ await super().__call__(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/applications.py", line 134, in __call__ await self.error_middleware(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 178, in __call__ raise exc from None File "/kelvin/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 156, in __call__ await self.app(scope, receive, _send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/exceptions.py", line 73, in __call__ raise exc from None File "/kelvin/venv/lib/python3.8/site-packages/starlette/exceptions.py", line 62, in __call__ await self.app(scope, receive, sender) File "/kelvin/venv/lib/python3.8/site-packages/starlette/routing.py", line 590, in __call__ await route(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/routing.py", line 208, in __call__ await self.app(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/routing.py", line 44, in app await response(scope, receive, send) File "/kelvin/venv/lib/python3.8/site-packages/starlette/responses.py", line 128, in __call__ await send({"type": "http.response.body", "body": self.body}) File "/kelvin/venv/lib/python3.8/site-packages/starlette/exceptions.py", line 59, in sender await send(message) File "/kelvin/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 153, in _send await send(message) File "/kelvin/venv/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 483, in send output = self.conn.send(event) File "/kelvin/venv/lib/python3.8/site-packages/h11/_connection.py", line 469, in send data_list = self.send_with_data_passthrough(event) File "/kelvin/venv/lib/python3.8/site-packages/h11/_connection.py", line 502, in send_with_data_passthrough writer(event, data_list.append) File "/kelvin/venv/lib/python3.8/site-packages/h11/_writers.py", line 78, in __call__ self.send_data(event.data, write) File "/kelvin/venv/lib/python3.8/site-packages/h11/_writers.py", line 98, in send_data raise LocalProtocolError("Too much data for declared Content-Length") h11._util.LocalProtocolError: Too much data for declared Content-Length --------------------------------------------------------------------------- This is not a functional problem but produces insecurity for customers.
Found the fix in https://github.com/tiangolo/fastapi/issues/2253 [feature/kelvin e84c63d2b] Bug #52896: fix error message after delete operation Included is a changelog entry for version 1.4.1.
QA → All OK → Verify - inspected code in the commmit - created user and class through the UI - started the fastapi server manually - deleted the user and class through the kelvin api, got the mentioned errors - mirrored in the fixed code, restarted server - devsynced the source dir kelvin-api, linked in the missing static dir - created and deleted users and class, no errors in the server
Version 1.4.1 of the Kelvin REST API has been released.