Open permezel opened 1 year ago
Hi permezel,
I'm sorry for the frustrations you must be having, thanks for documenting so clearly what you've tried. The Installation and Setup pages in the ODC documentation are clearly quite out of date.
I think there's a couple of issues you're hitting, which is confusing everything.
Someone, an old version of rasterio
has been installed in your environment. Because of the version restrictions ODC has set, this is preventing any of the ODC Drivers from being loaded.
You should be able to fix this by running conda upgrade rasterio
.
I can't tell for sure, but it looks like the integration tests can't connect to the database.
By default, they attempt to connect to a DB called agdcintegration
, running on a local UNIX socket.
It appears you've overridden this with ~/.datacube_integration.conf
, however this may be specifying either a database that doesn't exist, or that can't be connected to for another reason like incorrect credentials or hostname.
Can you please upgrade rasterio
, and check the contents of ~/.datacube_integration.conf
, including it here if you have any questions.
Cheers Damien
Hi @omad
I tried the conda upgrade rasterio
and it did some stuff but left me at version 1.2.10, so still the same errors from data cube system check
I then tried conda install rasterio=1.3.2
but that resulted in a (familiar) issue of
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-aarch64-linux-gnu.so: undefined symbol: PQencryptPasswordConn
So I tried conda install rasterio=1.3.4
which is the latest version.
This results in
dap@odc ~/proj/datacube-core % datacube system check
Traceback (most recent call last):
File "/home/dap/anaconda3/envs/odc_3.8/bin/datacube", line 6, in <module>
from datacube.scripts.cli_app import cli
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/__init__.py", line 29, in <module>
from .api import Datacube
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/api/__init__.py", line 9, in <module>
from .core import Datacube, TerminateCurrentLoad
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/api/core.py", line 16, in <module>
from datacube.storage import reproject_and_fuse, BandInfo
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/storage/__init__.py", line 11, in <module>
from ..drivers.datasource import (
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/__init__.py", line 9, in <module>
from .indexes import index_driver_by_name, index_drivers
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/indexes.py", line 9, in <module>
from ..index.abstract import AbstractIndexDriver
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/index/__init__.py", line 9, in <module>
from ._api import index_connect
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/index/_api.py", line 12, in <module>
from datacube.index.abstract import AbstractIndex
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/index/abstract.py", line 18, in <module>
from datacube.index.fields import Field
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/index/fields.py", line 13, in <module>
from datacube.model import Range
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/model/__init__.py", line 20, in <module>
from datacube.utils import geometry, without_lineage_sources, parse_time, cached_property, uri_to_local_path, \
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/utils/geometry/__init__.py", line 8, in <module>
from ._base import (
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/utils/geometry/_base.py", line 19, in <module>
import rasterio # type: ignore[import]
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/rasterio/__init__.py", line 28, in <module>
from rasterio._version import gdal_version, get_geos_version, get_proj_version
ImportError: libLerc.so.4: cannot open shared object file: No such file or directory
So I tried conda upgrade --all
and I get more or less the same failure as above.
I also tried conda install -c conda-forge lerc
to no avail.
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/utils/geometry/__init__.py", line 8, in <module>
from ._base import (
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/utils/geometry/_base.py", line 19, in <module>
import rasterio # type: ignore[import]
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/rasterio/__init__.py", line 28, in <module>
from rasterio._version import gdal_version, get_geos_version, get_proj_version
ImportError: libLerc.so.4: cannot open shared object file: No such file or directory
dap@odc ~/proj/datacube-core % find ~ -print | grep Lerc
/home/dap/anaconda3/lib/libLerc.so
/home/dap/anaconda3/include/Lerc_types.h
/home/dap/anaconda3/include/Lerc_c_api.h
/home/dap/anaconda3/envs/odc/lib/libLerc.so
/home/dap/anaconda3/envs/odc/include/Lerc_types.h
/home/dap/anaconda3/envs/odc/include/Lerc_c_api.h
/home/dap/anaconda3/envs/odc_3.8/lib/libLerc.so
/home/dap/anaconda3/envs/odc_3.8/include/Lerc_types.h
/home/dap/anaconda3/envs/odc_3.8/include/Lerc_c_api.h
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/lib/libLerc.so
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/include/Lerc_types.h
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/include/Lerc_c_api.h
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/lib/libLerc.so
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/include/Lerc_types.h
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/include/Lerc_c_api.h
dap@odc ~/proj/datacube-core %
So I try:
dap@odc ~/proj/datacube-core % conda install -c conda-forge lerc=4.0.0
...
dap@odc ~/proj/datacube-core % find ~ -print | grep Lerc
/home/dap/anaconda3/lib/libLerc.so
/home/dap/anaconda3/include/Lerc_types.h
/home/dap/anaconda3/include/Lerc_c_api.h
/home/dap/anaconda3/envs/odc/lib/libLerc.so
/home/dap/anaconda3/envs/odc/include/Lerc_types.h
/home/dap/anaconda3/envs/odc/include/Lerc_c_api.h
/home/dap/anaconda3/envs/odc_3.8/lib/pkgconfig/Lerc.pc
/home/dap/anaconda3/envs/odc_3.8/lib/libLerc.so
/home/dap/anaconda3/envs/odc_3.8/lib/libLerc.so.4
/home/dap/anaconda3/envs/odc_3.8/include/Lerc_types.h
/home/dap/anaconda3/envs/odc_3.8/include/Lerc_c_api.h
/home/dap/anaconda3/pkgs/lerc-4.0.0-h4de3ea5_0/lib/pkgconfig/Lerc.pc
/home/dap/anaconda3/pkgs/lerc-4.0.0-h4de3ea5_0/lib/libLerc.so
/home/dap/anaconda3/pkgs/lerc-4.0.0-h4de3ea5_0/lib/libLerc.so.4
/home/dap/anaconda3/pkgs/lerc-4.0.0-h4de3ea5_0/include/Lerc_types.h
/home/dap/anaconda3/pkgs/lerc-4.0.0-h4de3ea5_0/include/Lerc_c_api.h
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/lib/libLerc.so
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/include/Lerc_types.h
/home/dap/anaconda3/pkgs/lerc-3.0-h01db608_0/include/Lerc_c_api.h
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/lib/libLerc.so
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/include/Lerc_types.h
/home/dap/anaconda3/pkgs/lerc-3.0-h22f4aa5_0/include/Lerc_c_api.h
dap@odc ~/proj/datacube-core %
Sadly, this gets me back to the old, familiar PQencryptPasswordConn
error.
dap@odc ~/proj/datacube-core % datacube system check
Traceback (most recent call last):
File "/home/dap/anaconda3/envs/odc_3.8/bin/datacube", line 6, in <module>
from datacube.scripts.cli_app import cli
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/scripts/cli_app.py", line 17, in <module>
import datacube.scripts.system # noqa: F401
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/scripts/system.py", line 13, in <module>
from datacube.drivers.postgres._connections import IndexSetupError
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/postgres/__init__.py", line 11, in <module>
from ._connections import PostgresDb
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/postgres/_connections.py", line 30, in <module>
from . import _api
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/postgres/_api.py", line 31, in <module>
from ._fields import parse_fields, Expression, PgField, PgExpression # noqa: F401
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/datacube/drivers/postgres/_fields.py", line 13, in <module>
from psycopg2.extras import NumericRange, DateTimeTZRange
File "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: /home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-aarch64-linux-gnu.so: undefined symbol: PQencryptPasswordConn
Depending on what versions of stuff I force into my odc_3.8
env, I occasionally get an installed version of psql
.
When this happens, I get the (reported elsewhere) problems of psql
looking in /tmp
for the socket.
dap@odc ~/proj/datacube-core % which psql
/home/dap/anaconda3/envs/odc_3.8/bin/psql
dap@odc ~/proj/datacube-core % psql -d agdcintegration
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
If I explicitly use the system version, it works:
dap@odc ~/proj/datacube-core % /usr/bin/psql -d agdcintegration
psql (14.5 (Ubuntu 14.5-0ubuntu0.22.04.1))
Type "help" for help.
agdcintegration=# \q
dap@odc ~/proj/datacube-core %
Also, depending on what versions of that are tripping over each other, I either get a working version go psycopg2
or not.
Perhaps I also have to force that version.
dap@odc ~/proj/datacube-core % F=$(find ~ -print | grep libpq.so)
for f in $(echo $F); do echo "=-= $f"; nm $f | grep PQenc; done
=-= /home/dap/anaconda3/lib/libpq.so.5.12
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
=-= /home/dap/anaconda3/lib/libpq.so.5
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
=-= /home/dap/anaconda3/lib/libpq.so
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
=-= /home/dap/anaconda3/envs/odc_3.8/lib/libpq.so.5.14
0000000000025470 T PQencryptPassword
0000000000025500 T PQencryptPasswordConn
=-= /home/dap/anaconda3/envs/odc_3.8/lib/libpq.so.5
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/envs/odc_3.8/lib/libpq.so.5.9
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/envs/odc_3.8/lib/libpq.so
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/pkgs/postgresql-9.6.6-he3421e9_1/lib/libpq.so.5
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/pkgs/postgresql-9.6.6-he3421e9_1/lib/libpq.so.5.9
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/pkgs/postgresql-9.6.6-he3421e9_1/lib/libpq.so
000000000000b520 T PQencryptPassword
=-= /home/dap/anaconda3/pkgs/libpq-14.5-hfbf4865_3/lib/libpq.so.5.14
0000000000025470 T PQencryptPassword
0000000000025500 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-14.5-hfbf4865_3/lib/libpq.so.5
0000000000025470 T PQencryptPassword
0000000000025500 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-14.5-hfbf4865_3/lib/libpq.so
0000000000025470 T PQencryptPassword
0000000000025500 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-14.5-h0f47c37_2/lib/libpq.so.5.14
0000000000025460 T PQencryptPassword
00000000000254f0 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-14.5-h0f47c37_2/lib/libpq.so.5
0000000000025460 T PQencryptPassword
00000000000254f0 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-14.5-h0f47c37_2/lib/libpq.so
0000000000025460 T PQencryptPassword
00000000000254f0 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-12.9-h140f9b7_3/lib/libpq.so.5.12
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-12.9-h140f9b7_3/lib/libpq.so.5
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
=-= /home/dap/anaconda3/pkgs/libpq-12.9-h140f9b7_3/lib/libpq.so
000000000000c684 T PQencryptPassword
000000000000c714 T PQencryptPasswordConn
dap@odc ~/proj/datacube-core %
Anaconda
does not seem capable of correctly managing the dependencies.
Perhaps a pyenv
and pip
based approach would be more fruitful? Alternately, although my mind boggles at the thought of trying to mess with nix
, it does claim to be able to correctly manage dependencies in a rather spiffy manner.
@permezel
I tried the
conda upgrade rasterio
and it did some stuff but left me at version 1.2.10, so still the same errors fromdata cube system check
I then triedconda install rasterio=1.3.2
but that resulted in a (familiar) issue ofFile "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa ImportError: /home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-aarch64-linux-gnu.so: undefined symbol: PQencryptPasswordConn
Oooh, what sort of a machine are you running on? That aarch64
bit makes it look like an ARM based system. I don't know of anyone using Linux on ARM with ODC/conda packages/GDAL etc. That might be the root of all your troubles.
@permezel
I tried the
conda upgrade rasterio
and it did some stuff but left me at version 1.2.10, so still the same errors fromdata cube system check
I then triedconda install rasterio=1.3.2
but that resulted in a (familiar) issue ofFile "/home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa ImportError: /home/dap/anaconda3/envs/odc_3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-aarch64-linux-gnu.so: undefined symbol: PQencryptPasswordConn
Oooh, what sort of a machine are you running on? That
aarch64
bit makes it look like an ARM based system. I don't know of anyone using Linux on ARM with ODC/conda packages/GDAL etc. That might be the root of all your troubles.
@omad, I am running in a parallels VM on a Mac Studio box. I am keen to assist in getting this to work for aarch64
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Expected behaviour
Less errors.
Actual behaviour
Steps to reproduce the behaviour
Installed using https://datacube-core.readthedocs.io/en/latest/installation/setup/ubuntu.html Ran into lots of errors, but my setup script is now:
The integration tests fail with many errors. So I decided to try to init the database following https://datacube-core.readthedocs.io/en/latest/installation/database/setup.html
I created a database:
I created another config file:
I then tried to init it:
Due to the verbiage spewed as a result of this, I tried to check:
Is this success? It does offer 'YES' at the end, but I am a bit concerned, mainly by all the self-test errors. This is a small extract of the verbiage emitted by running the
./check-code.sh integration_tests
step.Environment information
Which
datacube --version
are you using?dap@odc ~/proj/datacube-core % git status On branch develop Your branch is up to date with 'origin/develop'.
Untracked files: (use "git add..." to include in what will be committed)
h.txt
my.py
redo.sh
nothing added to commit but untracked files present (use "git add" to track) dap@odc ~/proj/datacube-core %