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

terracotta version mismatch borks /api/tiles/sources and map view generally #171

Open
thomas-fred opened this issue Sep 15, 2023 · 0 comments

Comments

@thomas-fred
Copy link
Contributor

thomas-fred commented Sep 15, 2023

I just ingested a new dataset (IRIS) with terracotta 0.8.0 to prod which is running 0.7.5.

If you request /api/tiles/sources and the mysql terracotta table (updated on ingest) has a version mismatch with the backend terracotta version then terracotta's mysql driver raises an error and we return a 500 from the backend. This means the frontend cannot get any metadata information and will fail to display any maps.

backend service log:

INFO: 172.18.0.3:57424 - "GET /tiles/sources HTTP/1.1" 500 Internal Server Error
[2023-09-15 14:51:18.776] ERROR helpers.py - handle_exception - app.internal.helpers failed with tb:
File "/code/./backend/app/routers/tiles.py", line 164, in get_all_tile_source_meta url_keys = _get_tiledb_keys(row.source_db)
File "/code/./backend/app/routers/tiles.py", line 52, in _get_tiledb_keys db_keys = database_keys(driver_path)
File "/code/backend/app/internal/tiles/singleband.py", line 55, in database_keys return driver.get_keys()
File "/usr/local/lib/python3.10/site-packages/terracotta/drivers/mysql.py", line 318, in get_keys self._db_keys = self._get_keys()
File "/usr/local/lib/python3.10/site-packages/terracotta/drivers/base.py", line 19, in inner with self.connect():
File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__ return next(self.gen)
File "/usr/local/lib/python3.10/site-packages/terracotta/drivers/mysql.py", line 231, in _connect self._connection_callback()
File "/usr/local/lib/python3.10/site-packages/terracotta/drivers/mysql.py", line 199, in _connection_callback raise exceptions.InvalidDatabaseError()
error: Version conflict: database was created in v0.8.0, but this is v0.7.5

Suggest making backend response to /tiles/sources robust to some datasets erroring (catch exception and filter them out of list).

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

1 participant