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

Failure to re-create venv after Poetry update in 5.0.6-0 rpm #2788 #2789

Conversation

phillxnet
Copy link
Member

Includes

  • Remove now redundant Py3.6 work-around re Poetry and LANG env var.
  • Establish LANG from install.
  • Record PATH & poetry --version in poetry-install.txt before venv install.

…#2788

## Includes
- Remove now redundant Py3.6 work-around re Poetry and LANG env var.
- Establish LANG from install.
- Record PATH & `poetry --version` in poetry-install.txt before
venv install.
@phillxnet
Copy link
Member Author

Dev notes:

Test-dev system as per PR: #2787

installer:~ # cat /opt/rockstor/poetry-install.txt 
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Poetry (version 1.7.1)

Command ['python', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n    print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n    print(sys.base_prefix)\nelse:\n    print(sys.prefix)\n'] errored with the following return code 2

Error output:
Unknown option: -I
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

And so on this system we do have a python, but not the one we want, suggesting our pipx installed Poetry (1.7.1) does not have it's required venv.

@phillxnet
Copy link
Member Author

phillxnet commented Jan 25, 2024

export PIPX_HOME=/opt/pipx
export PIPX_BIN_DIR=/usr/local/bin
export PIPX_MAN_DIR=/usr/local/share/man
printenv PATH
/sbin:/usr/sbin:/usr/local/sbin:/root/.local/bin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
pipx ensurepath
/usr/local/bin is already in PATH.

⚠  All pipx binary directories have been added to PATH. If you are sure you want to proceed, try again with the '--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨
printenv PATH
/sbin:/usr/sbin:/usr/local/sbin:/root/.local/bin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin

We have, from our zypper installed pipx-python311 man pipx:

optional environment variables:
  PIPX_HOME             Overrides default pipx location. Virtual Environments will be installed to $PIPX_HOME/venvs.
  PIPX_BIN_DIR          Overrides location of app installations. Apps are symlinked or copied here.
  PIPX_DEFAULT_PYTHON   Overrides default python used for commands.

from: https://pipx.pypa.io/stable/docs/

The default python executable used to install a package is
typically the python used to execute pipx and can be overridden
by setting the environment variable PIPX_DEFAULT_PYTHON.

@phillxnet
Copy link
Member Author

From a regular root terminal if we adopt the reported PATH:

PATH="/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
printenv PATH
/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PIPX_HOME=/opt/pipx
export PIPX_BIN_DIR=/usr/local/bin
export PIPX_MAN_DIR=/usr/local/share/man
/usr/local/bin/poetry install --no-interaction --no-ansi >> poetry-install.txt 2>&1

results in a successful venv re-creation.

@phillxnet
Copy link
Member Author

phillxnet commented Jan 25, 2024

python3.11 -m pipx install poetry==1.7.1
'poetry' already seems to be installed. Not modifying existing installation in '/opt/pipx/venvs/poetry'. Pass '--force' to force installation.

with

ls -la /opt/pipx/venvs/poetry/
total 12
drwxr-xr-x 1 root root   92 Jan 25 16:13 .
drwxr-xr-x 1 root root   12 Jan 25 16:12 ..
drwxr-xr-x 1 root root  344 Jan 25 16:13 bin
drwxr-xr-x 1 root root   20 Jan 25 16:12 include
drwxr-xr-x 1 root root   20 Jan 25 16:12 lib
lrwxrwxrwx 1 root root    3 Jan 25 16:12 lib64 -> lib
-rw-r--r-- 1 root root 2564 Jan 25 16:13 pipx_metadata.json
-rw-r--r-- 1 root root  178 Jan 25 16:12 pyvenv.cfg

and our pipx installed poetry symlink:

which poetry
/usr/local/bin/poetry

points to:

ls -la /usr/local/bin/poetry
lrwxrwxrwx 1 root root 33 Jan 25 16:13 /usr/local/bin/poetry -> /opt/pipx/venvs/poetry/bin/poetry

Which is a venv dir of sorts:

ls -la /opt/pipx/venvs/poetry/bin/
total 76
drwxr-xr-x 1 root root  344 Jan 25 16:13 .
drwxr-xr-x 1 root root   92 Jan 25 16:13 ..
-rw-r--r-- 1 root root 1993 Jan 25 16:12 activate
-rw-r--r-- 1 root root  919 Jan 25 16:12 activate.csh
-rw-r--r-- 1 root root 2199 Jan 25 16:12 activate.fish
-rw-r--r-- 1 root root 9033 Jan 25 16:12 Activate.ps1
-rwxr-xr-x 1 root root  233 Jan 25 16:13 doesitcache
-rwxr-xr-x 1 root root 1217 Jan 25 16:13 dul-receive-pack
-rwxr-xr-x 1 root root 1213 Jan 25 16:13 dul-upload-pack
-rwxr-xr-x 1 root root  227 Jan 25 16:13 dulwich
-rwxr-xr-x 1 root root  227 Jan 25 16:13 keyring
-rwxr-xr-x 1 root root  250 Jan 25 16:13 normalizer
-rwxr-xr-x 1 root root  235 Jan 25 16:13 pkginfo
-rwxr-xr-x 1 root root  242 Jan 25 16:13 poetry
-rwxr-xr-x 1 root root  242 Jan 25 16:13 pyproject-build
lrwxrwxrwx 1 root root   10 Jan 25 16:12 python -> python3.11
lrwxrwxrwx 1 root root   10 Jan 25 16:12 python3 -> python3.11
lrwxrwxrwx 1 root root   19 Jan 25 16:12 python3.11 -> /usr/bin/python3.11
-rwxr-xr-x 1 root root  255 Jan 25 16:13 virtualenv

But all this works as intended from a root shell env, with the reported rpm %posttrans PATH enforced there-in.

…ued rockstor#2788

- alternate python version declaration - poetry install via pipx.
- diagnostic `pipx list` addition.
@phillxnet
Copy link
Member Author

Latest output when doing an rpm update i.e. build.sh invoked from within %posttrans scriptlet

# All Rockstor services, if running, will have been stopped.
# Restart via 'systemctl start rockstor-bootstrap.service'
# /root/.local/bin/poetry
# Poetry version 1.1.15 found - UNINSTALLING
# Removing Poetry (1.1.15)
# build.sh has PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# 
# Adopting installs' LANG=en_GB.UTF-8
# /usr/local/bin is already in PATH.
# 
# ⚠  All pipx binary directories have been added to PATH. If you are sure you
# want to proceed, try again with the '--force' flag.
# 
# Otherwise pipx is ready to go! ✨ 🌟 ✨# creating virtual environment...
# creating shared libraries...
# upgrading shared libraries...
# installing poetry from spec 'poetry==1.7.1'...
# done! ✨ 🌟 ✨#   installed package poetry 1.7.1, installed using Python 3.11.5
#   These apps are now globally available
#     - poetry
# venvs are in /opt/pipx/venvs
# apps are exposed on your $PATH at /usr/local/bin
#    package poetry 1.7.1, installed using Python 3.11.5
#     - poetry
# No config-backups-rpmsave directory found.
2024-01-25 18:11:02|patch  |openSUSE-SLE-15.4-2022-1656|1|noarch|repo-sle-update|moderate|recommended|not-needed|applied|

and our failure report from the attempted venv re-creation:

installer:~ # cat /opt/rockstor/poetry-install.txt 
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Poetry (version 1.7.1)

Command ['python', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n    print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n    print(sys.base_prefix)\nelse:\n    print(sys.prefix)\n'] errored with the following return code 2

Error output:
Unknown option: -I
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

…ued2 rockstor#2788

- Dump env output to aid diagnostic.
- Enable full poetry debug logging.
@phillxnet
Copy link
Member Author

Using the new debug log and full env dump we have the following:

installer:~ # cat /opt/rockstor/poetry-install.txt 
LC_ALL=C
DJANGO_SETTINGS_MODULE=settings
LANG=en_GB.UTF-8
TZ=Europe/Lisbon
SYSTEMD_EXEC_PID=13446
OLDPWD=/
INVOCATION_ID=f722f967dc4a4e2bbaff3f99340a4aad
BOOST_TEST_CATCH_SYSTEM_ERRORS=no
RPM_IgnoreFailedSymlinks=1
VIRTUAL_ENV=/opt/rockstor/.venv
PWD=/opt/rockstor
PIPX_HOME=/opt/pipx
HOME=/root
JOURNAL_STREAM=8:18947
SUPERVISOR_PROCESS_NAME=gunicorn
PIPX_MAN_DIR=/usr/local/share/man
SUPERVISOR_ENABLED=1
ZYPP_IS_RUNNING=14401
PIPX_BIN_DIR=/usr/local/bin
PLAT=linux-x86_64
SHLVL=3
SUPERVISOR_GROUP_NAME=gunicorn
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SUPERVISOR_SERVER_URL=unix:///var/run/supervisor.sock
SERVER_SOFTWARE=gunicorn/19.10.0
_=/usr/bin/env
Poetry (version 1.7.1)
Loading configuration file /opt/rockstor/poetry.toml

  Stack trace:

  2  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/base_env.py:350 in _run
      348│                 output = ""
      349│             else:
    → 350│                 output = subprocess.check_output(
      351│                     cmd, stderr=stderr, env=env, text=True, **kwargs
      352│                 )

  1  /usr/lib64/python3.11/subprocess.py:466 in check_output
       464│         kwargs['input'] = empty
       465│ 
    →  466│     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
       467│                **kwargs).stdout
       468│ 

  CalledProcessError

  Command '['python', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n    print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n    print(sys.base_prefix)\nelse:\n    print(sys.prefix)\n']' returned non-zero exit status 2.

  at /usr/lib64/python3.11/subprocess.py:571 in run
       567│             # We don't call process.wait() as .__exit__ does that for us.
       568│             raise
       569│         retcode = process.poll()
       570│         if check and retcode:
    →  571│             raise CalledProcessError(retcode, process.args,
       572│                                      output=stdout, stderr=stderr)
       573│     return CompletedProcess(process.args, retcode, stdout, stderr)
       574│ 
       575│ 

