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

verdi quicksetup failure on MacOS #4032

Closed
chrisjsewell opened this issue May 2, 2020 · 39 comments · Fixed by #4255
Closed

verdi quicksetup failure on MacOS #4032

chrisjsewell opened this issue May 2, 2020 · 39 comments · Fixed by #4255

Comments

@chrisjsewell
Copy link
Member

Posted on behalf of @iclnmh,

On Mac OS X 10.15.3, Anaconda + conda installed fresh fails with:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "None" to address: nodename nor servname provided, or not known
Terminal log:

(base) nh@iMac-Pro ~ % conda info

 active environment : base
active env location : /Users/nh/opt/anaconda3
        shell level : 1
   user config file : /Users/nh/.condarc

populated config files : /Users/nh/.condarc
conda version : 4.8.3
conda-build version : 3.18.11
python version : 3.7.7.final.0
virtual packages : __osx=10.15.3
base environment : /Users/nh/opt/anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/nh/opt/anaconda3/pkgs
/Users/nh/.conda/pkgs
envs directories : /Users/nh/opt/anaconda3/envs
/Users/nh/.conda/envs
platform : osx-64
user-agent : conda/4.8.3 requests/2.23.0 CPython/3.7.7 Darwin/19.3.0 OSX/10.15.3
UID:GID : 501:20
netrc file : None
offline mode : False

(base) nh@iMac-Pro ~ % conda create -n aiida -c conda-forge aiida-core aiida-core.services
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

Package Plan

environment location: /Users/nh/opt/anaconda3/envs/aiida

added / updated specs:
- aiida-core
- aiida-core.services

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
aiida-core-1.2.1           |   py37hc8dfbb8_1         2.2 MB  conda-forge
aiida-core.services-1.2.1  |                1           4 KB  conda-forge
aldjemy-0.9.1              |             py_2          20 KB  conda-forge
alembic-1.4.2              |     pyh9f0ad1d_0         111 KB  conda-forge
anyjson-0.3.3              |        py37_1001           9 KB  conda-forge
appnope-0.1.0              |py37hc8dfbb8_1001           9 KB  conda-forge
argon2_cffi-19.1.0         |py37h0b31af3_1000          43 KB  conda-forge
arrow-0.15.5               |           py37_0          96 KB  conda-forge
babel-2.8.0                |             py_0         6.0 MB  conda-forge
backcall-0.1.0             |             py_0          13 KB  conda-forge
bcrypt-3.1.7               |   py37h9bfed18_1          42 KB  conda-forge
bzip2-1.0.8                |       h0b31af3_2         152 KB  conda-forge
ca-certificates-2020.4.5.1 |       hecc5488_0         146 KB  conda-forge
certifi-2020.4.5.1         |   py37hc8dfbb8_0         151 KB  conda-forge
cffi-1.14.0                |   py37h356ff06_0         214 KB  conda-forge
circus-0.16.1              |           py37_1         269 KB  conda-forge
click-7.1.2                |     pyh9f0ad1d_0          64 KB  conda-forge
click-completion-0.5.1     |           py37_1          19 KB  conda-forge
click-config-file-0.5.0    |             py_0           8 KB  conda-forge
click-spinner-0.1.10       |     pyh9f0ad1d_0           8 KB  conda-forge
colour-0.1.5               |             py_0          17 KB  conda-forge
configobj-5.0.6            |             py_0          31 KB  conda-forge
cryptography-2.9.2         |   py37he655712_0         610 KB  conda-forge
dbus-1.13.6                |       h2f22bb5_0         558 KB  conda-forge
decorator-4.4.2            |             py_0          11 KB  conda-forge
django-2.2.8               |           py37_0         4.7 MB  conda-forge
erlang-21.3                |       h7e52f02_0        40.2 MB  conda-forge
ete3-3.1.1                 |             py_1         1.8 MB  conda-forge
expat-2.2.9                |       h4a8c4bd_2         126 KB  conda-forge
freetype-2.10.1            |       h8da9a1a_0         901 KB  conda-forge
frozendict-1.2             |     pyh9f0ad1d_3           6 KB  conda-forge
furl-2.1.0                 |             py_0          21 KB  conda-forge
future-0.18.2              |   py37hc8dfbb8_1         713 KB  conda-forge
gettext-0.19.8.1           |    h46ab8bc_1002         3.3 MB  conda-forge
glib-2.64.2                |       h577aef8_0         3.2 MB  conda-forge
graphviz-2.42.3            |       h98dfb87_0         7.1 MB  conda-forge
icu-58.2                   |    h0a44026_1000        22.3 MB  conda-forge
idna-2.9                   |             py_1          52 KB  conda-forge
infinity-1.4               |             py_0           5 KB  conda-forge
intervals-0.8.1            |             py_0          10 KB  conda-forge
ipython-7.13.0             |   py37hc8dfbb8_2         1.1 MB  conda-forge
ipython_genutils-0.2.0     |             py_1          21 KB  conda-forge
jedi-0.17.0                |   py37hc8dfbb8_0         809 KB  conda-forge
jinja2-2.11.2              |     pyh9f0ad1d_0          93 KB  conda-forge
jpeg-9c                    |    h1de35cc_1001         237 KB  conda-forge
kiwipy-0.5.3               |           py37_1          35 KB  conda-forge
krb5-1.16.4                |       h1752a42_0         1.1 MB  conda-forge
libblas-3.8.0              |      14_openblas          10 KB  conda-forge
libcblas-3.8.0             |      14_openblas          10 KB  conda-forge
libcxx-10.0.0              |       h1af66ff_2         1.0 MB  conda-forge
libedit-3.1.20170329       |    hcfe32e1_1001         152 KB  conda-forge
libffi-3.2.1               |    h4a8c4bd_1007          42 KB  conda-forge
libgfortran-3.0.1          |                0         495 KB  conda-forge
libiconv-1.15              |    h0b31af3_1006         1.3 MB  conda-forge
liblapack-3.8.0            |      14_openblas          10 KB  conda-forge
libopenblas-0.3.7          |       hd44dcd8_1         8.4 MB  conda-forge
libpng-1.6.37              |       hbbe82c9_1         295 KB  conda-forge
libpq-11.3                 |       h56406e1_0         2.4 MB  conda-forge
libsodium-1.0.17           |       h01d97ff_0         308 KB  conda-forge
libtiff-4.1.0              |       h2ae36a8_6         614 KB  conda-forge
libwebp-base-1.1.0         |       h0b31af3_3         766 KB  conda-forge
libxcb-1.13                |    h1de35cc_1002         307 KB  conda-forge
libxml2-2.9.9              |       hd80cff7_2         1.2 MB  conda-forge
libxslt-1.1.32             |    h1e79283_1003         491 KB  conda-forge
lxml-4.4.1                 |   py37h08abf6f_0         1.4 MB  conda-forge
lz4-c-1.9.2                |       h4a8c4bd_0         164 KB  conda-forge
mako-1.1.0                 |             py_0          57 KB  conda-forge
markupsafe-1.1.1           |   py37h9bfed18_1          25 KB  conda-forge
ncurses-6.1                |    h0a44026_1002         1.3 MB  conda-forge
numpy-1.17.5               |   py37hde6bac1_0         5.0 MB  conda-forge
openssl-1.1.1g             |       h0b31af3_0         1.9 MB  conda-forge
orderedmultidict-1.0.1     |             py_0          12 KB  conda-forge
paramiko-2.7.1             |           py37_0         288 KB  conda-forge
parso-0.7.0                |     pyh9f0ad1d_0          67 KB  conda-forge
passlib-1.7.1              |             py_0         372 KB  conda-forge
pcre-8.44                  |       h4a8c4bd_0         222 KB  conda-forge
pexpect-4.8.0              |   py37hc8dfbb8_1          79 KB  conda-forge
pgsu-0.1.0                 |   py37hc8dfbb8_1          15 KB  conda-forge
phonenumbers-8.10.14       |             py_0         1.5 MB  conda-forge
pickleshare-0.7.5          |py37hc8dfbb8_1001          12 KB  conda-forge
pika-1.1.0                 |             py_0         102 KB  conda-forge
pip-20.1                   |     pyh9f0ad1d_0         1.1 MB  conda-forge
plumpy-0.14.5              |     pyh9f0ad1d_2          62 KB  conda-forge
postgresql-11.3            |       hf10c77c_0         4.3 MB  conda-forge
prompt-toolkit-3.0.5       |             py_0         232 KB  conda-forge
psutil-5.7.0               |   py37h9bfed18_1         335 KB  conda-forge
psycopg2-2.8.3             |   py37h212c5bf_0         147 KB  conda-forge
pthread-stubs-0.4          |    h1de35cc_1001           5 KB  conda-forge
ptyprocess-0.6.0           |          py_1001          15 KB  conda-forge
pycparser-2.20             |             py_0          89 KB  conda-forge
pygments-2.6.1             |             py_0         683 KB  conda-forge
pynacl-1.3.0               |py37h0b31af3_1001         1.5 MB  conda-forge
pyqt-5.9.2                 |   py37h2a560b1_4         4.5 MB  conda-forge
python-3.7.3               |       h0d93f26_0        20.7 MB  conda-forge
python-dateutil-2.8.1      |             py_0         220 KB  conda-forge
python-editor-1.0.4        |             py_0           9 KB  conda-forge
python-graphviz-0.14       |     pyh9f0ad1d_0          19 KB  conda-forge
python_abi-3.7             |          1_cp37m           4 KB  conda-forge
pytz-2019.3                |             py_0         237 KB  conda-forge
pyyaml-5.1.2               |   py37h0b31af3_1         172 KB  conda-forge
pyzmq-19.0.0               |   py37haec44b1_1         448 KB  conda-forge
qt-5.9.7                   |       h93ee506_2        76.8 MB  conda-forge
rabbitmq-server-3.7.16     |                0        13.0 MB  conda-forge
readline-7.0               |    hcfe32e1_1001         393 KB  conda-forge
reentry-1.3.1              |   py37hc8dfbb8_1          32 KB  conda-forge
scipy-1.3.1                |   py37hab3da7d_2        16.0 MB  conda-forge
setuptools-46.1.3          |   py37hc8dfbb8_0         636 KB  conda-forge
shellingham-1.3.2          |             py_0          11 KB  conda-forge
shortuuid-1.0.1            |   py37hc8dfbb8_2          14 KB  conda-forge
simplejson-3.17.0          |   py37h0b31af3_0          99 KB  conda-forge
sip-4.19.8                 |py37h0a44026_1000         251 KB  conda-forge
six-1.14.0                 |             py_1          13 KB  conda-forge
sqlalchemy-1.3.16          |   py37h9bfed18_0         1.8 MB  conda-forge
sqlalchemy-utils-0.34.2    |             py_0          61 KB  conda-forge
sqlite-3.28.0              |       h9721f7c_0         2.4 MB  conda-forge
sqlparse-0.3.1             |             py_0          30 KB  conda-forge
tabulate-0.8.7             |     pyh9f0ad1d_0          24 KB  conda-forge
tk-8.6.10                  |       hbbe82c9_0         3.3 MB  conda-forge
topika-0.2.1               |           py37_1          51 KB  conda-forge
tornado-4.5.3              |py37h0b31af3_1002         642 KB  conda-forge
traitlets-4.3.3            |   py37hc8dfbb8_1         133 KB  conda-forge
tzcode-2020a               |       h0b31af3_0         405 KB  conda-forge
tzlocal-2.0.0              |             py_0          17 KB  conda-forge
upf_to_json-0.9.2          |             py_0          11 KB  conda-forge
wcwidth-0.1.9              |     pyh9f0ad1d_0          20 KB  conda-forge
wheel-0.34.2               |             py_1          24 KB  conda-forge
wrapt-1.11.2               |   py37h9bfed18_0          42 KB  conda-forge
xorg-kbproto-1.0.7         |    h1de35cc_1002          26 KB  conda-forge
xorg-libice-1.0.10         |       h01d97ff_0          49 KB  conda-forge
xorg-libsm-1.2.3           |    h01d97ff_1000          22 KB  conda-forge
xorg-libx11-1.6.9          |       h0b31af3_0         873 KB  conda-forge
xorg-libxau-1.0.9          |       h1de35cc_0          11 KB  conda-forge
xorg-libxdmcp-1.1.3        |       h01d97ff_0          16 KB  conda-forge
xorg-libxext-1.3.4         |       h01d97ff_0          42 KB  conda-forge
xorg-libxrender-0.9.10     |    h01d97ff_1002          24 KB  conda-forge
xorg-renderproto-0.11.1    |    h1de35cc_1002           9 KB  conda-forge
xorg-xextproto-7.3.0       |    h1de35cc_1002          27 KB  conda-forge
xorg-xproto-7.0.31         |    h1de35cc_1007          72 KB  conda-forge
xz-5.2.5                   |       h0b31af3_0         266 KB  conda-forge
yaml-0.2.4                 |       h0b31af3_0          80 KB  conda-forge
zeromq-4.3.2               |       h6de7cb9_2         571 KB  conda-forge
zlib-1.2.11                |    h0b31af3_1006         101 KB  conda-forge
zstd-1.4.4                 |       h4b3e974_3         1.0 MB  conda-forge
------------------------------------------------------------
                                       Total:       282.7 MB

