Closed dvd3v closed 2 years ago
@dvd3v do you have a link to the code you are using?
This could be a issue with your handler. If it's not the case try setting lifespan="auto"
see: https://github.com/developmentseed/eoAPI/blob/master/stack/handlers/vector_handler.py#L12
When using a Python 3.7 or 3.9 environment, the application does not load and returns the following error:
This is a dependency issue, and could be because of a lot of things.
Here's the code I'm using: https://github.com/dvd3v/serverless_timvt (note that the Aurora DB is not in here as it was setup in a different project.)
When setting the lifespan="auto"
, I get timeout errors. Setting it to off
works and them I'm able to call the endpoints.
Regarding the table_catalog
error, I've noticed this only happens when installing TiMVT via pip (pip install timvt
). When installing from source (pip install git+https://github.com/developmentseed/timvt.git#egg=timvt
), the error does not occur. So it's related to timvt 0.7.0
.
However, the /tables.json
endpoint then returns emtpy values:
Expected:
[
{
"id": "public.sentinel_mgrs",
"bounds": [
-180,
-83.83595275878906,
180,
83.74835205078125
],
"minzoom": 0,
"maxzoom": 22,
"default_tms": "WebMercatorQuad",
"tileurl": "http://127.0.0.1:8003/tiles/public.sentinel_mgrs/{z}/{x}/{y}",
"type": "Table",
"schema": "public",
"table": "sentinel_mgrs",
"geometry_type": "POLYGON",
"geometry_column": "geom",
"geometry_srid": 4326,
"properties": {
"id": "varchar",
"geom": "geometry",
"name": "varchar",
"ogc_fid": "int4"
}
}
]
Return from Lambda:
[]
The Lambda has access to the DB and locally it returns the correct data.
there are a lot of change that haven't been published yet https://github.com/developmentseed/timvt/blob/master/CHANGES.md#next-tbd
I'm trying to run TiMVT in AWS Lambda + Aurora (based on https://github.com/developmentseed/serverless-timvt). This is how my application looks like:
Note; i've added the
register_table_catalog
function so it loads the tables from the db. Everything works fine locally, also using the Aurora database. However when I deploy the application to AWS Lambda I run into a few problems. I'm using the geolambda layers from https://github.com/lambgeo/geo-layer.When using Python 3.8 with GDAL 3.2, all the dependencies load correctly, and I'm able to run the app. However when I call the
/tables.json
endpoint I run into the following error:When using a Python 3.7 or 3.9 environment, the application does not load and returns the following error:
This could be related to the c-bindings of the
asyncpg
package.I cannot reproduce these errors locally, so it has something to do with the AWS Lambda runtime environment. Any ideas?