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

rasterio error when deploying to AWS lambda with zappa #292

Open
angelosnm opened this issue Jan 14, 2023 · 5 comments
Open

rasterio error when deploying to AWS lambda with zappa #292

angelosnm opened this issue Jan 14, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@angelosnm
Copy link

I'm trying to deploy terracotta to AWS lambda following all the relevant instructions with the vritualenv etc (A serverless Terracotta deployment on AWS Lambda) using RDS as well and the below error comes up on "zappa deploy"

concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "rasterio/crs.pyx", line 775, in rasterio.crs.CRS.from_user_input
File "rasterio/_err.pyx", line 209, in rasterio._err.exc_wrap_ogrerr
rasterio._err.CPLE_BaseError: OGR Error code 6

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/scio/anaconda3/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/home/scio/anaconda3/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/home/scio/devops/repos/terracotta/terracotta/raster.py", line 316, in get_raster_tile
dst_bounds = warp.transform_bounds(src.crs, target_crs, *src.bounds)
File "/home/scio/envs/tc-lambda/lib/python3.9/site-packages/rasterio/warp.py", line 148, in transform_bounds
dst_crs = CRS.from_user_input(dst_crs)
File "rasterio/crs.pyx", line 777, in rasterio.crs.CRS.from_user_input
rasterio.errors.CRSError: The WKT could not be parsed. OGR Error code 6
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/scio/envs/tc-lambda/lib/python3.9/site-packages/zappa/cli.py", line 3044, in handle
sys.exit(cli.handle())
File "/home/scio/envs/tc-lambda/lib/python3.9/site-packages/zappa/cli.py", line 519, in handle
self.dispatch_command(self.command, stage)
File "/home/scio/envs/tc-lambda/lib/python3.9/site-packages/zappa/cli.py", line 557, in dispatch_command
self.callback("settings")
File "/home/scio/envs/tc-lambda/lib/python3.9/site-packages/zappa/cli.py", line 2171, in callback
cb_func(self) # Call the function passing self
File "/home/scio/devops/repos/terracotta/zappa_settings_callback.py", line 45, in check_integrity
driver.get_raster_tile(some_dataset)
File "/home/scio/devops/repos/terracotta/terracotta/drivers/terracotta_driver.py", line 263, in get_raster_tile
return self.raster_store.get_raster_tile(
File "/home/scio/devops/repos/terracotta/terracotta/drivers/geotiff_raster_store.py", line 162, in get_raster_tile
result = future.result()
File "/home/scio/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 445, in result
return self.__get_result()
File "/home/scio/anaconda3/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
rasterio.errors.CRSError: The WKT could not be parsed. OGR Error code 6

@angelosnm angelosnm changed the title rasterio error whey deploying to AWS lambda with zappa rasterio error when deploying to AWS lambda with zappa Jan 14, 2023
@dionhaefner
Copy link
Collaborator

Huh, haven't seen that one before. Can you give us a bit more information about your setup? What OS, how did you install rasterio / GDAL?

@angelosnm
Copy link
Author

angelosnm commented Jan 14, 2023

I haven't install GDAL. I just run the "pip install" commands without any issues (Ubuntu 20.04)

@dionhaefner
Copy link
Collaborator

Could you try running this command and see if you get the same error?

$ python -c "from rasterio.crs import CRS; print(CRS.from_user_input('epsg:3857'))"

@angelosnm
Copy link
Author

Thanks for your comment!

Yes, the same error appears when running this command

@dionhaefner
Copy link
Collaborator

Okay. So your installation is broken, but I'm not exactly sure how it's broken. I suggest you re-install everything, and if that doesn't work, open an issue at rasterio.

@dionhaefner dionhaefner added the bug Something isn't working label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants