Rockstor-Pre Service failing after Update to 5.0.0-0

Hi,
after the last testing-channel updates wen’t very smoothly for me, now after updating to 5.0.0-0 Rockstor isn’t starting anymore. GUI is unresponsive, so I checked:

rockstor4:~ # systemctl status rockstor
○ rockstor.service - Rockstor startup script
     Loaded: loaded (/usr/lib/systemd/system/rockstor.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Jul 23 12:32:37 rockstor4 systemd[1]: Dependency failed for Rockstor startup script.
Jul 23 12:32:37 rockstor4 systemd[1]: rockstor.service: Job rockstor.service/start failed with result 'dependency'.
Jul 23 12:33:17 rockstor4 systemd[1]: Dependency failed for Rockstor startup script.
Jul 23 12:33:17 rockstor4 systemd[1]: rockstor.service: Job rockstor.service/start failed with result 'dependency'.
rockstor4:~ # systemctl status rockstor-pre.service
× rockstor-pre.service - Tasks required prior to starting Rockstor
     Loaded: loaded (/usr/lib/systemd/system/rockstor-pre.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-07-23 12:34:19 CEST; 11min ago
    Process: 13499 ExecStart=/root/.local/bin/poetry run initrock (code=exited, status=1/FAILURE)
   Main PID: 13499 (code=exited, status=1/FAILURE)

Jul 23 12:34:19 rockstor4 poetry[13499]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 12:34:19 rockstor4 poetry[13499]:     from storageadmin.models.user import User  # noqa E501
Jul 23 12:34:19 rockstor4 poetry[13499]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 12:34:19 rockstor4 poetry[13499]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 12:34:19 rockstor4 poetry[13499]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 12:34:19 rockstor4 poetry[13499]:     from subprocess import run, Popen, PIPE
Jul 23 12:34:19 rockstor4 poetry[13499]: ImportError: cannot import name run
Jul 23 12:34:19 rockstor4 systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 12:34:19 rockstor4 systemd[1]: rockstor-pre.service: Failed with result 'exit-code'.
Jul 23 12:34:19 rockstor4 systemd[1]: Failed to start Tasks required prior to starting Rockstor.
rockstor4:~ # systemctl start rockstor-pre.service
Job for rockstor-pre.service failed because the control process exited with error code.
See "systemctl status rockstor-pre.service" and "journalctl -xeu rockstor-pre.service" for details.

rockstor4:~ # journalctl -xeu rockstor-pre.service
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit rockstor-pre.service has finished with a failure.
░░
░░ The job identifier is 1015 and the job result is failed.
Jul 23 12:46:39 rockstor4 systemd[1]: Starting Tasks required prior to starting Rockstor...
░░ Subject: A start job for unit rockstor-pre.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit rockstor-pre.service has begun execution.
░░
░░ The job identifier is 1362.
Jul 23 12:46:39 rockstor4 poetry[14175]: Traceback (most recent call last):
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "<string>", line 1, in <module>
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 12:46:39 rockstor4 poetry[14175]:     __import__(name)
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 6, in <module>
Jul 23 12:46:39 rockstor4 poetry[14175]:     django.setup()
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
Jul 23 12:46:39 rockstor4 poetry[14175]:     apps.populate(settings.INSTALLED_APPS)
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
Jul 23 12:46:39 rockstor4 poetry[14175]:     app_config.import_models()
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
Jul 23 12:46:39 rockstor4 poetry[14175]:     self.models_module = import_module(models_module_name)
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 12:46:39 rockstor4 poetry[14175]:     __import__(name)
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 12:46:39 rockstor4 poetry[14175]:     from storageadmin.models.user import User  # noqa E501
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 12:46:39 rockstor4 poetry[14175]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 12:46:39 rockstor4 poetry[14175]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 12:46:39 rockstor4 poetry[14175]:     from subprocess import run, Popen, PIPE
Jul 23 12:46:39 rockstor4 poetry[14175]: ImportError: cannot import name run
Jul 23 12:46:39 rockstor4 systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit rockstor-pre.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jul 23 12:46:39 rockstor4 systemd[1]: rockstor-pre.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit rockstor-pre.service has entered the 'failed' state with result 'exit-code'.
Jul 23 12:46:39 rockstor4 systemd[1]: Failed to start Tasks required prior to starting Rockstor.
░░ Subject: A start job for unit rockstor-pre.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit rockstor-pre.service has finished with a failure.
░░
░░ The job identifier is 1362 and the job result is failed.

rockstor4:~ # zypper info rockstor
Loading repository data...
Reading installed packages...


Information for package rockstor:
---------------------------------
Repository     : Rockstor-Testing
Name           : rockstor
Version        : 5.0.0-0
Arch           : x86_64
Vendor         : YewTreeApps
Installed Size : 9.6 MiB
Installed      : Yes
Status         : up-to-date
Source package : rockstor-5.0.0-0.src
Upstream URL   : https://rockstor.com/
Summary        : Btrfs Network Attached Storage (NAS) Appliance.
Description    :
    Software raid, snapshot capable NAS solution with built-in file integrity protection.
    Allows for file sharing between network attached devices.

rockstor4:~ # uname -r
6.4.4-lp154.2.g919c802-default

Reboot / manual starting of processes didn’t help.
As always: Any help is appreciated :slight_smile:

1 Like

Same here, rockstor GUI does not start

Hi @Mark93 ,

Thanks a lot for the detailed report… That is a curious one. We can see your system is still trying to use Python2.7 libs while it shouldn’t anymore.

While we try to reproduce that, would you be able to verify what Poetry is seeing?

cd /opt/rockstor
poetry env info

ls -lah /opt/rockstor/.venv/bin/

Sorry you’re hitting a problem there.

@eriklysoe ,
Would you be able to run the same commands as @Mark93 has in their post to make sure it is the same problem? If yes, it would be helpful if you could also check what I have just listed above as confirmation that we’re dealing with the same issue here.

1 Like

Hey @Flox ,
here is the output:

rockstor4:/opt/rockstor # poetry env info

Virtualenv
Python:         2.7.18
Implementation: CPython
Path:           /opt/rockstor/.venv
Valid:          True

System
Platform: linux
OS:       posix
Python:   /usr
rockstor4:/opt/rockstor # ls -lah /opt/rockstor/.venv/bin/
total 224K
drwxr-xr-x 1 root root 1.2K Jan 25 21:47 .
drwxr-xr-x 1 root root   76 Jan 19  2023 ..
-rw-r--r-- 1 root root 2.1K Jan 19  2023 activate
-rw-r--r-- 1 root root 1.4K Jan 19  2023 activate.csh
-rw-r--r-- 1 root root 3.0K Jan 19  2023 activate.fish
-rw-r--r-- 1 root root 2.5K Jan 19  2023 activate.nu
-rw-r--r-- 1 root root 1.8K Jan 19  2023 activate.ps1
-rw-r--r-- 1 root root 1.2K Jan 19  2023 activate_this.py
-rwxr-xr-x 1 root root  111 Jul 12 23:15 backup-config
-rwxr-xr-x 1 root root  107 Jul 12 23:15 bootstrap
-rwxr-xr-x 1 root root  235 Jan 19  2023 chardetect
-rwxr-xr-x 1 root root  118 Jul 12 23:15 data-collector
-rw-r--r-- 1 root root  682 Jan 19  2023 deactivate.nu
-rwxr-xr-x 1 root root  107 Jul 12 23:15 debug-mode
-rwxr-xr-x 1 root root  112 Jul 12 23:15 delete-api-key
-rwxr-xr-x 1 root root  129 Jul 12 23:15 delete-rockon
-rwxr-xr-x 1 root root  219 Jan 19  2023 distro
-rwxr-xr-x 1 root root  277 Jan 19  2023 django-admin
-rwxr-xr-x 1 root root  139 Jan 19  2023 django-admin.py
-rwxr-xr-x 1 root root  244 Jan 19  2023 easy_install
-rwxr-xr-x 1 root root  244 Jan 19  2023 easy_install-2.7
-rwxr-xr-x 1 root root  244 Jan 19  2023 easy_install2
-rwxr-xr-x 1 root root  244 Jan 19  2023 easy_install2.7
-rwxr-xr-x 1 root root  232 Jan 19  2023 echo_supervisord_conf
-rwxr-xr-x 1 root root  112 Jul 12 23:15 flash-optimize
-rwxr-xr-x 1 root root  231 Jan 19  2023 gunicorn
-rwxr-xr-x 1 root root  233 Jan 19  2023 gunicorn_paster
-rwxr-xr-x 1 root root  253 Jan 19  2023 huey_consumer
-rwxr-xr-x 1 root root 1.5K Jan 19  2023 huey_consumer.py
-rwxr-xr-x 1 root root  106 Jul 12 23:15 initrock
-rwxr-xr-x 1 root root  123 Jul 12 23:15 mnt-share
-rwxr-xr-x 1 root root  119 Jul 12 23:15 ovpn-client-gen
-rwxr-xr-x 1 root root  129 Jul 12 23:15 ovpn-client-print
-rwxr-xr-x 1 root root  113 Jul 12 23:15 ovpn-initpki
-rwxr-xr-x 1 root root  232 Jan 19  2023 pidproxy
-rwxr-xr-x 1 root root  235 Jan 19  2023 pip
-rwxr-xr-x 1 root root  235 Jan 19  2023 pip-2.7
-rwxr-xr-x 1 root root  235 Jan 19  2023 pip2
-rwxr-xr-x 1 root root  235 Jan 19  2023 pip2.7
-rwxr-xr-x 1 root root  105 Jul 12 23:15 prep_db
-rwxr-xr-x 1 root root  105 Jul 12 23:15 pwreset
-rwxr-xr-x 1 root root 6.2K Jan 19  2023 python
lrwxrwxrwx 1 root root    6 Jan 19  2023 python2 -> python
lrwxrwxrwx 1 root root    6 Jan 19  2023 python2.7 -> python
-rwxr-xr-x 1 root root  110 Jul 12 23:15 qgroup-clean
-rwxr-xr-x 1 root root  117 Jul 12 23:15 qgroup-maxout-limit
-rwxr-xr-x 1 root root  131 Jul 12 23:15 replicad
-rwxr-xr-x 1 root root  126 Jul 12 23:15 send-replica
-rwxr-xr-x 1 root root  124 Jul 12 23:15 st-pool-scrub
-rwxr-xr-x 1 root root  122 Jul 12 23:15 st-snapshot
-rwxr-xr-x 1 root root  129 Jul 12 23:15 st-system-power
-rwxr-xr-x 1 root root  237 Jan 19  2023 supervisorctl
-rwxr-xr-x 1 root root  235 Jan 19  2023 supervisord
-rwxr-xr-x 1 root root  222 Jan 19  2023 wheel
-rwxr-xr-x 1 root root  222 Jan 19  2023 wheel-2.7
-rwxr-xr-x 1 root root  222 Jan 19  2023 wheel2
-rwxr-xr-x 1 root root  222 Jan 19  2023 wheel2.7
2 Likes

Ok… Let’s make sure the python3 dependencies were correctly installed:

zypper info python3 python3-devel
2 Likes
rockstor4:/opt/rockstor # zypper info python3 python3-devel
Loading repository data...
Reading installed packages...


Information for package python3:
--------------------------------
Repository     : Update repository with updates from SUSE Linux Enterprise 15
Name           : python3
Version        : 3.6.15-150300.10.48.1
Arch           : x86_64
Vendor         : SUSE LLC <https://www.suse.com/>
Installed Size : 141.3 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : python3-3.6.15-150300.10.48.1.src
Upstream URL   : https://www.python.org/
Summary        : Python 3 Interpreter
Description    :
    Python 3 is modern interpreted, object-oriented programming language,
    often compared to Tcl, Perl, Scheme, or Java.  You can find an overview
    of Python in the documentation and tutorials included in the python3-doc
    package.

    This package supplies rich command line features provided by readline,
    and sqlite3 support for the interpreter core, thus forming a so called
    "extended" runtime.
    Installing "python3" is sufficient for the vast majority of usecases.
    In addition, recommended packages provide UI toolkit support (python3-curses,
    python3-tk), legacy UNIX database bindings (python3-dbm), and the IDLE
    development environment (python3-idle).


Information for package python3-devel:
--------------------------------------
Repository     : Update repository with updates from SUSE Linux Enterprise 15
Name           : python3-devel
Version        : 3.6.15-150300.10.48.1
Arch           : x86_64
Vendor         : SUSE LLC <https://www.suse.com/>
Installed Size : 790.0 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : python3-core-3.6.15-150300.10.48.1.src
Upstream URL   : https://www.python.org/
Summary        : Include Files and Libraries Mandatory for Building Python Modules
Description    :
    The Python programming language's interpreter can be extended with
    dynamically loaded extensions and can be embedded in other programs.

    This package contains header files, a static library, and development
    tools for building Python modules, extending the Python interpreter or
    embedding Python in applications.

    This also includes the Python distutils, which were in the Python
    package up to version 2.2.2.

rockstor4:/opt/rockstor #

Hi, seems to be the same problem with python 2.7

rockstor:~ # systemctl status rockstor
○ rockstor.service - Rockstor startup script
     Loaded: loaded (/usr/lib/systemd/system/rockstor.service; disabled; vendor preset: disabled)
     Active: inactive (dead)

Jul 23 13:57:18 rockstor systemd[1]: Dependency failed for Rockstor startup script.
Jul 23 13:57:18 rockstor systemd[1]: rockstor.service: Job rockstor.service/start failed with result 'dependency'.

rockstor:~ # systemctl status rockstor-pre.service
× rockstor-pre.service - Tasks required prior to starting Rockstor
     Loaded: loaded (/usr/lib/systemd/system/rockstor-pre.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-07-23 14:03:43 CEST; 11min ago
    Process: 13165 ExecStart=/root/.local/bin/poetry run initrock (code=exited, status=1/FAILURE)
   Main PID: 13165 (code=exited, status=1/FAILURE)

Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from storageadmin.models.user import User  # noqa E501
Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from subprocess import run, Popen, PIPE
Jul 23 14:03:43 rockstor poetry[13165]: ImportError: cannot import name run
Jul 23 14:03:43 rockstor systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 14:03:43 rockstor systemd[1]: rockstor-pre.service: Failed with result 'exit-code'.
Jul 23 14:03:43 rockstor systemd[1]: Failed to start Tasks required prior to starting Rockstor.

rockstor:~ # systemctl status rockstor-pre.service
× rockstor-pre.service - Tasks required prior to starting Rockstor
     Loaded: loaded (/usr/lib/systemd/system/rockstor-pre.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-07-23 14:03:43 CEST; 12min ago
    Process: 13165 ExecStart=/root/.local/bin/poetry run initrock (code=exited, status=1/FAILURE)
   Main PID: 13165 (code=exited, status=1/FAILURE)

Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from storageadmin.models.user import User  # noqa E501
Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 14:03:43 rockstor poetry[13165]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 14:03:43 rockstor poetry[13165]:     from subprocess import run, Popen, PIPE
Jul 23 14:03:43 rockstor poetry[13165]: ImportError: cannot import name run
Jul 23 14:03:43 rockstor systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 14:03:43 rockstor systemd[1]: rockstor-pre.service: Failed with result 'exit-code'.
Jul 23 14:03:43 rockstor systemd[1]: Failed to start Tasks required prior to starting Rockstor.

rockstor:~ # systemctl start rockstor-pre.service
Job for rockstor-pre.service failed because the control process exited with error code.
See "systemctl status rockstor-pre.service" and "journalctl -xeu rockstor-pre.service" for details.


rockstor:~ # journalctl -xeu rockstor-pre.service
Jul 23 13:57:11 rockstor systemd[1]: Starting Tasks required prior to starting Rockstor...
░░ Subject: A start job for unit rockstor-pre.service has begun execution
░░ Defined-By: systemd
░░ Support: 
░░
░░ A start job for unit rockstor-pre.service has begun execution.
░░
░░ The job identifier is 257.
Jul 23 13:57:18 rockstor poetry[776]: Traceback (most recent call last):
Jul 23 13:57:18 rockstor poetry[776]:   File "<string>", line 1, in <module>
Jul 23 13:57:18 rockstor poetry[776]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 13:57:18 rockstor poetry[776]:     __import__(name)
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 6, in <module>
Jul 23 13:57:18 rockstor poetry[776]:     django.setup()
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
Jul 23 13:57:18 rockstor poetry[776]:     apps.populate(settings.INSTALLED_APPS)
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
Jul 23 13:57:18 rockstor poetry[776]:     app_config.import_models()
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
Jul 23 13:57:18 rockstor poetry[776]:     self.models_module = import_module(models_module_name)
Jul 23 13:57:18 rockstor poetry[776]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 13:57:18 rockstor poetry[776]:     __import__(name)
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 13:57:18 rockstor poetry[776]:     from storageadmin.models.user import User  # noqa E501
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 13:57:18 rockstor poetry[776]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 13:57:18 rockstor poetry[776]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 13:57:18 rockstor poetry[776]:     from subprocess import run, Popen, PIPE
Jul 23 13:57:18 rockstor poetry[776]: ImportError: cannot import name run
Jul 23 13:57:18 rockstor systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE

rockstor:~ # systemctl start rockstor-pre.service
Job for rockstor-pre.service failed because the control process exited with error code.
See "systemctl status rockstor-pre.service" and "journalctl -xeu rockstor-pre.service" for details.
rockstor:~ # zypper info rockstor
Loading repository data...
Reading installed packages...


Information for package rockstor:
---------------------------------
Repository     : Rockstor-Testing
Name           : rockstor
Version        : 5.0.0-0
Arch           : x86_64
Vendor         : YewTreeApps
Installed Size : 9.6 MiB
Installed      : Yes
Status         : up-to-date
Source package : rockstor-5.0.0-0.src
Upstream URL   : 
Summary        : Btrfs Network Attached Storage (NAS) Appliance.
Description    :
    Software raid, snapshot capable NAS solution with built-in file integrity protection.
    Allows for file sharing between network attached devices.

rockstor:/opt/rockstor # poetry env info

Virtualenv
Python:         2.7.18
Implementation: CPython
Path:           /opt/rockstor/.venv
Valid:          True

System
Platform: linux
OS:       posix
Python:   /usr

rockstor:/opt/rockstor # ls -lah /opt/rockstor/.venv/bin/
total 224K
drwxr-xr-x 1 root root 1.2K Jul 17 20:40 .
drwxr-xr-x 1 root root   76 Mar 10 11:32 ..
-rw-r--r-- 1 root root 2.1K Mar 10 11:32 activate
-rw-r--r-- 1 root root 1.4K Mar 10 11:32 activate.csh
-rw-r--r-- 1 root root 3.0K Mar 10 11:32 activate.fish
-rw-r--r-- 1 root root 2.5K Mar 10 11:32 activate.nu
-rw-r--r-- 1 root root 1.8K Mar 10 11:32 activate.ps1
-rw-r--r-- 1 root root 1.2K Mar 10 11:32 activate_this.py
-rwxr-xr-x 1 root root  111 Jul 17 20:54 backup-config
-rwxr-xr-x 1 root root  107 Jul 17 20:54 bootstrap
-rwxr-xr-x 1 root root  235 Mar 10 11:32 chardetect
-rwxr-xr-x 1 root root  118 Jul 17 20:54 data-collector
-rw-r--r-- 1 root root  682 Mar 10 11:32 deactivate.nu
-rwxr-xr-x 1 root root  107 Jul 17 20:54 debug-mode
-rwxr-xr-x 1 root root  112 Jul 17 20:54 delete-api-key
-rwxr-xr-x 1 root root  129 Jul 17 20:54 delete-rockon
-rwxr-xr-x 1 root root  219 Mar 10 11:32 distro
-rwxr-xr-x 1 root root  277 Mar 10 11:32 django-admin
-rwxr-xr-x 1 root root  139 Mar 10 11:32 django-admin.py
-rwxr-xr-x 1 root root  244 Mar 10 11:32 easy_install
-rwxr-xr-x 1 root root  244 Mar 10 11:32 easy_install-2.7
-rwxr-xr-x 1 root root  244 Mar 10 11:32 easy_install2
-rwxr-xr-x 1 root root  244 Mar 10 11:32 easy_install2.7
-rwxr-xr-x 1 root root  232 Mar 10 11:32 echo_supervisord_conf
-rwxr-xr-x 1 root root  112 Jul 17 20:54 flash-optimize
-rwxr-xr-x 1 root root  231 Mar 10 11:32 gunicorn
-rwxr-xr-x 1 root root  233 Mar 10 11:32 gunicorn_paster
-rwxr-xr-x 1 root root  253 Mar 10 11:32 huey_consumer
-rwxr-xr-x 1 root root 1.5K Mar 10 11:32 huey_consumer.py
-rwxr-xr-x 1 root root  106 Jul 17 20:54 initrock
-rwxr-xr-x 1 root root  123 Jul 17 20:54 mnt-share
-rwxr-xr-x 1 root root  119 Jul 17 20:54 ovpn-client-gen
-rwxr-xr-x 1 root root  129 Jul 17 20:54 ovpn-client-print
-rwxr-xr-x 1 root root  113 Jul 17 20:54 ovpn-initpki
-rwxr-xr-x 1 root root  232 Mar 10 11:32 pidproxy
-rwxr-xr-x 1 root root  235 Mar 10 11:32 pip
-rwxr-xr-x 1 root root  235 Mar 10 11:32 pip-2.7
-rwxr-xr-x 1 root root  235 Mar 10 11:32 pip2
-rwxr-xr-x 1 root root  235 Mar 10 11:32 pip2.7
-rwxr-xr-x 1 root root  105 Jul 17 20:54 prep_db
-rwxr-xr-x 1 root root  105 Jul 17 20:54 pwreset
-rwxr-xr-x 1 root root 6.2K Mar 10 11:32 python
lrwxrwxrwx 1 root root    6 Mar 10 11:32 python2 -> python
lrwxrwxrwx 1 root root    6 Mar 10 11:32 python2.7 -> python
-rwxr-xr-x 1 root root  110 Jul 17 20:54 qgroup-clean
-rwxr-xr-x 1 root root  117 Jul 17 20:54 qgroup-maxout-limit
-rwxr-xr-x 1 root root  131 Jul 17 20:54 replicad
-rwxr-xr-x 1 root root  126 Jul 17 20:54 send-replica
-rwxr-xr-x 1 root root  124 Jul 17 20:54 st-pool-scrub
-rwxr-xr-x 1 root root  122 Jul 17 20:54 st-snapshot
-rwxr-xr-x 1 root root  129 Jul 17 20:54 st-system-power
-rwxr-xr-x 1 root root  237 Mar 10 11:32 supervisorctl
-rwxr-xr-x 1 root root  235 Mar 10 11:32 supervisord
-rwxr-xr-x 1 root root  222 Mar 10 11:32 wheel
-rwxr-xr-x 1 root root  222 Mar 10 11:32 wheel-2.7
-rwxr-xr-x 1 root root  222 Mar 10 11:32 wheel2
-rwxr-xr-x 1 root root  222 Mar 10 11:32 wheel2.7

rockstor:/opt/rockstor # zypper info python3 python3-devel
Loading repository data...
Reading installed packages...


Information for package python3:
--------------------------------
Repository     : Update repository with updates from SUSE Linux Enterprise 15
Name           : python3
Version        : 3.6.15-150300.10.48.1
Arch           : x86_64
Vendor         : SUSE LLC 
Installed Size : 141.3 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : python3-3.6.15-150300.10.48.1.src
Upstream URL   : 
Summary        : Python 3 Interpreter
Description    :
    Python 3 is modern interpreted, object-oriented programming language,
    often compared to Tcl, Perl, Scheme, or Java.  You can find an overview
    of Python in the documentation and tutorials included in the python3-doc
    package.

    This package supplies rich command line features provided by readline,
    and sqlite3 support for the interpreter core, thus forming a so called
    "extended" runtime.
    Installing "python3" is sufficient for the vast majority of usecases.
    In addition, recommended packages provide UI toolkit support (python3-curses,
    python3-tk), legacy UNIX database bindings (python3-dbm), and the IDLE
    development environment (python3-idle).


Information for package python3-devel:
--------------------------------------
Repository     : Update repository with updates from SUSE Linux Enterprise 15
Name           : python3-devel
Version        : 3.6.15-150300.10.48.1
Arch           : x86_64
Vendor         : SUSE LLC 
Installed Size : 790.0 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : python3-core-3.6.15-150300.10.48.1.src
Upstream URL   : 
Summary        : Include Files and Libraries Mandatory for Building Python Modules
Description    :
    The Python programming language's interpreter can be extended with
    dynamically loaded extensions and can be embedded in other programs.

    This package contains header files, a static library, and development
    tools for building Python modules, extending the Python interpreter or
    embedding Python in applications.

    This also includes the Python distutils, which were in the Python
    package up to version 2.2.2.
3 Likes

Thanks a lot to you both for all the information.

I’m thinking of a quick workaround to get you back up and running but I unfortunately need a bit of time before I can test it and verify it works. I’ve got an important deadline at work that I need to take care of first. I’m hoping to be able to test that and get back to you later today unless somebody else fixes it first :wink:.

Sorry for the inconvenience, but thanks a lot again for all the information.

4 Likes

I just tested it very briefly (and thus very roughly) and it seems to fix the issue. Let me test with a system that has some configuration to make sure it won’t lose any Rocsktor’s config.

4 Likes

Brief instructions to get you back and running:

  • delete the old .venv and re-install the latest rockstor package
  • reboot
  1. Go to rockstor’s dir and delete the old .venv:
cd /opt/rockstor
rm -r .venv
  1. Make sure no main rockstor services are running (it should already be the case for those who have already rebooted and noticed the failure to start, but let’s ensure it is the case nonetheless):
systemctl stop rockstor-pre rockstor-bootstrap rockstor
  1. Re-install rockstor. We use the -f flag to force the reinstallation of an existing package. Answer y at the prompt if all looks good.
zypper in --no-recommends -f rockstor
  1. Reboot.

Brief explanations

Rockstor-5 now uses Python3 vs Python2 in earlier Rockstor versions. As we’re now running in a virtual environment managed by Poetry, the latter unfortunately failed to update its own venv (as it seems to be running from it). Removing this now-old virtual environment now allows the new venv to be created as instructed in the poetry.lock file during the RPM install of the rockstor-5 package.

Steps to reproduce

  1. From a current pre-Rockstor-5 RPM installation (I used Rockstor-4.6.1-0 RPM install), activate the Testing channel and update Rockstor.
  2. The rpm install completes but poetry does fail to install the .venv:
$ cat poetry-install.txt 
Installing dependencies from lock file

  SolverProblemError

  The current project's Python requirement (2.7.18) is not compatible with some of the required packages Python requirement:
    - distro requires Python >=3.6, so it will not be satisfied for Python 2.7.18
  
  Because distro (1.8.0) requires Python >=3.6
   and no versions of distro match !=1.8.0, distro is forbidden.
  So, because rockstor depends on distro (*), version solving failed.

  at ~/.local/share/pypoetry/venv/lib64/python3.6/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For distro, a possible solution would be to set the `python` property to "<empty>"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
  1. Reboot: fails to start rockstor-pre.service:
$ journactl -xe -u rockstor-pre
    Jul 23 11:31:57 rockstable systemd[1]: Starting Tasks required prior to starting Rockstor...
░░ Subject: A start job for unit rockstor-pre.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit rockstor-pre.service has begun execution.
░░ 
░░ The job identifier is 242.
Jul 23 11:31:58 rockstable poetry[818]: Traceback (most recent call last):
Jul 23 11:31:58 rockstable poetry[818]:   File "<string>", line 1, in <module>
Jul 23 11:31:58 rockstable poetry[818]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 11:31:58 rockstable poetry[818]:     __import__(name)
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 6, in <module>
Jul 23 11:31:58 rockstable poetry[818]:     django.setup()
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
Jul 23 11:31:58 rockstable poetry[818]:     apps.populate(settings.INSTALLED_APPS)
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
Jul 23 11:31:58 rockstable poetry[818]:     app_config.import_models()
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
Jul 23 11:31:58 rockstable poetry[818]:     self.models_module = import_module(models_module_name)
Jul 23 11:31:58 rockstable poetry[818]:   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
Jul 23 11:31:58 rockstable poetry[818]:     __import__(name)
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/src/rockstor/storageadmin/models/__init__.py", line 34, in <module>
Jul 23 11:31:58 rockstable poetry[818]:     from storageadmin.models.user import User  # noqa E501
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/src/rockstor/storageadmin/models/user.py", line 27, in <module>
Jul 23 11:31:58 rockstable poetry[818]:     from system.users import ifp_get_properties_from_name_or_id
Jul 23 11:31:58 rockstable poetry[818]:   File "/opt/rockstor/src/rockstor/system/users.py", line 25, in <module>
Jul 23 11:31:58 rockstable poetry[818]:     from subprocess import run, Popen, PIPE
Jul 23 11:31:58 rockstable poetry[818]: ImportError: cannot import name run
Jul 23 11:31:58 rockstable systemd[1]: rockstor-pre.service: Main process exited, code=exited, status=1/FAILURE
(...)
4 Likes

This worked for me :slight_smile:
Thank you @Flox for the quick fix!!
Let’s see if @eriklysoe can confirm this fix too

4 Likes

Yes, it worked. Thanks a lot @Flox :slight_smile:

4 Likes

@Mark93 & @eriklysoe Thanks for the excellent reporting, much appreciated.

@Flox Well done on the exposition here. Nice.

So our Poetry dependencies manager / build element can’t do an in-place Python switch. That’s a shame, and a little surprising. This may be down to our required user of a relatively early version of 1.1.15. But while we straddle the transition between EOL Python2.7/3.6 towards 3.7+ we are caught between a rocks and a hard place on this on. But the hope is that we can rapidly update our dependencies in this testing cycle sufficiently to enable our use of a more modern Poetry. But it has served use excellently in our latter stages of the last testing phase, where it rescued us from a dead-end regarding our well-old prior build system of buildout, a costly transition in time and stability we could have done without actually. But progress all-in.

I’ll look to a fix for this: and I think the most likely place would be an rpm spec file scriptlet modification in our testing branch of:

We already wipe .venv during uninstall, so similarly an uninstall and re-install should be an equivalent work-around, assuming no other command line intervention. Early testing rpms are not update tested from any prior version. But they are fresh install tested on their target OS/arch. Only stable rpms are updated tested, and then only from the prior stable rpm. The testing channel has to incorporate breakage as otherwise how would our developer contributors see for themselves what needs fixing. But as can be seen from the above rpmbuild repo an rpm is only build if the %check scriptlet passes. That is our entire test suite.

Thanks again for the earliest testing feedback here all. If I’m not beaten to it I’ll update this thread when there is a new rpm release that resolves this update from prior versions. The proposed fix will however add significant time to our update process, as the .venv will then be rebuild from scratch on every rpm update: but we have a number of Python updates to go before we reach our 3.11 goal so we may just have to adopt this brute force approach for at least the near future.

4 Likes

You could add a check for the python version in the venv before wiping it. If it’s 2, wipe it, if it’s 3, don’t wipe.

Something like this should do it

if [[ -f %{prefix}/%{name}/.venv/python2 ]]; then
  echo "Python2 found. Wiping venv"
  rm -rf %{prefix}/%{name}/.venv
fi
1 Like

@StephenBrown2 Hello again.

Yes, we were considering such a thing, but e currently have a range of Python versions that we accomodate to enable our Tumbleweed builds. This is defined for Poetry in pyproject.toml, and it then selects what the OS can offer that meets this requirement. It cant actually install that poetry. That is the main hang-up here. So it will choose say 3.6.15 in the Leaps and 3.8 in TW. So we end up having multiple sources of truth and checks here there and everywhere. So we are going with brute force for now untill we can get to something across our OS target compatible, say 3.11. It seems to be a limitation in Poetry, or at least our old version which we still need for it’s compatibility.

We may end up going the way of sensing as you suggest. But for now we have a lot of updates to Python planned, and this has been observed in 3.10 to 3.11 transitions also. So we can’t have a test for every single one as it were. Just testing our options in the rpm spec file now as it goes.

1 Like

This fix worked for me too :slight_smile:

2 Likes

Hello again, @Jorma_Tuomainen :wink:

I was just about to write that @phillxnet worked hard to get the next release in the Testing channel out, which includes a fix for this issue: V5.0+ Testing Channel Changelog - #4 by phillxnet. As mentioned in that post, note that a reboot may be required here.

2 Likes