Skip to content

Too-large search filter geometry causes opaque error and futile retries #711

@sgillies

Description

@sgillies
Contributor

If I search with a big ole 9MB blob of GeoJSON (attached, 1.2 MB zipped) the search appears to hang. If I turn up the logging verbosity, I see that we're in a retry loop that doesn't break.

...
2022-10-07 16:01:46,708 - planet.http - DEBUG - Worker released.
2022-10-07 16:01:46,708 - planet.http - INFO - Try 2
2022-10-07 16:01:46,708 - planet.http - INFO - Retrying: caught <class 'httpx.ReadError'>: 
2022-10-07 16:01:46,708 - planet.http - INFO - Retrying: sleeping 4.786s
...

I think that the GeoJSON may be over the size limit and that the retries cannot succeed. We're losing some signal from the API server. There's no server response in the log.

To reproduce, try this with the attached GeoJSON.

planet data filter --geom rmnp.geojson --date-range acquired gte 2022-10-06 | planet --verbosity DEBUG data search PSScene

rmnp.zip

Activity

jreiberkyle

jreiberkyle commented on Mar 21, 2023

@jreiberkyle
Contributor

I just re-ran this and yep definitely it's triggering a ReadError every time. We have included ReadError in the list of errors that are retried, and the retry count is 5, with an increasing delay between each retry. Due to the long delay it may seem that the loop doesn't break, though it does with time.

There is definitely an opportunity here to treat repeating ReadErrors differently from timeouts. Not sure of a way to tell the user that the repeated ReadError is due to the geojson size tho.

kw01sg

kw01sg commented on Feb 9, 2025

@kw01sg

Im getting the same error for a geojson file that's approx. 4MB on a create_subscription call:

$ subscription = pl.subscriptions.create_subscription(request)

File [~/homebrew/Cellar/python](http://localhost:8888/~/homebrew/Cellar/python)@3.13[/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py:162](http://localhost:8888/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py#line=161), in _GeneratorContextManager.__exit__(self, typ, value, traceback)
    160     value = typ()
    161 try:
--> 162     self.gen.throw(value)
    163 except StopIteration as exc:
    164     # Suppress StopIteration *unless* it's the same exception that
    165     # was passed to throw().  This prevents a StopIteration
    166     # raised inside the "with" statement from being suppressed.
    167     return exc is not value

File [~/planet_labs/.venv/lib/python3.13/site-packages/httpx/_transports/default.py:118](http://localhost:8888/~/planet_labs/.venv/lib/python3.13/site-packages/httpx/_transports/default.py#line=117), in map_httpcore_exceptions()
    115     raise
    117 message = str(exc)
--> 118 raise mapped_exc(message) from exc

ReadError:

Is there a recommendation to how big the geojson file should be?

asonnenschein

asonnenschein commented on Feb 10, 2025

@asonnenschein
Contributor

@kw01sg Subscriptions API enforces an upper limit of 1,500 vertices for geometries. Other than this, there isn't exactly a recommendation for geojson file sizes. This error looks like it's being thrown from the SDK - is there a full stack trace you could share with us? If you're able to share your geojson file too that would be super helpful to help us troubleshoot.

Have you heard of Planet's Features API? It's a relatively new API that allows users to upload geometries and then refer to them in other Planet APIs (like Subscriptions API) by a feature reference URI. This might help your use case because you'd be able to refer to your geometry by feature reference rather than having to manage the raw geometry yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sgillies@jreiberkyle@asonnenschein@kw01sg

        Issue actions

          Too-large search filter geometry causes opaque error and futile retries · Issue #711 · planetlabs/planet-client-python