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 - pre 5.0.3-0 updating to 5.0.6-0 rpm #2788 #2790

Conversation

phillxnet
Copy link
Member

@phillxnet phillxnet commented Jan 26, 2024

When updating from a pre 5.0.3-0 rpm to 5.0.6-0, where we updated Poetry by removing our legacy version of 1.1.5 (via upstream installer/uninstaller) and installed our new Poetry 1.7.1 (via OS pipx-python311 package) we again encountered a prior Poetry venv re-create issue previously addressed in our temporary upgrade script from 5.0.3-0 onwards (in the from system).

Fixes #2788
As we are now in Release Candidate phase (within current testing channel) we begin addressing update issues, rather than just install.

References:

Includes

  • Remove now redundant Py3.6 work-around re Poetry and LANG env var.
  • Establish LANG from install.
  • Record env & poetry --version in poetry-install.txt before venv install.
  • Add diagnostic pipx list.
  • Alternate python version declaration in poetry install via pipx.
  • Enable full poetry install debug logging.
  • Unset pre 5.0.3-0 VIRTUAL_ENV environmental variable, redundant when updating from 5.0.3-0 onwards.

…tor#2788

## Includes
- Remove now redundant Py3.6 work-around re Poetry and LANG env var.
- Establish LANG from install.
- Record `env` & `poetry --version` in poetry-install.txt before
venv install.
- Add diagnostic `pipx list`.
- Alternate python version declaration in poetry install via pipx.
- Enable full `poetry install` debug logging.
- Unset pre 5.0.3-0 VIRTUAL_ENV environmental variable, redundant
when updating from 5.0.3-0 onwards.
@phillxnet
Copy link
Member Author

Testing

As we have a number of potentially interacting updates on-the-go here, and as we are heading to latter-half testing channel phase (i.e. 5.0.6-0 was our Stable Releaese Candidate RC1) the test system was originally derived from the following installer:

Rockstor-Leap15.3-generic.x86_64-4.1.0-0.install.iso Jan 14 2022

  • The resulting install was then subscribed to the Stable updates channel.
  • An underlying OS update to a 15.4 base was then enacted via:
    Distribution update from 15.3 to 15.4: https://rockstor.com/docs/howtos/15-3_to_15-4.html
    Resulting also in an automatic update to our last stable release of 4.6.1-0.

The above system then represents a reproducer for a pending stable update (likely also as part of a zypper dup), and incorporates both the recent DB format modification:
Establish Postgres database format upgrade #2780 #2787
And our referenced main issue regarding our updated Poetry failing to recreate our venv.
Plus all other updates since our last 4.6.1-0 stable release (15.4 OS base only).

After the Web-UI initiated rpm upgrade we have:

poetry-install.txt

  • cat /opt/rockstor/poetry-install.txt
LC_ALL=C
DJANGO_SETTINGS_MODULE=settings
LANG=en_GB.UTF-8
TZ=Europe/Lisbon
SYSTEMD_EXEC_PID=13425
OLDPWD=/
INVOCATION_ID=ee9337eb49ab429c94f8d99f728b426b
BOOST_TEST_CATCH_SYSTEM_ERRORS=no
RPM_IgnoreFailedSymlinks=1
PWD=/opt/rockstor
PIPX_HOME=/opt/pipx
HOME=/root
JOURNAL_STREAM=8:18400
SUPERVISOR_PROCESS_NAME=gunicorn
PIPX_MAN_DIR=/usr/local/share/man
SUPERVISOR_ENABLED=1
ZYPP_IS_RUNNING=14137
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 gevent (23.9.1)
  • Installing djangorestframework (3.14.0)
  • 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

zypper history

  • less /var/log/zypp/history
2024-01-26 15:41:33|install|password-store|1.7.4-bp154.1.24|noarch||Leap_15_4|5475457a60b3a03c9b3c25e569b495579b52c107f2e8540cffd6388
c51087423|
# 2024-01-26 15:41:35 rockstor-5.0.6-2790.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 15:41:35|install|rockstor|5.0.6-2790|x86_64|root@installer|Buildbot-Testing|29268bc1f3297f5e97f82fdd77bcb4aee2ab09089dde69
ee0b740e481003de5f|
# 2024-01-26 15:41:35 %posttrans(rockstor-5.0.6-2790.x86_64) script output:
# Updating DB format from 10 to 13 via pg_upgrade.

...
# reindexdb: reindexing database "template1"
# 
# Restoring pior pwd
# /
# 
# 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/socket.io.min.js.map
# rockstor-jslibs-5.0.6/underscore.js
# 
# gpg: keybox '/root/.gnupg/pubring.kbx' created
# gpg: /root/.gnupg/trustdb.gpg: trustdb created
# gpg: key 58F837E4B66E694F marked as ultimately trusted
# gpg: directory '/root/.gnupg/openpgp-revocs.d' created
# gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/E9F417AE6419D11B48756CD158F837E4B66E694F.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:
# NW1raPPkjLi22Ay1wukq7b9d5PPLMbGtCu8txLSfv7YLecXqVUOwjE8h31xDYW7w6XFlOfXXtDK3kwR6TyEi2wC0qovhIcu7tI3E
# 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'
...
# Post-processed 'js/lib/underscore.js' as 'js/lib/underscore.f893e294cde6.js'
# Post-processed 'storageadmin/js/storageadmin.js' as 'storageadmin/js/storageadmin.c7807f872ad4.js'
# 
# 515 static files copied to '/opt/rockstor/static', 517 post-processed.
# 
# ROCKSTOR BUILD SCRIPT COMPLETED
...

@phillxnet
Copy link
Member Author

Build test completed successfully for all arch (X86_64, aarch64) & OS (15.4, 15.5, TW) target combinations. With successful systemd service starts across the board.

@phillxnet phillxnet merged commit 4608074 into rockstor:testing Jan 29, 2024
@phillxnet phillxnet deleted the 2788-Failure-to-re-create-venv---pre-5.0.3-0-updating-to-5.0.6-0-rpm branch January 29, 2024 10:05
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