The following error occurred when trying to handle this error:


  Stack trace:

  14  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/application.py:327 in run
       325│ 
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  13  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/console/application.py:190 in _run
       188│         self._load_plugins(io)
       189│ 
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│ 

  12  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│ 
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│ 

  11  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/application.py:473 in _run_command
       471│ 
       472│         if error is not None:
     → 473│             raise error
       474│ 
       475│         return terminate_event.exit_code

  10  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/application.py:454 in _run_command
       452│ 
       453│         try:
     → 454│             self._event_dispatcher.dispatch(command_event, COMMAND)
       455│ 
       456│             if command_event.command_should_run():

   9  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/events/event_dispatcher.py:26 in dispatch
        24│ 
        25│         if listeners:
     →  26│             self._do_dispatch(listeners, event_name, event)
        27│ 
        28│         return event

   8  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/cleo/events/event_dispatcher.py:85 in _do_dispatch
        83│                 break
        84│ 
     →  85│             listener(event, event_name, self)
        86│ 
        87│     def _sort_listeners(self, event_name: str) -> None:

   7  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/console/application.py:299 in configure_env
       297│ 
       298│         env_manager = EnvManager(poetry, io=io)
     → 299│         env = env_manager.create_venv()
       300│ 
       301│         if env.is_venv() and io.is_verbose():

   6  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/env_manager.py:436 in create_venv
       434│ 
       435│         cwd = self._poetry.file.path.parent
     → 436│         env = self.get(reload=True)
       437│ 
       438│         if not env.is_sane():

   5  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/env_manager.py:291 in get
       289│             base_prefix = self.get_base_prefix()
       290│ 
     → 291│         return VirtualEnv(prefix, base_prefix)
       292│ 
       293│     def list(self, name: str | None = None) -> list[VirtualEnv]:

   4  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/virtual_env.py:45 in __init__
        43│         # from inside the virtualenv.
        44│         if base is None:
     →  45│             output = self.run_python_script(GET_BASE_PREFIX)
        46│             self._base = Path(output.strip())
        47│ 

   3  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/base_env.py:325 in run_python_script
       323│ 
       324│     def run_python_script(self, content: str, **kwargs: Any) -> str:
     → 325│         return self.run(
       326│             self._executable,
       327│             "-I",

   2  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/base_env.py:317 in run
       315│     def run(self, bin: str, *args: str, **kwargs: Any) -> str:
       316│         cmd = self.get_command_from_bin(bin) + list(args)
     → 317│         return self._run(cmd, **kwargs)
       318│ 
       319│     def run_pip(self, *args: str, **kwargs: Any) -> str:

   1  /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/virtual_env.py:99 in _run
        97│     def _run(self, cmd: list[str], **kwargs: Any) -> str:
        98│         kwargs["env"] = self.get_temp_environ(environ=kwargs.get("env"))
     →  99│         return super()._run(cmd, **kwargs)
       100│ 
       101│     def get_temp_environ(

  EnvCommandError

  Command ['python', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n    print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n    print(sys.base_prefix)\nelse:\n    print(sys.prefix)\n'] errored with the following return code 2
  
  Error output:
  Unknown option: -I
  usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
  Try `python -h' for more information.
  

  at /opt/pipx/venvs/poetry/lib64/python3.11/site-packages/poetry/utils/env/base_env.py:354 in _run
      350│                 output = subprocess.check_output(
      351│                     cmd, stderr=stderr, env=env, text=True, **kwargs
      352│                 )
      353│         except CalledProcessError as e:
    → 354│             raise EnvCommandError(e)
      355│ 
      356│         return output
      357│ 
      358│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

@phillxnet
Copy link
Member Author

We have a reproducer of sorts. On the target test system (Leap 15.4) we can reproduce our python from a root terminal thus:

installer:~ # python -I -W ignore -c 'import sys\n\nif hasattr(sys, "real_prefix"):\n    print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n    print(sys.base_prefix)\nelse:\n    print(sys.prefix)\n'
Unknown option: -I
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

And from man python we have:

   -I     Run Python in isolated mode. This also implies -E, -P and -s. In isolated mode sys.path contains neither the script's directory  nor  the  user's  site-
          packages  directory.  All  PYTHON* environment variables are ignored, too.  Further restrictions may be imposed to prevent the user from injecting mali-
          cious code.

Which looks like newer (Py3.7+ only) Poetry's investigation of the underlying python environment.

But -I does not exist in python2.7 which till exists in our 15.4 host as it is the system default:

installer:~ # python --version
Python 2.7.18
installer:~ # python -I
Unknown option: -I
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

But if we specifically invoke the correct python via executable name, as we have requested pipx does for us !!!

installer:~ # python3.11 -I
Python 3.11.5 (main, Sep 06 2023, 11:21:05) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

On a 15.5 system we have no 'python':

rleap15-5:~ # python --version
-bash: python: command not found

But again our pipx is supposed to be presenting Poetry with it's python -> python3.11 via it's venv.

And the code in the failing command string (-c) is:

import sys
if hasattr(sys, "real_prefix"):
    print(sys.real_prefix)
elif hasattr(sys, "base_prefix"):
    print(sys.base_prefix)
else:
    print(sys.prefix)

But our issue is the inadvertent invokation by Poetyr of the wrong python version, when pipx is meant to resolve this.

@phillxnet
Copy link
Member Author

A somewhat incidental run of that code:

installer:~ # python -I -W ignore < test.py
Unknown option: -I
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

installer:~ # python3.11 -I -W ignore < test.py
/usr

@phillxnet
Copy link
Member Author

We may have the remains of an in-memory (from deleted venv) pointer to our old python remaining. And we have the following potentially related fix regarding un-setting an environmental variable (VIRTUAL_ENV=/opt/rockstor/.venv) in this area:

VIRTUAL_ENV=/opt/rockstor/.venv

in our update environment, and even thought it references a now deleted .venv, there is evidence of dangling python references here.

…ued3 rockstor#2788

- unset pre 5.0.3-0 VIRTUAL_ENV environmental variable.
@phillxnet
Copy link
Member Author

phillxnet commented Jan 26, 2024

Working Web-UI update on base OS of 15.4 (last available installer) from last stable of 4.1.0-0 - to testing 5.0.6-2788:

  • /var/log/zypp/history
2024-01-26 12:27:03|install|password-store|1.7.4-bp154.1.24|noarch||Leap_15_4|5475457a60b3a03c9b3c25e569b495579b52c107f2e8540cffd6388c51087423|
# 2024-01-26 12:27:06 rockstor-5.0.6-2789.x86_64.rpm installed ok
# Additional rpm output:
# No static/config-backups directory found.
# update-alternatives: using /usr/lib/postgresql13 to provide /usr/lib/postgresql (postgresql) in manual mode
# 
2024-01-26 12:27:06|install|rockstor|5.0.6-2789|x86_64|root@installer|Buildbot-Testing|405e1a7475846211a22302cf63e6c4f4110366374620b2c88d292f2d1cf25b62|
# 2024-01-26 12:27:06 %posttrans(rockstor-5.0.6-2789.x86_64) script output:
# Updating DB format from 10 to 13 via pg_upgrade.
# /var/lib/pgsql /
# 
# Adopting installs' LANG=en_GB.UTF-8
# The files belonging to this database system will be owned by user "postgres".
# This user must also own the server process.
# 
# The database cluster will be initialized with locale "en_GB.UTF-8".
# The default text search configuration will be set to "english".
# 
...
# All Rockstor services, if running, will have been stopped.
# Restart via 'systemctl start rockstor-bootstrap.service'
# /root/.local/bin/poetry
# Poetry version 1.1.15 found - UNINSTALLING
# Removing Poetry (1.1.15)
# Unset VIRTUAL_ENV
# build.sh has PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# 
# Adopting installs' LANG=en_GB.UTF-8
# /usr/local/bin is already in PATH.
# 
# ⚠  All pipx binary directories have been added to PATH. If you are sure you
# want to proceed, try again with the '--force' flag.
# 
# Otherwise pipx is ready to go! ✨ 🌟 ✨# creating virtual environment...
# creating shared libraries...
# upgrading shared libraries...
# installing poetry from spec 'poetry==1.7.1'...
# done! ✨ 🌟 ✨#   installed package poetry 1.7.1, installed using Python 3.11.5
#   These apps are now globally available
#     - poetry
# venvs are in /opt/pipx/venvs
# apps are exposed on your $PATH at /usr/local/bin
#    package poetry 1.7.1, installed using Python 3.11.5
#     - poetry
# 
# Creating jslibs/js/lib & populating from rockstor-jslibs.tar.gz
# 
# rockstor-jslibs-5.0.6/DataTables-addons/
# rockstor-jslibs-5.0.6/DataTables-addons/file-size.js
...
# 
# gpg: keybox '/root/.gnupg/pubring.kbx' created
# gpg: /root/.gnupg/trustdb.gpg: trustdb created
# gpg: key 3C059005C2D29C83 marked as ultimately trusted
# gpg: directory '/root/.gnupg/openpgp-revocs.d' created
# gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/E0B07A9EE7B5E74D5D3730B43C059005C2D29C83.rev'
# mkdir: created directory '/root/.password-store/'
# Password store initialized for rockstor@localhost
# mkdir: created directory '/root/.password-store/python-keyring'
# mkdir: created directory '/root/.password-store/python-keyring/rockstor'
# The generated password for python-keyring/rockstor/SECRET_KEY is:
# 3LZZ0dsciKll1Tlq5KvfKCk3e3DESngw2PUCyM2I5bGIkLCKtyFAVD5QnHOzsh44p6p6JNUDbNBRXu8t31t5S8PvEXRnv55HFdyr
# Error: python-keyring/rockstor/SECRET_KEY_FALLBACK is not in the password store.
# Error: python-keyring/rockstor/CLIENT_SECRET is not in the password store.
# No SECRET_KEY_FALLBACK - rotated on reboot / rockstor services restart.
# Copying '/opt/rockstor/.venv/lib/python3.11/site-packages/django/contrib/admin/static/admin/css/autocomplete.css'
...
# 515 static files copied to '/opt/rockstor/static', 517 post-processed.
# 
# ROCKSTOR BUILD SCRIPT COMPLETED
# 
# If installing from source, from scratch, for development; i.e. NOT via RPM:
# Note GnuPG & password-store ExecStartPre steps in /opt/rockstor/conf/rockstor-pre.service
# 1. Run 'cd /opt/rockstor'.
# 2. Run 'systemctl start postgresql'.
# 3. Run 'export DJANGO_SETTINGS_MODULE=settings'.
# 4. Run 'export PASSWORD_STORE_DIR=/root/.password-store'.
# 5. Run 'poetry run initrock' as root (equivalent to rockstor-pre.service ExecStart).
# 6. Run 'systemctl enable --now rockstor-bootstrap'.
# No config-backups-rpmsave directory found.
2024-01-26 12:28:40|patch  |openSUSE-SLE-15.4-2022-1656|1|noarch|repo-sle-update|moderate|recommended|not-needed|applied|
...
  • cat /opt/rockstor/poetry-install.txt
LC_ALL=C
DJANGO_SETTINGS_MODULE=settings
LANG=en_GB.UTF-8
TZ=Europe/Lisbon
SYSTEMD_EXEC_PID=13523
OLDPWD=/
INVOCATION_ID=ee4d662b67b344669db6eb722bfee6af
BOOST_TEST_CATCH_SYSTEM_ERRORS=no
RPM_IgnoreFailedSymlinks=1
PWD=/opt/rockstor
PIPX_HOME=/opt/pipx
HOME=/root
JOURNAL_STREAM=8:19501
SUPERVISOR_PROCESS_NAME=gunicorn
PIPX_MAN_DIR=/usr/local/share/man
SUPERVISOR_ENABLED=1
ZYPP_IS_RUNNING=14245
PIPX_BIN_DIR=/usr/local/bin
PLAT=linux-x86_64
SHLVL=3
SUPERVISOR_GROUP_NAME=gunicorn
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SUPERVISOR_SERVER_URL=unix:///var/run/supervisor.sock
SERVER_SOFTWARE=gunicorn/19.10.0
_=/usr/bin/env
Poetry (version 1.7.1)
Loading configuration file /opt/rockstor/poetry.toml
Creating virtualenv rockstor in /opt/rockstor/.venv
Using virtualenv: /opt/rockstor/.venv
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 50 installs, 0 updates, 0 removals, 1 skipped

  • Installing pycparser (2.21)
  • Installing cffi (1.16.0)
  • Installing h11 (0.14.0)
  • Installing cryptography (41.0.7)
  • Installing jeepney (0.8.0)
  • Installing more-itertools (10.1.0)
  • Installing wrapt (1.16.0)
  • Installing wsproto (1.2.0)
  • Installing zipp (3.17.0)
  • Installing asgiref (3.7.2)
  • Installing certifi (2023.11.17)
  • Installing charset-normalizer (3.3.2)
  • Installing deprecated (1.2.14)
  • Installing idna (3.6)
  • Installing importlib-metadata (6.8.0)
  • Installing jaraco-classes (3.3.0)
  • Installing secretstorage (3.3.3)
  • Installing simple-websocket (1.0.0)
  • Installing sqlparse (0.4.4)
  • Installing urllib3 (2.1.0)
  • Installing bidict (0.22.1)
  • Installing django (4.2.7)
  • Installing greenlet (3.0.1)
  • Installing jwcrypto (1.5.0)
  • Installing keyring (23.13.1)
  • Installing oauthlib (3.2.2)
  • Installing packaging (23.2)
  • Installing python-engineio (4.8.0)
  • Installing pytz (2023.3.post1)
  • Installing requests (2.31.0)
  • Installing typing-extensions (4.8.0)
  • Installing zope-event (5.0)
  • Installing zope-interface (6.1)
  • Installing dbus-python (1.3.2)
  • Installing distro (1.8.0)
  • Installing django-oauth-toolkit (2.3.0)
  • Installing django-pipeline (2.1.0)
  • Installing djangorestframework (3.14.0)
  • Installing gevent (23.9.1)
  • Installing gunicorn (21.2.0)
  • Installing huey (2.5.0)
  • Installing keyring-pass (0.8.1)
  • Installing psutil (5.9.4)
  • Installing psycogreen (1.0)
  • Installing psycopg (3.1.13)
  • Installing python-socketio (5.9.0)
  • Installing pyzmq (25.1.1)
  • Installing setuptools (69.0.2): Skipped for the following reason: Already installed
  • Installing six (1.16.0)
  • Installing supervisor (4.2.4)
  • Installing urlobject (2.1.1)

Installing the current project: rockstor (5.0.6)
  - Building package rockstor in editable mode
  - Adding rockstor.pth to /opt/rockstor/.venv/lib/python3.11/site-packages for /opt/rockstor
  - Adding the backup-config script to /opt/rockstor/.venv/bin
  - Adding the bootstrap script to /opt/rockstor/.venv/bin
  - Adding the data-collector script to /opt/rockstor/.venv/bin
  - Adding the debug-mode script to /opt/rockstor/.venv/bin
  - Adding the delete-api-key script to /opt/rockstor/.venv/bin
  - Adding the delete-rockon script to /opt/rockstor/.venv/bin
  - Adding the flash-optimize script to /opt/rockstor/.venv/bin
  - Adding the initrock script to /opt/rockstor/.venv/bin
  - Adding the mnt-share script to /opt/rockstor/.venv/bin
  - Adding the ovpn-client-gen script to /opt/rockstor/.venv/bin
  - Adding the ovpn-client-print script to /opt/rockstor/.venv/bin
  - Adding the ovpn-initpki script to /opt/rockstor/.venv/bin
  - Adding the prep_db script to /opt/rockstor/.venv/bin
  - Adding the pwreset script to /opt/rockstor/.venv/bin
  - Adding the qgroup-clean script to /opt/rockstor/.venv/bin
  - Adding the qgroup-maxout-limit script to /opt/rockstor/.venv/bin
  - Adding the replicad script to /opt/rockstor/.venv/bin
  - Adding the send-replica script to /opt/rockstor/.venv/bin
  - Adding the st-pool-scrub script to /opt/rockstor/.venv/bin
  - Adding the st-snapshot script to /opt/rockstor/.venv/bin
  - Adding the st-system-power script to /opt/rockstor/.venv/bin
  - Adding the rockstor-5.0.6.dist-info directory to /opt/rockstor/.venv/lib/python3.11/site-packages

And post Web-UI (systemd services) resumption we have:

installer:~ # pass
Password Store
└── python-keyring
    └── rockstor
        ├── CLIENT_SECRET
        ├── SECRET_KEY_FALLBACK
        └── SECRET_KEY

@phillxnet
Copy link
Member Author

phillxnet commented Jan 26, 2024

I will shortly squash this development branch and re-present as a non draft pull request.

@phillxnet phillxnet closed this Jan 26, 2024
@phillxnet phillxnet deleted the 2788-Failure-to-re-create-venv-after-Poetry-update-in-5.0.6-0-rpm branch January 26, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant