Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error fetching background Planet tiles #75

Closed
leothomas opened this issue Oct 21, 2020 · 5 comments
Closed

Error fetching background Planet tiles #75

leothomas opened this issue Oct 21, 2020 · 5 comments
Assignees

Comments

@leothomas
Copy link
Contributor

leothomas commented Oct 21, 2020

GET http://localhost:8000/v1/planet/13/7276/3229?date=2020_05_17&site=tk fails with:

Traceback (most recent call last):
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 386, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/fastapi/applications.py", line 181, in __call__
    await super().__call__(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/base.py", line 25, in __call__
    response = await self.dispatch_func(request, self.call_next)
  File "./covid_api/main.py", line 58, in cache_middleware
    response = await call_next(request)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/base.py", line 45, in call_next
    task.result()
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
    await self.app(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/gzip.py", line 18, in __call__
    await responder(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/gzip.py", line 35, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/cors.py", line 86, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/middleware/cors.py", line 142, in simple_response
    await self.app(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
    await route.handle(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
    raw_response = await run_endpoint_function(
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/fastapi/routing.py", line 147, in run_endpoint_function
    return await dependant.call(**values)
  File "./covid_api/api/api_v1/endpoints/planet.py", line 66, in tile
    tile, mask = await _tile(scenes, x, y, z)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
    return await loop.run_in_executor(None, func, *args)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "./covid_api/api/utils.py", line 701, in planet_mosaic_tile
    with memfile.open() as src:
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/rasterio/env.py", line 382, in wrapper
    return f(*args, **kwds)
  File "/Users/leo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/rasterio/io.py", line 130, in open
    return DatasetReader(mempath, driver=driver, sharing=sharing, **kwargs)
  File "rasterio/_base.pyx", line 218, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: '/vsimem/2912284a-6282-4b72-bfb8-2c4b2782c0c0/2912284a-6282-4b72-bfb8-2c4b2782c0c0.' not recognized as a supported file format.

in the API.

@leothomas leothomas assigned leothomas and drewbo and unassigned leothomas Oct 21, 2020
@drewbo
Copy link
Contributor

drewbo commented Oct 22, 2020

@leothomas is this off of current develop? I see a returned image

@leothomas
Copy link
Contributor Author

Yeah I'm getting this with the develop branch of the API and the dashboard both running locally - could it be that the image is cached and returned from the API running in AWS but the logic to fetch the image if the cache is empty (as is the case locally)
is failing?

@drewbo
Copy link
Contributor

drewbo commented Oct 26, 2020

I see the image returned against the API running locally only (no cache). Just hitting http://localhost:8000/v1/planet/13/7276/3229?date=2020_05_17&site=tk in the browser, running the api with docker-compose up --build (can compare .env if you ping me directly)

@leothomas
Copy link
Contributor Author

I'm running the API with: uvicorn covid_api.main:app --reload, is that the problem?

@leothomas
Copy link
Contributor Author

Issue was resolved by updating Planet API Key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants