grandma-collaboration / skyportal_grandma_dev

Little Git Repo to keep track of the work done by the A4 ESILV TEAM
2 stars 0 forks source link

Manon Flament - Installing SkyPortal #8

Closed ManonFlt closed 1 year ago

ManonFlt commented 1 year ago

Hello! I am at the lauching part and the "make db_init" gives me the following error:

/bin/bash: python: command not found

Welcome to SkyPortal v (https://skyportal.io)

/usr/bin/env: ‘python’: No such file or directory make[1]: [baselayer/Makefile:44: dependencies] Error 127 make: [Makefile:74: db_init] Error 2

Theodlz commented 1 year ago

Hi @ManonFlt. If python is installed, i'm not sure why you would get this error... One possibility is that you have python3 installed, rather than just python. To fix that, please run apt install python-is-python3. This package tells your computer that python3 can be called as python.

ManonFlt commented 1 year ago

Hi @Theodlz I have another error with make db_init now and I can't find how to solve it

[!] Some system dependencies seem to be unsatisfied

The failed checks were:

- npm: `npm -v`
  Required 8.3.2, found 6.14.5
- node: `node -v`
  Required 16.14.0, found 14.4.0

Please refer to https://cesium-ml.org/baselayer for installation instructions.

make[1]: [baselayer/Makefile:44: dependencies] Error 255 make: [Makefile:74: db_init] Error 2

Theodlz commented 1 year ago

Well it just tells you that you version of node.js and npm is too old. Did you try installing a more recent one?

Theodlz commented 1 year ago

To do this you can use the npm module named n. Its a node.js version manager.

Install it with sudo npm install -g n.

Then install a new version of node.js by running n 18.

Note: When you are done, you need to close the terminal and open a new one to be able to use the new version.

ManonFlt commented 1 year ago

Now that I have the required versions, I have new errors about missing depedencies:

[✗] Verifying Python package dependencies The 'iminuit==2.15.2' distribution was not found and is required by the application ERROR: Double requirement given: selenium-requests>=1.4 (from -r baselayer/requirements.txt (line 18)) (already in selenium-requests>=2.0.0 (from -r baselayer/requirements.txt (line 11)), name='selenium-requests') make[1]: [baselayer/Makefile:45: dependencies] Error 1 make: [Makefile:74: db_init] Error 2

ManonFlt commented 1 year ago

So I tried to install iminuit 2.15.2 and it gives me this error:

ERROR: Could not find a version that satisfies the requirement 2.15.2 (from versions: none) ERROR: No matching distribution found for 2.15.2

And if I install the latest version it doesn't work either

Theodlz commented 1 year ago

Could you paste here the code you ran when you tried to install it? Otherwise I can't tell what went wrong

ManonFlt commented 1 year ago

I have solved the previous issue but now I have a new error with the command make db_init

[✗] Verifying Python package dependencies pip 20.0.2 is installed but pip==22.2.2 is required Traceback (most recent call last): File "/home/manon/skyportal/skyportal_env/bin/pip", line 5, in from pip._internal.cli.main import main File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 10, in from pip._internal.cli.autocompletion import autocomplete File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 9, in from pip._internal.cli.main_parser import create_main_parser File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in from pip._internal.cli import cmdoptions File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in from pip._internal.exceptions import CommandError File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_internal/exceptions.py", line 10, in from pip._vendor.six import iteritems File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_vendor/init.py", line 65, in vendored("cachecontrol") File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip/_vendor/init.py", line 36, in vendored import(modulename, globals(), locals(), level=0) File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/init.py", line 9, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/CacheControl-0.12.6-py2.py3-none-any.whl/cachecontrol/adapter.py", line 5, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/requests-2.22.0-py2.py3-none-any.whl/requests/init.py", line 95, in File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 618, in _load_backward_compatible File "", line 259, in load_module File "/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/OpenSSL/init.py", line 8, in from OpenSSL import SSL, crypto File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/OpenSSL/SSL.py", line 19, in from OpenSSL.crypto import ( File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/OpenSSL/crypto.py", line 3224, in utils.deprecated( TypeError: deprecated() got an unexpected keyword argument 'name' make[1]: [baselayer/Makefile:45: dependencies] Error 1 make: [Makefile:74: db_init] Error 2

Theodlz commented 1 year ago

Ok so it tells you that pip is outdated (in the first lines). Did you try updating it?

ManonFlt commented 1 year ago

I did sudo apt-get upgrade pip which worked:

Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python3-pip' instead of 'pip' python3-pip is already the newest version (20.0.2-5ubuntu1.6). Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And pip --version gives me: pip 22.3 from /home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip (python 3.8)

Theodlz commented 1 year ago

Ok! So that updates pip as you want it too, however it does not upgrade the pip of the virtualenv you already created! To do that, enter the virtualenv (with source blablabla as mentionned in the tutorial) and run install --upgrade pip

Keep me posted! Good luck

ManonFlt commented 1 year ago

Hello I tried to delete everything and restart the setup from the beginning, but I'm stuck again at the make db_init with the same error: Welcome to SkyPortal v0.9.dev0+git20221028.5760cbe8 (https://skyportal.io)

Checking system dependencies: [✓] nginx >= 1.7 [ 1.18.0] [✓] psql >= 12.0 [ 12.12] [✓] npm >= 8.3.2 [ 8.19.2] [✓] node >= 16.14.0 [ 18.12.0] [✓] python >= 3.8 [ 3.8.10]

[✓] Baselayer installed inside of app

[✗] Verifying Python package dependencies pip 20.0.2 is installed but pip==22.2.2 is required Traceback (most recent call last): File "/home/manon/skyportal/skyportal_env/bin/pip", line 11, in load_entry_point('pip==22.3', 'console_scripts', 'pip')() File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pkg_resources/init.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pkg_resources/init.py", line 2852, in load_entry_point return ep.load() File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pkg_resources/init.py", line 2443, in load return self.resolve() File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pkg_resources/init.py", line 2449, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/cli/main.py", line 9, in from pip._internal.cli.autocompletion import autocomplete File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/cli/autocompletion.py", line 10, in from pip._internal.cli.main_parser import create_main_parser File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/cli/main_parser.py", line 9, in from pip._internal.build_env import get_runnable_pip File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/build_env.py", line 20, in from pip._internal.cli.spinners import open_spinner File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/cli/spinners.py", line 9, in from pip._internal.utils.logging import get_indentation File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/utils/logging.py", line 29, in from pip._internal.utils.misc import ensure_dir File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/utils/misc.py", line 42, in from pip._internal.locations import get_major_minor_version File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/locations/init.py", line 67, in from . import _distutils File "/home/manon/skyportal/skyportal_env/lib/python3.8/site-packages/pip-22.3-py3.8.egg/pip/_internal/locations/_distutils.py", line 20, in from distutils.cmd import Command as DistutilsCommand ModuleNotFoundError: No module named 'distutils.cmd' make[1]: [baselayer/Makefile:45: dependencies] Error 1 make: [Makefile:74: db_init] Error 2

ManonFlt commented 1 year ago

Even after running sudo apt install --upgrade pip I still have a problem with pip: pip 20.0.2 is installed but pip==22.2.2 is required

ManonFlt commented 1 year ago

pip install pip==22.2.2 worked so now I have all the package dependencies

Theodlz commented 1 year ago

Great! Did the app start after that?

Theodlz commented 1 year ago

Again, you need to update pip and THEN create the virtualenv. Otherwise your virtual env will be using the old pip

ManonFlt commented 1 year ago

I still have mistakes on make db_init, the database gets initialized but then the connection doesn't work:

Welcome to SkyPortal v0.9.dev0+git20221028.5760cbe8 (https://skyportal.io)

Checking system dependencies: [✓] nginx >= 1.7 [ 1.18.0] [✓] psql >= 12.0 [ 12.12] [✓] npm >= 8.3.2 [ 8.19.2] [✓] node >= 16.14.0 [ 18.12.0] [✓] python >= 3.8 [ 3.8.10]

[✓] Baselayer installed inside of app

[✓] Verifying Python package dependencies [✓] Silently executing: baselayer/tools/check_js_deps.sh

Initializing database: Config files: baselayer/config.yaml.defaults config.yaml.defaults config.yaml [22:20:29 db_init] Initializing databases [✓] Creating user [skyportal] [·] Creating database [skyportal] Warning: could not create db skyportal

You should create it manually by invoking createdb. Then, execute:

psql -U skyportal --no-password -h localhost -p 5432 -c "GRANT ALL PRIVILEGES ON DATABASE skyportal TO skyportal;" skyportal

[✓] Creating database [skyportal] [·] Creating database [skyportal_test] Warning: could not create db skyportal_test

You should create it manually by invoking createdb. Then, execute:

psql -U skyportal --no-password -h localhost -p 5432 -c "GRANT ALL PRIVILEGES ON DATABASE skyportal_test TO skyportal;" skyportal_test

[✓] Creating database [skyportal_test] [✗] Testing database connection to [skyportal]

!!! Error accessing database:

The most common cause of database connection errors is a misconfigured pg_hba.conf.

We tried to connect to the database with the following parameters:

database: skyportal username: skyportal host: localhost port: 5432

The postgres client exited with the following error message:


psql: error: fe_sendauth: no password supplied

Please modify your pg_hba.conf, and use the following command to check your connection:

psql -U skyportal --no-password -h localhost -p 5432 -c 'SELECT 0;' skyportal

make[1]: [baselayer/Makefile:51: db_init] Error 1 make: [Makefile:74: db_init] Error 2

mcoughlin commented 1 year ago

Did you change pg_hba.conf to read trust on all the lines?

https://skyportal.io/docs/setup.html

Or what does that file look like now?

ManonFlt commented 1 year ago

Yes I did, it looks like this:

host skyportal skyportal ::1/128 trust host skyportal_test skyportal ::1/128 trust host all postgres ::1/128 trust

Database administrative login by Unix domain socket

local all postgres peer

TYPE DATABASE USER ADDRESS METHOD

"local" is for Unix domain socket connections only

local all all peer

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

Allow replication connections from localhost, by a user with the

replication privilege.

local replication all peer host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5

mcoughlin commented 1 year ago

I would personally set all to trust and restart postgres.

ManonFlt commented 1 year ago

It worked thank you!

Theodlz commented 1 year ago

Yes I did, it looks like this:

host skyportal skyportal ::1/128 trust host skyportal_test skyportal ::1/128 trust host all postgres ::1/128 trust

Database administrative login by Unix domain socket

local all postgres peer

TYPE DATABASE USER ADDRESS METHOD

"local" is for Unix domain socket connections only

local all all peer

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

Allow replication connections from localhost, by a user with the

replication privilege.

local replication all peer host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5

@ManonFlt so if I understand well, you added the ipv6 config (::1/128) rather than the ipv4. Both are given in the setup documentation. Maybe I ask why you chose this one rather than the other? Just to figure out if something is not clear in the docs. Also, it's more likely to be the ipv4 that you need. ipv6 was only needed on the VM we use for production, but otherwise ipv4 should be fine on most machines.

Theodlz commented 1 year ago

here is my config (which I directly copied and pasted from the docs):

host skyportal skyportal 127.0.0.1/32 trust
host skyportal_test skyportal 127.0.0.1/32 trust
host all postgres 127.0.0.1/32 trust
Theodlz commented 1 year ago

But as Michael said, and as I mentioned during our first zoom, just allowing all connections is super fine for development, as we don't have any sensible data in the db (just demo data).

So you can keep your config as is if it works!

Theodlz commented 1 year ago

@ManonFlt if you are done with starting SkyPortal, please close this issue and move to the next step which is described in issue https://github.com/grandma-collaboration/skyportal_grandma_dev/issues/12