Skip to content

Conversation

@rajadain
Copy link
Contributor

@rajadain rajadain commented Nov 4, 2025

Overview

This is in support of the USGS NHGF work with @dblodgett-usgs and @sjordan29.

These endpoints were added recently in #2129, but without the await, we get the following error:

Traceback (most recent call last):
  File "/python/conda/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/conda/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/conda/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/python/conda/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/python/conda/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/python/conda/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 462, in handle
    await self.app(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/python/conda/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/python/conda/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/python/conda/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    await response(scope, receive, send)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'coroutine' object is not callable

Related Issue / discussion

There isn't an issue for this.

Additional information

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

No dependencies were changed in this PR.

Updates to public demo

The public demo should not be affected by this PR.

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

Without the `await`, we get the following error:

    TypeError: 'coroutine' object is not callable
@tomkralidis tomkralidis added this to the 0.22.0 milestone Nov 6, 2025
@tomkralidis tomkralidis added bug Something isn't working STAC SpatioTemporal Asset Catalog labels Nov 6, 2025
@tomkralidis tomkralidis self-requested a review November 6, 2025 11:25
@tomkralidis
Copy link
Member

Test failures are unrelated.

@tomkralidis tomkralidis merged commit 56403a3 into geopython:master Nov 6, 2025
2 of 3 checks passed
@rajadain rajadain deleted the tt/fix-stac-api-on-starlette branch November 6, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working STAC SpatioTemporal Asset Catalog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants