-
Notifications
You must be signed in to change notification settings - Fork 230
Too much data for declared Content-Length #1348
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem description
I am getting this error every 100 requests or so
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.14/site-packages/fastapi/routing.py", line 116, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/fastapi/routing.py", line 670, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/usr/local/lib/python3.14/site-packages/fastapi/routing.py", line 326, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/starlette/concurrency.py", line 32, in run_in_threadpool
return await anyio.to_thread.run_sync(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/anyio/to_thread.py", line 63, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
func, args, abandon_on_cancel=abandon_on_cancel, limiter=limiter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/anyio/_backends/_asyncio.py", line 2502, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/anyio/_backends/_asyncio.py", line 986, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.14/site-packages/titiler/mosaic/factory.py", line 632, in tile
image, assets = src_dst.tile(
~~~~~~~~~~~~^
x,
^^
...<8 lines>...
**dataset_params.as_dict(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/rio_tiler/mosaic/backend.py", line 172, in tile
img, asset_used = mosaic_reader(mosaic_assets, _reader, x, y, z, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/rio_tiler/mosaic/reader.py", line 151, in mosaic_reader
raise EmptyMosaicError("Method returned an empty array")
rio_tiler.errors.EmptyMosaicError: Method returned an empty array
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/uvicorn/protocols/http/h11_impl.py", line 410, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.scope, self.receive, self.send
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/fastapi/applications.py", line 1160, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/applications.py", line 107, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/errors.py", line 186, in __call__
raise exc
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/errors.py", line 164, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.14/site-packages/titiler/core/middleware.py", line 56, in __call__
await self.app(scope, receive, send_wrapper)
File "/usr/local/lib/python3.14/site-packages/starlette_cramjam/middleware.py", line 121, in __call__
await responder(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette_cramjam/middleware.py", line 151, in __call__
await self.app(scope, receive, self.send_with_compression)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/cors.py", line 87, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.14/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/routing.py", line 716, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/routing.py", line 736, in app
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/routing.py", line 290, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/fastapi/routing.py", line 130, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 63, in wrapped_app
await response(scope, receive, sender)
File "/usr/local/lib/python3.14/site-packages/starlette/responses.py", line 164, in __call__
await send({"type": prefix + "http.response.body", "body": self.body})
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.14/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.14/site-packages/starlette_cramjam/middleware.py", line 188, in send_with_compression
await self.send(message)
File "/usr/local/lib/python3.14/site-packages/titiler/core/middleware.py", line 54, in send_wrapper
await send(message)
File "/usr/local/lib/python3.14/site-packages/starlette/middleware/errors.py", line 161, in _send
await send(message)
File "/usr/local/lib/python3.14/site-packages/uvicorn/protocols/http/h11_impl.py", line 507, in send
output = self.conn.send(event=h11.Data(data=data))
File "/usr/local/lib/python3.14/site-packages/h11/_connection.py", line 538, in send
data_list = self.send_with_data_passthrough(event)
File "/usr/local/lib/python3.14/site-packages/h11/_connection.py", line 571, in send_with_data_passthrough
writer(event, data_list.append)
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/h11/_writers.py", line 65, in __call__
self.send_data(event.data, write)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/h11/_writers.py", line 91, in send_data
raise LocalProtocolError("Too much data for declared Content-Length")
h11._util.LocalProtocolError: Too much data for declared Content-Length
Environment Information
tiles_server:
image: ghcr.io/developmentseed/titiler:latest
container_name: tiles_server
command: uvicorn titiler.application.main:app --host 0.0.0.0 --port 8000 --workers 17
platform: linux/amd64
ports:
- "8000"
volumes:
- ${HOST_RASTERS_DIR}:/data/rasters
restart: unless-stopped
environment:
- CPL_VSIL_CURL_ALLOWED_EXTENSIONS=.tif,.TIF,.tiff
- GDAL_CACHEMAX=200
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
- VSI_CACHE=TRUE
- VSI_CACHE_SIZE=536870912
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working