The following NEW packages will be INSTALLED:

aiida-core conda-forge/osx-64::aiida-core-1.2.1-py37hc8dfbb8_1
aiida-core.servic~ conda-forge/osx-64::aiida-core.services-1.2.1-1
aldjemy conda-forge/noarch::aldjemy-0.9.1-py_2
alembic conda-forge/noarch::alembic-1.4.2-pyh9f0ad1d_0
anyjson conda-forge/osx-64::anyjson-0.3.3-py37_1001
appnope conda-forge/osx-64::appnope-0.1.0-py37hc8dfbb8_1001
argon2_cffi conda-forge/osx-64::argon2_cffi-19.1.0-py37h0b31af3_1000
arrow conda-forge/osx-64::arrow-0.15.5-py37_0
babel conda-forge/noarch::babel-2.8.0-py_0
backcall conda-forge/noarch::backcall-0.1.0-py_0
bcrypt conda-forge/osx-64::bcrypt-3.1.7-py37h9bfed18_1
bzip2 conda-forge/osx-64::bzip2-1.0.8-h0b31af3_2
ca-certificates conda-forge/osx-64::ca-certificates-2020.4.5.1-hecc5488_0
certifi conda-forge/osx-64::certifi-2020.4.5.1-py37hc8dfbb8_0
cffi conda-forge/osx-64::cffi-1.14.0-py37h356ff06_0
circus conda-forge/osx-64::circus-0.16.1-py37_1
click conda-forge/noarch::click-7.1.2-pyh9f0ad1d_0
click-completion conda-forge/osx-64::click-completion-0.5.1-py37_1
click-config-file conda-forge/noarch::click-config-file-0.5.0-py_0
click-spinner conda-forge/noarch::click-spinner-0.1.10-pyh9f0ad1d_0
colour conda-forge/noarch::colour-0.1.5-py_0
configobj conda-forge/noarch::configobj-5.0.6-py_0
cryptography conda-forge/osx-64::cryptography-2.9.2-py37he655712_0
dbus conda-forge/osx-64::dbus-1.13.6-h2f22bb5_0
decorator conda-forge/noarch::decorator-4.4.2-py_0
django conda-forge/osx-64::django-2.2.8-py37_0
erlang conda-forge/osx-64::erlang-21.3-h7e52f02_0
ete3 conda-forge/noarch::ete3-3.1.1-py_1
expat conda-forge/osx-64::expat-2.2.9-h4a8c4bd_2
freetype conda-forge/osx-64::freetype-2.10.1-h8da9a1a_0
frozendict conda-forge/noarch::frozendict-1.2-pyh9f0ad1d_3
furl conda-forge/noarch::furl-2.1.0-py_0
future conda-forge/osx-64::future-0.18.2-py37hc8dfbb8_1
gettext conda-forge/osx-64::gettext-0.19.8.1-h46ab8bc_1002
glib conda-forge/osx-64::glib-2.64.2-h577aef8_0
graphviz conda-forge/osx-64::graphviz-2.42.3-h98dfb87_0
icu conda-forge/osx-64::icu-58.2-h0a44026_1000
idna conda-forge/noarch::idna-2.9-py_1
infinity conda-forge/noarch::infinity-1.4-py_0
intervals conda-forge/noarch::intervals-0.8.1-py_0
ipython conda-forge/osx-64::ipython-7.13.0-py37hc8dfbb8_2
ipython_genutils conda-forge/noarch::ipython_genutils-0.2.0-py_1
jedi conda-forge/osx-64::jedi-0.17.0-py37hc8dfbb8_0
jinja2 conda-forge/noarch::jinja2-2.11.2-pyh9f0ad1d_0
jpeg conda-forge/osx-64::jpeg-9c-h1de35cc_1001
kiwipy conda-forge/osx-64::kiwipy-0.5.3-py37_1
krb5 conda-forge/osx-64::krb5-1.16.4-h1752a42_0
libblas conda-forge/osx-64::libblas-3.8.0-14_openblas
libcblas conda-forge/osx-64::libcblas-3.8.0-14_openblas
libcxx conda-forge/osx-64::libcxx-10.0.0-h1af66ff_2
libedit conda-forge/osx-64::libedit-3.1.20170329-hcfe32e1_1001
libffi conda-forge/osx-64::libffi-3.2.1-h4a8c4bd_1007
libgfortran conda-forge/osx-64::libgfortran-3.0.1-0
libiconv conda-forge/osx-64::libiconv-1.15-h0b31af3_1006
liblapack conda-forge/osx-64::liblapack-3.8.0-14_openblas
libopenblas conda-forge/osx-64::libopenblas-0.3.7-hd44dcd8_1
libpng conda-forge/osx-64::libpng-1.6.37-hbbe82c9_1
libpq conda-forge/osx-64::libpq-11.3-h56406e1_0
libsodium conda-forge/osx-64::libsodium-1.0.17-h01d97ff_0
libtiff conda-forge/osx-64::libtiff-4.1.0-h2ae36a8_6
libwebp-base conda-forge/osx-64::libwebp-base-1.1.0-h0b31af3_3
libxcb conda-forge/osx-64::libxcb-1.13-h1de35cc_1002
libxml2 conda-forge/osx-64::libxml2-2.9.9-hd80cff7_2
libxslt conda-forge/osx-64::libxslt-1.1.32-h1e79283_1003
lxml conda-forge/osx-64::lxml-4.4.1-py37h08abf6f_0
lz4-c conda-forge/osx-64::lz4-c-1.9.2-h4a8c4bd_0
mako conda-forge/noarch::mako-1.1.0-py_0
markupsafe conda-forge/osx-64::markupsafe-1.1.1-py37h9bfed18_1
ncurses conda-forge/osx-64::ncurses-6.1-h0a44026_1002
numpy conda-forge/osx-64::numpy-1.17.5-py37hde6bac1_0
openssl conda-forge/osx-64::openssl-1.1.1g-h0b31af3_0
orderedmultidict conda-forge/noarch::orderedmultidict-1.0.1-py_0
paramiko conda-forge/osx-64::paramiko-2.7.1-py37_0
parso conda-forge/noarch::parso-0.7.0-pyh9f0ad1d_0
passlib conda-forge/noarch::passlib-1.7.1-py_0
pcre conda-forge/osx-64::pcre-8.44-h4a8c4bd_0
pexpect conda-forge/osx-64::pexpect-4.8.0-py37hc8dfbb8_1
pgsu conda-forge/osx-64::pgsu-0.1.0-py37hc8dfbb8_1
phonenumbers conda-forge/noarch::phonenumbers-8.10.14-py_0
pickleshare conda-forge/osx-64::pickleshare-0.7.5-py37hc8dfbb8_1001
pika conda-forge/noarch::pika-1.1.0-py_0
pip conda-forge/noarch::pip-20.1-pyh9f0ad1d_0
plumpy conda-forge/noarch::plumpy-0.14.5-pyh9f0ad1d_2
postgresql conda-forge/osx-64::postgresql-11.3-hf10c77c_0
prompt-toolkit conda-forge/noarch::prompt-toolkit-3.0.5-py_0
psutil conda-forge/osx-64::psutil-5.7.0-py37h9bfed18_1
psycopg2 conda-forge/osx-64::psycopg2-2.8.3-py37h212c5bf_0
pthread-stubs conda-forge/osx-64::pthread-stubs-0.4-h1de35cc_1001
ptyprocess conda-forge/noarch::ptyprocess-0.6.0-py_1001
pycparser conda-forge/noarch::pycparser-2.20-py_0
pygments conda-forge/noarch::pygments-2.6.1-py_0
pynacl conda-forge/osx-64::pynacl-1.3.0-py37h0b31af3_1001
pyqt conda-forge/osx-64::pyqt-5.9.2-py37h2a560b1_4
python conda-forge/osx-64::python-3.7.3-h0d93f26_0
python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0
python-editor conda-forge/noarch::python-editor-1.0.4-py_0
python-graphviz conda-forge/noarch::python-graphviz-0.14-pyh9f0ad1d_0
python_abi conda-forge/osx-64::python_abi-3.7-1_cp37m
pytz conda-forge/noarch::pytz-2019.3-py_0
pyyaml conda-forge/osx-64::pyyaml-5.1.2-py37h0b31af3_1
pyzmq conda-forge/osx-64::pyzmq-19.0.0-py37haec44b1_1
qt conda-forge/osx-64::qt-5.9.7-h93ee506_2
rabbitmq-server conda-forge/osx-64::rabbitmq-server-3.7.16-0
readline conda-forge/osx-64::readline-7.0-hcfe32e1_1001
reentry conda-forge/osx-64::reentry-1.3.1-py37hc8dfbb8_1
scipy conda-forge/osx-64::scipy-1.3.1-py37hab3da7d_2
setuptools conda-forge/osx-64::setuptools-46.1.3-py37hc8dfbb8_0
shellingham conda-forge/noarch::shellingham-1.3.2-py_0
shortuuid conda-forge/osx-64::shortuuid-1.0.1-py37hc8dfbb8_2
simplejson conda-forge/osx-64::simplejson-3.17.0-py37h0b31af3_0
sip conda-forge/osx-64::sip-4.19.8-py37h0a44026_1000
six conda-forge/noarch::six-1.14.0-py_1
sqlalchemy conda-forge/osx-64::sqlalchemy-1.3.16-py37h9bfed18_0
sqlalchemy-utils conda-forge/noarch::sqlalchemy-utils-0.34.2-py_0
sqlite conda-forge/osx-64::sqlite-3.28.0-h9721f7c_0
sqlparse conda-forge/noarch::sqlparse-0.3.1-py_0
tabulate conda-forge/noarch::tabulate-0.8.7-pyh9f0ad1d_0
tk conda-forge/osx-64::tk-8.6.10-hbbe82c9_0
topika conda-forge/osx-64::topika-0.2.1-py37_1
tornado conda-forge/osx-64::tornado-4.5.3-py37h0b31af3_1002
traitlets conda-forge/osx-64::traitlets-4.3.3-py37hc8dfbb8_1
tzcode conda-forge/osx-64::tzcode-2020a-h0b31af3_0
tzlocal conda-forge/noarch::tzlocal-2.0.0-py_0
upf_to_json conda-forge/noarch::upf_to_json-0.9.2-py_0
wcwidth conda-forge/noarch::wcwidth-0.1.9-pyh9f0ad1d_0
wheel conda-forge/noarch::wheel-0.34.2-py_1
wrapt conda-forge/osx-64::wrapt-1.11.2-py37h9bfed18_0
xorg-kbproto conda-forge/osx-64::xorg-kbproto-1.0.7-h1de35cc_1002
xorg-libice conda-forge/osx-64::xorg-libice-1.0.10-h01d97ff_0
xorg-libsm conda-forge/osx-64::xorg-libsm-1.2.3-h01d97ff_1000
xorg-libx11 conda-forge/osx-64::xorg-libx11-1.6.9-h0b31af3_0
xorg-libxau conda-forge/osx-64::xorg-libxau-1.0.9-h1de35cc_0
xorg-libxdmcp conda-forge/osx-64::xorg-libxdmcp-1.1.3-h01d97ff_0
xorg-libxext conda-forge/osx-64::xorg-libxext-1.3.4-h01d97ff_0
xorg-libxrender conda-forge/osx-64::xorg-libxrender-0.9.10-h01d97ff_1002
xorg-renderproto conda-forge/osx-64::xorg-renderproto-0.11.1-h1de35cc_1002
xorg-xextproto conda-forge/osx-64::xorg-xextproto-7.3.0-h1de35cc_1002
xorg-xproto conda-forge/osx-64::xorg-xproto-7.0.31-h1de35cc_1007
xz conda-forge/osx-64::xz-5.2.5-h0b31af3_0
yaml conda-forge/osx-64::yaml-0.2.4-h0b31af3_0
zeromq conda-forge/osx-64::zeromq-4.3.2-h6de7cb9_2
zlib conda-forge/osx-64::zlib-1.2.11-h0b31af3_1006
zstd conda-forge/osx-64::zstd-1.4.4-h4b3e974_3

Proceed ([y]/n)? y

Downloading and Extracting Packages
pexpect-4.8.0 | 79 KB | ############################################################################################################ | 100%
libffi-3.2.1 | 42 KB | ############################################################################################################ | 100%
colour-0.1.5 | 17 KB | ############################################################################################################ | 100%
sqlparse-0.3.1 | 30 KB | ############################################################################################################ | 100%
sip-4.19.8 | 251 KB | ############################################################################################################ | 100%
icu-58.2 | 22.3 MB | ############################################################################################################ | 100%
pgsu-0.1.0 | 15 KB | ############################################################################################################ | 100%
pyqt-5.9.2 | 4.5 MB | ############################################################################################################ | 100%
jinja2-2.11.2 | 93 KB | ############################################################################################################ | 100%
sqlite-3.28.0 | 2.4 MB | ############################################################################################################ | 100%
babel-2.8.0 | 6.0 MB | ############################################################################################################ | 100%
wheel-0.34.2 | 24 KB | ############################################################################################################ | 100%
circus-0.16.1 | 269 KB | ############################################################################################################ | 100%
libiconv-1.15 | 1.3 MB | ############################################################################################################ | 100%
argon2_cffi-19.1.0 | 43 KB | ############################################################################################################ | 100%
pygments-2.6.1 | 683 KB | ############################################################################################################ | 100%
python-3.7.3 | 20.7 MB | ############################################################################################################ | 100%
erlang-21.3 | 40.2 MB | ############################################################################################################ | 100%
bzip2-1.0.8 | 152 KB | ############################################################################################################ | 100%
wcwidth-0.1.9 | 20 KB | ############################################################################################################ | 100%
xorg-xextproto-7.3.0 | 27 KB | ############################################################################################################ | 100%
xorg-renderproto-0.1 | 9 KB | ############################################################################################################ | 100%
krb5-1.16.4 | 1.1 MB | ############################################################################################################ | 100%
cryptography-2.9.2 | 610 KB | ############################################################################################################ | 100%
upf_to_json-0.9.2 | 11 KB | ############################################################################################################ | 100%
django-2.2.8 | 4.7 MB | ############################################################################################################ | 100%
infinity-1.4 | 5 KB | ############################################################################################################ | 100%
aiida-core.services- | 4 KB | ############################################################################################################ | 100%
bcrypt-3.1.7 | 42 KB | ############################################################################################################ | 100%
tornado-4.5.3 | 642 KB | ############################################################################################################ | 100%
orderedmultidict-1.0 | 12 KB | ############################################################################################################ | 100%
xorg-libice-1.0.10 | 49 KB | ############################################################################################################ | 100%
pthread-stubs-0.4 | 5 KB | ############################################################################################################ | 100%
libgfortran-3.0.1 | 495 KB | ############################################################################################################ | 100%
pika-1.1.0 | 102 KB | ############################################################################################################ | 100%
pyyaml-5.1.2 | 172 KB | ############################################################################################################ | 100%
mako-1.1.0 | 57 KB | ############################################################################################################ | 100%
setuptools-46.1.3 | 636 KB | ############################################################################################################ | 100%
libxcb-1.13 | 307 KB | ############################################################################################################ | 100%
dbus-1.13.6 | 558 KB | ############################################################################################################ | 100%
pip-20.1 | 1.1 MB | ############################################################################################################ | 100%
yaml-0.2.4 | 80 KB | ############################################################################################################ | 100%
xorg-libxext-1.3.4 | 42 KB | ############################################################################################################ | 100%
furl-2.1.0 | 21 KB | ############################################################################################################ | 100%
libxslt-1.1.32 | 491 KB | ############################################################################################################ | 100%
phonenumbers-8.10.14 | 1.5 MB | ############################################################################################################ | 100%
paramiko-2.7.1 | 288 KB | ############################################################################################################ | 100%
arrow-0.15.5 | 96 KB | ############################################################################################################ | 100%
ete3-3.1.1 | 1.8 MB | ############################################################################################################ | 100%
aldjemy-0.9.1 | 20 KB | ############################################################################################################ | 100%
psycopg2-2.8.3 | 147 KB | ############################################################################################################ | 100%
lxml-4.4.1 | 1.4 MB | ############################################################################################################ | 100%
libcxx-10.0.0 | 1.0 MB | ############################################################################################################ | 100%
libcblas-3.8.0 | 10 KB | ############################################################################################################ | 100%
jpeg-9c | 237 KB | ############################################################################################################ | 100%
simplejson-3.17.0 | 99 KB | ############################################################################################################ | 100%
libsodium-1.0.17 | 308 KB | ############################################################################################################ | 100%
plumpy-0.14.5 | 62 KB | ############################################################################################################ | 100%
libpng-1.6.37 | 295 KB | ############################################################################################################ | 100%
appnope-0.1.0 | 9 KB | ############################################################################################################ | 100%
traitlets-4.3.3 | 133 KB | ############################################################################################################ | 100%
zstd-1.4.4 | 1.0 MB | ############################################################################################################ | 100%
sqlalchemy-1.3.16 | 1.8 MB | ############################################################################################################ | 100%
xorg-libxrender-0.9. | 24 KB | ############################################################################################################ | 100%
cffi-1.14.0 | 214 KB | ############################################################################################################ | 100%
topika-0.2.1 | 51 KB | ############################################################################################################ | 100%
scipy-1.3.1 | 16.0 MB | ############################################################################################################ | 100%
markupsafe-1.1.1 | 25 KB | ############################################################################################################ | 100%
zeromq-4.3.2 | 571 KB | ############################################################################################################ | 100%
tabulate-0.8.7 | 24 KB | ############################################################################################################ | 100%
expat-2.2.9 | 126 KB | ############################################################################################################ | 100%
shellingham-1.3.2 | 11 KB | ############################################################################################################ | 100%
glib-2.64.2 | 3.2 MB | ############################################################################################################ | 100%
ipython_genutils-0.2 | 21 KB | ############################################################################################################ | 100%
python-graphviz-0.14 | 19 KB | ############################################################################################################ | 100%
click-config-file-0. | 8 KB | ############################################################################################################ | 100%
libopenblas-0.3.7 | 8.4 MB | ############################################################################################################ | 100%
freetype-2.10.1 | 901 KB | ############################################################################################################ | 100%
ipython-7.13.0 | 1.1 MB | ############################################################################################################ | 100%
psutil-5.7.0 | 335 KB | ############################################################################################################ | 100%
libtiff-4.1.0 | 614 KB | ############################################################################################################ | 100%
frozendict-1.2 | 6 KB | ############################################################################################################ | 100%
click-7.1.2 | 64 KB | ############################################################################################################ | 100%
shortuuid-1.0.1 | 14 KB | ############################################################################################################ | 100%
aiida-core-1.2.1 | 2.2 MB | ############################################################################################################ | 100%
libwebp-base-1.1.0 | 766 KB | ############################################################################################################ | 100%
tzlocal-2.0.0 | 17 KB | ############################################################################################################ | 100%
xz-5.2.5 | 266 KB | ############################################################################################################ | 100%
python_abi-3.7 | 4 KB | ############################################################################################################ | 100%
python-editor-1.0.4 | 9 KB | ############################################################################################################ | 100%
ncurses-6.1 | 1.3 MB | ############################################################################################################ | 100%
prompt-toolkit-3.0.5 | 232 KB | ############################################################################################################ | 100%
ptyprocess-0.6.0 | 15 KB | ############################################################################################################ | 100%
openssl-1.1.1g | 1.9 MB | ############################################################################################################ | 100%
tzcode-2020a | 405 KB | ############################################################################################################ | 100%
qt-5.9.7 | 76.8 MB | ############################################################################################################ | 100%
anyjson-0.3.3 | 9 KB | ############################################################################################################ | 100%
six-1.14.0 | 13 KB | ############################################################################################################ | 100%
pycparser-2.20 | 89 KB | ############################################################################################################ | 100%
decorator-4.4.2 | 11 KB | ############################################################################################################ | 100%
libpq-11.3 | 2.4 MB | ############################################################################################################ | 100%
xorg-xproto-7.0.31 | 72 KB | ############################################################################################################ | 100%
sqlalchemy-utils-0.3 | 61 KB | ############################################################################################################ | 100%
xorg-libxau-1.0.9 | 11 KB | ############################################################################################################ | 100%
pynacl-1.3.0 | 1.5 MB | ############################################################################################################ | 100%
wrapt-1.11.2 | 42 KB | ############################################################################################################ | 100%
xorg-libxdmcp-1.1.3 | 16 KB | ############################################################################################################ | 100%
libxml2-2.9.9 | 1.2 MB | ############################################################################################################ | 100%
configobj-5.0.6 | 31 KB | ############################################################################################################ | 100%
python-dateutil-2.8. | 220 KB | ############################################################################################################ | 100%
kiwipy-0.5.3 | 35 KB | ############################################################################################################ | 100%
xorg-libx11-1.6.9 | 873 KB | ############################################################################################################ | 100%
liblapack-3.8.0 | 10 KB | ############################################################################################################ | 100%
backcall-0.1.0 | 13 KB | ############################################################################################################ | 100%
reentry-1.3.1 | 32 KB | ############################################################################################################ | 100%
readline-7.0 | 393 KB | ############################################################################################################ | 100%
jedi-0.17.0 | 809 KB | ############################################################################################################ | 100%
click-spinner-0.1.10 | 8 KB | ############################################################################################################ | 100%
numpy-1.17.5 | 5.0 MB | ############################################################################################################ | 100%
postgresql-11.3 | 4.3 MB | ############################################################################################################ | 100%
xorg-kbproto-1.0.7 | 26 KB | ############################################################################################################ | 100%
pcre-8.44 | 222 KB | ############################################################################################################ | 100%
idna-2.9 | 52 KB | ############################################################################################################ | 100%
ca-certificates-2020 | 146 KB | ############################################################################################################ | 100%
pyzmq-19.0.0 | 448 KB | ############################################################################################################ | 100%
rabbitmq-server-3.7. | 13.0 MB | ############################################################################################################ | 100%
certifi-2020.4.5.1 | 151 KB | ############################################################################################################ | 100%
tk-8.6.10 | 3.3 MB | ############################################################################################################ | 100%
xorg-libsm-1.2.3 | 22 KB | ############################################################################################################ | 100%
future-0.18.2 | 713 KB | ############################################################################################################ | 100%
pytz-2019.3 | 237 KB | ############################################################################################################ | 100%
click-completion-0.5 | 19 KB | ############################################################################################################ | 100%
libedit-3.1.20170329 | 152 KB | ############################################################################################################ | 100%
zlib-1.2.11 | 101 KB | ############################################################################################################ | 100%
intervals-0.8.1 | 10 KB | ############################################################################################################ | 100%
graphviz-2.42.3 | 7.1 MB | ############################################################################################################ | 100%
libblas-3.8.0 | 10 KB | ############################################################################################################ | 100%
gettext-0.19.8.1 | 3.3 MB | ############################################################################################################ | 100%
passlib-1.7.1 | 372 KB | ############################################################################################################ | 100%
pickleshare-0.7.5 | 12 KB | ############################################################################################################ | 100%
parso-0.7.0 | 67 KB | ############################################################################################################ | 100%
alembic-1.4.2 | 111 KB | ############################################################################################################ | 100%
lz4-c-1.9.2 | 164 KB | ############################################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate aiida

