You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the new 1.9 version of Datacube OWS that's configured using environment variables crashes if there's no config file at all.
Steps to Reproduce
Configure OWS using env vars (ODC_DEFAULT_DB_USERNAME, ODC_DEFAULT_DB_PASSWORD, ODC_DEFAULT_DB_DATABASE)
Note that datacube-ows-update command works fine
Launching OWS results in the below error
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/wsgi.py", line 20, in <module>
from datacube_ows.ogc import app # isort:skip
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/ogc.py", line 35, in <module>
cfg = parse_config_file()
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/startup_utils.py", line 176, in parse_config_file
cfg = get_config()
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/ows_configuration.py", line 1562, in get_config
cfg = OWSConfig(refresh=refresh, called_from_update_ranges=called_from_update_ranges)
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/ows_configuration.py", line 1269, in __init__
self.parse_global(cast(CFG_DICT, cfg["global"]), ignore_msgfile)
File "/usr/local/lib/python3.10/dist-packages/datacube_ows/ows_configuration.py", line 1366, in parse_global
self.default_env = ODCConfig.get_environment(env=default_env)
File "/usr/local/lib/python3.10/dist-packages/datacube/cfg/api.py", line 159, in get_environment
cfg = ODCConfig(paths=config, raw_dict=raw_config)
File "/usr/local/lib/python3.10/dist-packages/datacube/cfg/api.py", line 112, in __init__
text = find_config(paths)
File "/usr/local/lib/python3.10/dist-packages/datacube/cfg/cfg.py", line 88, in find_config
raise ConfigException("No configuration file found in the provided locations")
datacube.cfg.exceptions.ConfigException: No configuration file found in the provided locations
Context (Environment)
datacube-ows version (datacube-ows-update --version):
datacube product metadata (datacube product show product_name)
Not relevant.
Further notes
Running with an empty config file (like echo "[default]" > /tmp/datacube.conf, and an environment variable set as ODC_CONFIG_PATH=/tmp/datacube.fong) works fine.
The text was updated successfully, but these errors were encountered:
Don't forget $ODC_DEFAULT_INDEX_DRIVER (if using postgis) and use $ODC_DEFAULT_DB_URL in preference to the individual DB_ elements - iirc the Dockerfile doesn't pass the individual DB_ elements on - you must use _DB_URL instead.
Then you'll probably need to write your own docker-compose.yaml file and possibly make changes to the Docker image itself. The current 1.9 docker build assumes DB_URL format.
Description
Running the new 1.9 version of Datacube OWS that's configured using environment variables crashes if there's no config file at all.
Steps to Reproduce
ODC_DEFAULT_DB_USERNAME
,ODC_DEFAULT_DB_PASSWORD
,ODC_DEFAULT_DB_DATABASE
)datacube-ows-update
command works fineContext (Environment)
datacube-ows
version (datacube-ows-update --version):1.9.0rc1.post25+ga9eacd5
ows_config.py
file (link, sample code)Config root
datacube product metadata (datacube product show product_name)
Not relevant.
Further notes
Running with an empty config file (like
echo "[default]" > /tmp/datacube.conf
, and an environment variable set asODC_CONFIG_PATH=/tmp/datacube.fong
) works fine.The text was updated successfully, but these errors were encountered: