Comments (8)
Found it!
I was incorrectly parsing the environment variables. Instead of DRIVER_PATH
I used TC_DRIVER_PATH
and instead of DRIVER_PROVIDER
I used TC_DRIVER_PROVIDER
Also I installed inside pymysql
package inside the Dockerfile as it is not included in the environment of the code base!
from terracotta.
Can you please share your Dockerfile and a at least a rough sketch of how you initialized and populated the database and configured Terracotta? Could it be that you are pointing at a different schema or something?
from terracotta.
Sure!
The data are being ingested as documented (https://terracotta-python.readthedocs.io/en/latest/tutorials/aws.html#populate-data-storage-and-database)
Regarding the Dockerfile, please check at this fork: https://github.com/SCiO-systems/terracotta/blob/easier-docker/Dockerfile
Then I'm running the container as per below:
docker run -d -p5000:5000 --name my-terracotta -e RIVER_PATH="mysql://user:[email protected]/terracotta_test" -e DRIVER_PROVIDER=mysql my-terracotta-image
from terracotta.
docker run -d -p5000:5000 --name my-terracotta -e RIVER_PATH="mysql://user:[email protected]/terracotta_test" -e DRIVER_PROVIDER=mysql my-terracotta-image
RIVER_PATH
-> DRIVER_PATH
?
from terracotta.
docker run -d -p5000:5000 --name my-terracotta -e RIVER_PATH="mysql://user:[email protected]/terracotta_test" -e DRIVER_PROVIDER=mysql my-terracotta-image
RIVER_PATH
->DRIVER_PATH
?
Nope...I was hoping for that too but it was just a typo here 😆
The full log is the below:
[-] Exception on /datasets [GET]
Traceback (most recent call last):
File "/app/terracotta/drivers/relational_meta_store.py", line 50, in convert_exceptions
yield
File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/app/terracotta/drivers/relational_meta_store.py", line 192, in db_version
terracotta_table = sqla.Table(
File "<string>", line 2, in __new__
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 436, in __new__
return cls._new(*args, **kw)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 490, in _new
with util.safe_reraise():
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
raise exc_value.with_traceback(exc_tb)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 486, in _new
table.__init__(name, metadata, *args, _no_init=False, **kw)
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 866, in __init__
self._autoload(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/sql/schema.py", line 898, in _autoload
conn_insp.reflect_table(
File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py", line 1538, in reflect_table
raise exc.NoSuchTableError(table_name)
sqlalchemy.exc.NoSuchTableError: terracotta
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/app/terracotta/server/datasets.py", line 94, in get_datasets
"datasets": datasets(keys, page=page, limit=limit),
File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/app/terracotta/handlers/datasets.py", line 23, in datasets
with driver.connect():
File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
return next(self.gen)
File "/app/terracotta/drivers/relational_meta_store.py", line 159, in connect
self._connection_callback()
File "/app/terracotta/drivers/relational_meta_store.py", line 178, in _connection_callback
db_version = self.db_version
File "/usr/local/lib/python3.10/contextlib.py", line 78, in inner
with self._recreate_cm():
File "/usr/local/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/app/terracotta/drivers/relational_meta_store.py", line 52, in convert_exceptions
raise exceptions.InvalidDatabaseError(error_message) from exception
terracotta.exceptions.InvalidDatabaseError: Could not connect to database. Make sure that the given path points to a valid Terracotta database, and that you ran driver.create().
To my understanding the code is searching for a table named terracotta
and somehow it cannot be detected although this exists on the MySQL side.
from terracotta.
So you're saying that Terracotta just crashes with InvalidDatabaseError
if no driver is given at all? That's not good, we should definitely give an error much earlier than that.
from terracotta.
@charalamm You want to look into this one?
from terracotta.
@dionhaefner I made a PR #330 that checks if the database url it is empty.
from terracotta.
Related Issues (20)
- NoSuchTableError: key_names on zappa deploy HOT 2
- Support for non Web Mercator (EPSG 3857) tiles. HOT 3
- Windows 10? HOT 1
- Compatibility with Numpy 1.24 HOT 2
- Current version is not working. HOT 4
- Misleading explicit_color_map documentation HOT 6
- Reduction in /metadata API calls for multiple datasets HOT 8
- No RGB available for selection HOT 6
- Update terracotta interactive web client dependencies HOT 2
- terracotta connect requesting metadata keys in wrong order HOT 9
- Error when trying to insert data into migrated database HOT 1
- Use percentiles in /rgb bands stretch range HOT 12
- terracotta is not serving correctly a large cog file HOT 12
- Test docker image build on CI HOT 1
- Is it only for COG? HOT 3
- Configure GDAL_CACHEMAX when running optimize-rasters HOT 2
- In some data i get different color image tiles apart from true color . HOT 6
- use postgresql conn string not working HOT 8
- v0.8.4 not published in pypi HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terracotta.