To deactivate an active environment, use

$ conda deactivate

(base) nh@iMac-Pro ~ % conda activate aiida
(aiida) nh@iMac-Pro ~ % reentry scan
(aiida) nh@iMac-Pro ~ % initdb -D mylocalDB
The files belonging to this database system will be owned by user "nh".
This user must also own the server process.

The database cluster will be initialized with locale "en_GB.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory mylocalDB ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Europe/London
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

pg_ctl -D mylocalDB -l logfile start

(aiida) nh@iMac-Pro ~ % pg_ctl -D mylocalDB -l logfile start
waiting for server to start.... done
server started
(aiida) nh@iMac-Pro ~ % verdi quicksetup
Info: enter "?" for help
Info: enter "!" to ignore the default and set no value
Profile name [quicksetup]: me
Email Address (for sharing data) [[email protected]]:
First name [Nic]:
Last name [Harrison]:
Institution [ICL]:
Success: created new profile me.
Info: migrating the database.
Operations to perform:
Apply all migrations: auth, contenttypes, db
Running migrations:
Applying contenttypes.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0001_initial... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying auth.0010_alter_group_name_max_length... OK
Applying auth.0011_update_proxy_permissions... OK
Applying db.0001_initial... OK
Applying db.0002_db_state_change... OK
Applying db.0003_add_link_type... OK
Applying db.0004_add_daemon_and_uuid_indices... OK
Applying db.0005_add_cmtime_indices... OK
Applying db.0006_delete_dbpath... OK
Applying db.0007_update_linktypes... OK
Applying db.0008_code_hidden_to_extra... OK
Applying db.0009_base_data_plugin_type_string... OK
Applying db.0010_process_type... OK
Applying db.0011_delete_kombu_tables... OK
Applying db.0012_drop_dblock... OK
Applying db.0013_django_1_8... OK
Applying db.0014_add_node_uuid_unique_constraint... OK
Applying db.0015_invalidating_node_hash... OK
Applying db.0016_code_sub_class_of_data... OK
Applying db.0017_drop_dbcalcstate... OK
Applying db.0018_django_1_11... OK
Applying db.0019_migrate_builtin_calculations... OK
Applying db.0020_provenance_redesign... OK
Applying db.0021_dbgroup_name_to_label_type_to_type_string... OK
Applying db.0022_dbgroup_type_string_change_content... OK
Applying db.0023_calc_job_option_attribute_keys... OK
Applying db.0024_dblog_update... OK
Applying db.0025_move_data_within_node_module... OK
Applying db.0026_trajectory_symbols_to_attribute... OK
Applying db.0027_delete_trajectory_symbols_array... OK
Applying db.0028_remove_node_prefix... OK
Applying db.0029_rename_parameter_data_to_dict... OK
Applying db.0030_dbnode_type_to_dbnode_node_type... OK
Applying db.0031_remove_dbcomputer_enabled... OK
Applying db.0032_remove_legacy_workflows... OK
Applying db.0033_replace_text_field_with_json_field... OK
Applying db.0034_drop_node_columns_nodeversion_public... OK
Applying db.0035_simplify_user_model... OK
Applying db.0036_drop_computer_transport_params... OK
Applying db.0037_attributes_extras_settings_json... OK
Applying db.0038_data_migration_legacy_job_calculations... OK
Applying db.0039_reset_hash... OK
Applying db.0040_data_migration_legacy_process_attributes... OK
Applying db.0041_seal_unsealed_processes... OK
Applying db.0042_prepare_schema_reset... OK
Applying db.0043_default_link_label... OK
Applying db.0044_dbgroup_type_string... OK
Success: database migration completed.
Traceback (most recent call last):
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
return fn()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
return _ConnectionFairy._checkout(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
rec = pool._do_get()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
self.dec_overflow()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
return self._create_connection()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in init
self.__connect(first_connect_check=True)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 657, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
connection = pool._invoke_creator(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/psycopg2/init.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "None" to address: nodename nor servname provided, or not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/nh/opt/anaconda3/envs/aiida/bin/verdi", line 11, in
sys.exit(verdi())
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/cmdline/commands/cmd_setup.py", line 171, in quicksetup
ctx.invoke(setup, **setup_parameters)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/cmdline/commands/cmd_setup.py", line 87, in setup
email=email, first_name=first_name, last_name=last_name, institution=institution
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/users.py", line 47, in get_or_create
return False, self.get(email=email)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/entities.py", line 133, in get
return res.one()[0]
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2131, in one
res = self.all()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2206, in all
return list(self.iterall(batch_size=batch_size))
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2163, in iterall
for item in self._impl.iterall(query, batch_size, self._attrkeys_as_in_sql_result):
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/implementation/querybuilder.py", line 322, in iterall
for rowitem in results:
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3405, in iter
return self._execute_and_instances(context)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3427, in _execute_and_instances
querycontext, self._connection_from_session, close_with_result=True
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3442, in _get_bind_args
mapper=self._bind_mapper(), clause=querycontext.statement, **kw
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3420, in _connection_from_session
conn = self.session.connection(**kw)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1133, in connection
execution_options=execution_options,
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1139, in _connection_for_bind
engine, execution_options
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 432, in _connection_for_bind
conn = bind._contextual_connect()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2251, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2289, in wrap_pool_connect
e, dialect, self
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1555, in handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from
=e
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2285, in _wrap_pool_connect
return fn()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 363, in connect
return _ConnectionFairy._checkout(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
rec = pool._do_get()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
self.dec_overflow()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
return self._create_connection()
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 437, in init
self.__connect(first_connect_check=True)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 657, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 652, in __connect
connection = pool._invoke_creator(self)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/psycopg2/init.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "None" to address: nodename nor servname provided, or not known

(Background on this error at: http://sqlalche.me/e/e3q8)
(aiida) nh@iMac-Pro ~ % �

@chrisjsewell
Copy link
Member Author

chrisjsewell commented May 2, 2020

@iclnmh, so I can see what the connection details look like, could you perhaps try running:

$ psql postgres
psql (11.3)
Type "help" for help.
postgres=# \conninfo
You are connected to database "postgres" as user "ubuntu" via socket in "/tmp" at port "5432".
postgres=# \q

(assuming your database is running, i.e. after pg_ctl -D mylocalDB -l logfile start)

oh and also what are the cintents of the logfile?

@chrisjsewell
Copy link
Member Author

chrisjsewell commented May 2, 2020

cc'ing @ltalirz since this could be relevant to pgsu?

@chrisjsewell
Copy link
Member Author

I get something similar trying to follow the same instructions on Mac: after the migration it hangs for a while, then gives:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Operation timed out
	Is the server running on host "None" (92.242.132.24) and accepting
	TCP/IP connections on port 5432?

BUT if I did verdi quicksetup --db-name other it worked. Then I tried it again and it worked just with verdi quicksetup! It seems kind off intermittent, perhaps to do with the UUID based names auto-generated for the db_user and db_name (e.g. aiida_qs_cjs14_8e75340aa9a2fd5159db8177025662eb)?

@iclnmh perhaps try directly specifying --db-name and/or --db-username.

@iclnmh
Copy link

iclnmh commented May 2, 2020

(aiida) nh@iMac-Pro ~ % psql postgres
psql (12.2)
Type "help" for help.

postgres=# \conninfo
You are connected to database "postgres" as user "nh" via socket in "/tmp" at port "5432".

@iclnmh
Copy link

iclnmh commented May 2, 2020

verdi quicksetup --db-name other
same error

verdi quicksetup --db-name other --db-username nh

Info: enter "?" for help
Info: enter "!" to ignore the default and set no value
Profile name [quicksetup]:
Email Address (for sharing data) [[email protected]]:
First name [Nic]:
Last name [Harrison]:
Institution [ICL]:
Info: Database user "nh" already exists!
Use it? [y/N]: y
Info: database other already exists!
Use it (make sure it is not used by another profile)? [y/N]: y
Success: created new profile quicksetup.
Info: migrating the database.
Success: database migration completed.

@iclnmh
Copy link

iclnmh commented May 2, 2020

@chrisjsewell Verdi is then up and running.

I pushed forward testing the installation instructions and had the following problems (I do hope that this helps).

In [1]: !verdi status
✓ config dir: /Users/nh/.aiida
✓ profile: On profile quicksetup
✓ repository: /Users/nh/.aiida/repository/quicksetup
✓ postgres: Connected as nh@localhost:5432
✓ rabbitmq: Connected to amqp://127.0.0.1?heartbeat=600
✓ daemon: Daemon is running as PID 28677 since 2020-05-02 15:48:30

but a fresh checkout of aiida-crystal17 reveals two more problems with the current installation instructions:

Pytest Fails:

pytest

/Users/nh/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/manage/fixtures.py:22: AiidaDeprecationWarning: this module is deprecated, use aiida.manage.tests and its submodules instead
warnings.warn('this module is deprecated, use aiida.manage.tests and its submodules instead', AiidaDeprecationWarning) # pylint: disable=no-member
ImportError while loading conftest '/Users/nh/Box/CMSG/Software/GitHub/aiida-crystal17/conftest.py'.
conftest.py:22: in
from aiida_crystal17.tests import (get_test_structure, get_test_structure_and_symm, open_resource_binary,
aiida_crystal17/tests/init.py:2: in
from aiida_crystal17.tests.resources import * # noqa: F401,F403
aiida_crystal17/tests/resources.py:6: in
import importlib_resources
E ModuleNotFoundError: No module named 'importlib_resources'

Installation of the package fails:

% pip install -e .
....
....
ERROR: pgsu 0.1.0 has requirement psycopg2-binary>=2.8.3, but you'll have psycopg2-binary 2.8 which is incompatible.
....
....
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Then, of course,

In [2]: !verdi plugin list aiida.calculations crystal17.basic

fails as the entry point is missing

Note that Verdi finds the calculator !

% verdi plugin list aiida.calculations
Registered entry points for aiida.calculations:

  • arithmetic.add
  • crystal17.basic
  • crystal17.doss
  • crystal17.ech3
  • crystal17.main
  • crystal17.newk
  • crystal17.ppan
  • gulp.fitting
  • gulp.optimize
  • gulp.single
  • templatereplacer

Info: Pass the entry point as an argument to display detailed information

@chrisjsewell
Copy link
Member Author

chrisjsewell commented May 2, 2020

thanks @iclnmh

I've done some testing and it appears to be and issue of creating a new database user name, and then using it in the same command execution:

  • If I use my superuser name also for the database user name it works fine
  • If I run quicksetup after the initial error (using the previously created username) it works fine
  • If I run quicksetup again, for a new profile with the same username it works fine
  • If I run quicksetup again, for a new profile with a new username the exception is raised again.

Using time.sleep at some point after the new user name is created would be my first thought to try, so that the postgresql subprocess has time to finish

@chrisjsewell
Copy link
Member Author

@iclnmh we can move the aiida-crystal17 specific issues to aiidaplugins/aiida-crystal17#34

@ltalirz
Copy link
Member

ltalirz commented May 2, 2020

Hi guys, thanks for reporting this.
It does indeed look like an issue either with values for the hostname specified by AiiDA, or by something in pgsu.
I will follow up on this but, unfortunately, this will have to wait one week since I'll have zero free time next week.

@ltalirz ltalirz self-assigned this May 2, 2020
@chrisjsewell chrisjsewell changed the title conda + verdi quicksetup failure on MacOS verdi quicksetup failure on MacOS May 2, 2020
@chrisjsewell
Copy link
Member Author

chrisjsewell commented May 2, 2020

@ltalirz this appears to be the issue:

host = self.dsn.get('host')
if self.connection_mode == PostgresConnectionMode.PSQL:
# If "sudo su postgres" was needed to create the DB, we are likely on Ubuntu, where
# the same will *not* work for arbitrary database users => enforce TCP/IP connection
host = host or 'localhost'
return host

from:

print(self.connection_mode)
print(self.dsn)

on Mac I get:

PostgresConnectionMode.PSYCOPG
{'host': None, 'port': 5432, 'user': None, 'password': None, 'database': 'template1'}

If you also use host = host or 'localhost' for this connection mode, it fixes the issue.
Is this an adequate fix, or would it have side effects for other use cases?

@ltalirz
Copy link
Member

ltalirz commented May 2, 2020

I see.

The difference between specifying a host (localhost) and not specifying one (None) should be that in the latter case, the postgres settings for local connections apply.
The only setup scenario I know where this makes a difference is the default postgres installation on Ubuntu, where postgres will then use peer authentication as explained here.

I'm surprised to run into this issue, since pgsu is tested on MacOS with postgres installed via conda:
https://github.com/aiidateam/pgsu/runs/562588100?check_suite_focus=true#step:5:28
and I don't think I'm passing any explicit host in the tests
(which I thought would mean that the psycopg connection with host=None works)

@chrisjsewell
Copy link
Member Author

I'm surprised to run into this issue

Well both I and @iclnmh have individually observed this, so it seems to be not anything unique to either of our setups. Obviously if anyone else has a Mac, it would be good for them to test it also.

Anyway the error due to host=None happens when we get to verdi setup, which is after the use of pgsu. So this wouldn't be captured in pgsu tests would it?
Ideally verdi quicksetup itself would be tested on MacOS

@ltalirz
Copy link
Member

ltalirz commented May 2, 2020

Sure, I didn't mean to dismiss your observation and we need to fix it in any case!

One question: does the pgsu command work?

@chrisjsewell
Copy link
Member Author

Sure, I didn't mean to dismiss your observation

Oh no I didn't mean to imply you were 😁

One question: does the pgsu command work?

will test probably tomorrow

@ltalirz
Copy link
Member

ltalirz commented Jun 5, 2020

@chrisjsewell Still waiting for that pgsu test ;-)

@flavianojs
Copy link
Contributor

Error when trying to setup a profile:

(aiida) flavianojs@Flavianos-MacBook-Pro ~ % verdi quicksetup
Info: enter "?" for help
Info: enter "!" to ignore the default and set no value
Profile name [quicksetup]: profile1
Email Address (for sharing data): [email protected]
First name: Flaviano
Last name: dos Santos
Institution: fz-juelich
Info: Database user "aiida_qs_flavianojs_f6fe17bbca687890d3a7674444563ae1" already exists!
Use it? [y/N]: y
Info: database profile1_flavianojs_f6fe17bbca687890d3a7674444563ae1 already exists!
Use it (make sure it is not used by another profile)? [y/N]: y
Success: created new profile profile1.
Info: migrating the database.
Success: database migration completed.
Traceback (most recent call last):
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect
return fn()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self.dec_overflow()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 440, in init
self.__connect(first_connect_check=True)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 493, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/psycopg2/init.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "None" to address: nodename nor servname provided, or not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/flavianojs/opt/anaconda3/envs/aiida/bin/verdi", line 11, in
sys.exit(verdi())
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/cmdline/commands/cmd_setup.py", line 171, in quicksetup
ctx.invoke(setup, **setup_parameters)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/cmdline/commands/cmd_setup.py", line 87, in setup
email=email, first_name=first_name, last_name=last_name, institution=institution
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/users.py", line 47, in get_or_create
return False, self.get(email=email)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/entities.py", line 133, in get
return res.one()[0]
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2131, in one
res = self.all()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2204, in all
matches = list(self.iterall(batch_size=batch_size))
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/querybuilder.py", line 2163, in iterall
for item in self._impl.iterall(query, batch_size, self._attrkeys_as_in_sql_result):
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/aiida/orm/implementation/querybuilder.py", line 322, in iterall
for rowitem in results:
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3503, in iter
return self._execute_and_instances(context)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3525, in _execute_and_instances
querycontext, self._connection_from_session, close_with_result=True
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3540, in _get_bind_args
mapper=self._bind_mapper(), clause=querycontext.statement, **kw
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3518, in _connection_from_session
conn = self.session.connection(**kw)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1141, in connection
execution_options=execution_options,
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 1147, in _connection_for_bind
engine, execution_options
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 433, in _connection_for_bind
conn = bind._contextual_connect()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2305, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2343, in wrap_pool_connect
e, dialect, self
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1585, in handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from
=e
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2339, in _wrap_pool_connect
return fn()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self.dec_overflow()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 440, in init
self.__connect(first_connect_check=True)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in exit
exc_value, with_traceback=exc_tb,
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise

raise exception
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 493, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/Users/flavianojs/opt/anaconda3/envs/aiida/lib/python3.7/site-packages/psycopg2/init.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "None" to address: nodename nor servname provided, or not known

(Background on this error at: http://sqlalche.me/e/13/e3q8)

@chrisjsewell
Copy link
Member Author

@chrisjsewell Still waiting for that pgsu test ;-)

just on this: yes the pgsu command works

@chrisjsewell
Copy link
Member Author

@ltalirz at a guess, perhaps when parsing None to click invoke it parsers it as a string:

ctx.invoke(setup, **setup_parameters)

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

Thanks @chrisjsewell , this might indeed be the issue.

I just confirmed with psycopg2 directly that passing None as the host works fine, while passing "None" yields the error that was observed.

This also explains why part of the setup worked fine (the stuff happening inside quicksetup).
The question remains how to resolve it. Hm...

@chrisjsewell
Copy link
Member Author

I refer you to my initial comment 😁
#4032 (comment)

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

Ok, the way to resolve it is probably simply not to pass the hostname parameter.

@chrisjsewell
Copy link
Member Author

chrisjsewell commented Jul 10, 2020

so remove None from setup_parameters? that could work

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

I refer you to my initial comment 😁
#4032 (comment)

And I refer to my reply ;-) #4032 (comment)

so remove None from setup_parameters? that could work

Exactly.

@chrisjsewell
Copy link
Member Author

setup_parameters = {k: v for k, v in setup_parameters.items() if v is not None}

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

yes. do you want to open the PR?

@chrisjsewell
Copy link
Member Author

on it

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

This is something we need to keep in mind wherever we use invoke to pass parameters to a command.

I will open an issue for this.

@chrisjsewell
Copy link
Member Author

it may just be to do with the code in @options_setup.QUICKSETUP_DATABASE_HOSTNAME(), but its pretty difficult to trace that code path

@giovannipizzi
Copy link
Member

About the comment: @ltalirz when you want to use a peer connection, then you shouldn't use a port either, right? Here it seems it returns None but then a port is returned

@giovannipizzi
Copy link
Member

Ok, I think that if you really want to use peer authentication, then you don't need username, pwd, and port. So the string here:

separator = ':' if profile.database_port else ''
engine_url = 'postgresql://{user}:{password}@{hostname}{separator}{port}/{name}'.format(
separator=separator,
user=profile.database_username,
password=profile.database_password,
hostname=profile.database_hostname,
port=profile.database_port,
name=profile.database_name
)
return create_engine(
engine_url, json_serializer=json.dumps, json_deserializer=json.loads, encoding='utf-8', **kwargs
)

one needs to say something a bit different. Probably:

separator = ':' if profile.database_port else '' 
connection_part = '' if hostname is None else '{user}:{password}@{hostname}{separator}{port}'.format(
     separator=separator, 
     user=profile.database_username, 
     password=profile.database_password, 
     hostname=profile.database_hostname, 
     port=profile.database_port, 
)
engine_url = 'postgresql://{connection_part}/{name}'.format( 
     connection_part=connection_part,
     name=profile.database_name 
 ) 
 return create_engine( 
     engine_url, json_serializer=json.dumps, json_deserializer=json.loads, encoding='utf-8', **kwargs 
 ) 

I tried with Mohammad and the new string works on a Mac with conda. This is what we tried, for ref:

from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from aiida.orm.implementation.django.querybuilder import DjangoQueryBuilder
from aiida.manage.manager import get_manager

engine_url = "postgresql:///quicksetup_mohammad_9277afd29c3e03ec8066b67360e1be3b"

engine = create_engine(engine_url)
session = scoped_session(sessionmaker(bind=engine))

backend = get_manager()._backend
dqb = DjangoQueryBuilder(backend)

session.query(dqb.Computer).with_entities(dqb.Computer.name).all()

where quicksetup_mohammad_9277afd29c3e03ec8066b67360e1be3b is the name of the DB that quicksetup had created.

@ltalirz @chrisjsewell @sphuber what do you think of this solution? Note: I didn't test the actual snippet above

@chrisjsewell
Copy link
Member Author

chrisjsewell commented Jul 10, 2020

so if you use postgres with conda+osx, you can no longer specify a port. That doesn't seem right?

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

@giovannipizzi Thanks for pointing us to this utils code.

My first comment would be that this code (at least the one to construct the engine_url form an AiiDA profile) in my view really belongs in the aiida.manage.external.postgres module (doesn't have to be inside the Postgres class, but somewhere there in the module).
Unless others disagree, let's move it there.

I do agree that we will need to adapt it for the case when the hostname is not set - as you may have discovered yourself, providing a hostname localhost vs not providing a hostname can make a difference, i.e. I think we need to continue to support both options.

Finally, where is the corresponding code for django, and can we move it inside postgres.py as well?

P.S. The header of the file says:

"""Backend-agnostic utility functions"""

;-)

@sphuber
Copy link
Contributor

sphuber commented Jul 10, 2020

Finally, where is the corresponding code for django, and can we move it inside postgres.py as well?

This is in aiida.backends because the aiida.backends is the module that deals with code connecting to the database backend. The name backend is a bit unfortunate, I agree, but is just historical, because at the time, the database backend was the only backend there was in aiida-core.

The reason there is no Django equivalent code is because this part is used by all database backends. Even the Django implementation uses this through the QueryBuilder which uses SqlAlchemy. See this commit 09cb6cb

@c-cppx
Copy link

c-cppx commented Jul 10, 2020

connection_part = If hostname is None else.. did not work because the hostname is not defined. By using a try-except block instead of if-else however no errors are thrown by setting up a profile.

I opened a verdi shell and entered
QueryBuilder().append(Node).all()
which returned an empty list [] , without errors or complaints

@giovannipizzi
Copy link
Member

Thanks @c-cppx for the report!
Indeed I did a mistake. The more correct version should read:

separator = ':' if profile.database_port else '' 
connection_part = '' if profile.database_hostname is None else '{user}:{password}@{hostname}{separator}{port}'.format(
     separator=separator, 
     user=profile.database_username, 
     password=profile.database_password, 
     hostname=profile.database_hostname, 
     port=profile.database_port, 
)
engine_url = 'postgresql://{connection_part}/{name}'.format( 
     connection_part=connection_part,
     name=profile.database_name 
 ) 
 return create_engine( 
     engine_url, json_serializer=json.dumps, json_deserializer=json.loads, encoding='utf-8', **kwargs 
 ) 

Good to know that this is a good fix!
Before moving the function around, I would suggest to merge this fix in a PR

@c-cppx
Copy link

c-cppx commented Jul 10, 2020

This works as well for me. (But I removed the additional space in the last 4 lines.)

@ltalirz
Copy link
Member

ltalirz commented Jul 11, 2020

One comment on None being passed as a string:

I just checked and this conversion of parameters to strings by invoke is not the default behavior of click:

import click

@click.group()
def group():
    pass

@group.command('test')
def test(param):
    print(param, type(param))

@group.command()
@click.pass_context
def inv(ctx):
    ctx.invoke(test, None)
    ctx.invoke(test, 'None')

if __name__ == '__main__':
    group()
$ python script.py inv
None <class 'NoneType'>
None <class 'str'>

I.e. as @chrisjsewell suspected, it seems we are causing this conversion in our @options_setup.QUICKSETUP_DATABASE_HOSTNAME() option, which would be good to correct.

@giovannipizzi
Copy link
Member

@ltalirz are you sure we are invoking with "None" instead of None? If my snippet above works as @c-cppx says, I think it's correctly passing None. The conversion to string happens simply in the function in aiida/backends/utils.py

@c-cppx thanks, indeed you are right, I left over some spaces when copy-pasting, thanks for pointing this out!

@ltalirz
Copy link
Member

ltalirz commented Jul 11, 2020

@ltalirz are you sure we are invoking with "None" instead of None? If my snippet above works as @c-cppx says, I think it's correctly passing None. The conversion to string happens simply in the function in aiida/backends/utils.py

No, I wasn't sure - indeed, I see now that the issue may just be that the connection string did not support peer authentication.

@sphuber sphuber added this to the v1.4.0 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment