jookies / jasmin

Jasmin - Open source SMS gateway
http://jasminsms.com
Other
991 stars 540 forks source link

Upgrade from 0.10.3 to 0.11.0 fails because unresolvable pip dependecies [RHEL/Rocky/Alma 8] #1155

Closed Kisuke-CZE closed 8 months ago

Kisuke-CZE commented 8 months ago

Hi,

just posting info that upgrading jasmin from 0.10.3 to 0.11.0 fails on RHEL8 clones (when using jookies repository).

Post installation script fails with:

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
ERROR: Invalid requirement: 'jasmin==0.11.0\n0.11.0'
warning: %post(jasmin-sms-gateway-0:0.11.0-1.x86_64) scriptlet failed, exit status 

I believe real reason is some problem in pip dependecies, because when I run pip3 install jasmin==0.11.0 manually, it will fail with this:

ERROR: Could not find a version that satisfies the requirement Twisted~=23.10.0 (from jasmin) (from versions: 2.1.0, 9.0.0, 10.0.0, 10.1.0, 10.2.0, 11.0.0, 11.1.0, 12.0.0, 12.1.0, 12.2.0, 12.3.0, 13.0.0, 13.1.0, 13.2.0, 14.0.0, 14.0.1, 14.0.2, 15.0.0, 15.1.0, 15.2.0, 15.2.1, 15.3.0, 15.4.0, 15.5.0, 16.0.0, 16.1.0, 16.1.1, 16.2.0, 16.3.0, 16.3.1, 16.3.2, 16.4.0, 16.4.1, 16.5.0rc1, 16.5.0rc2, 16.5.0, 16.6.0rc1, 16.6.0, 16.7.0rc1, 16.7.0rc2, 17.1.0rc1, 17.1.0, 17.5.0, 17.9.0rc1, 17.9.0, 18.4.0rc1, 18.4.0, 18.7.0rc1, 18.7.0rc2, 18.7.0, 18.9.0rc1, 18.9.0, 19.2.0rc1, 19.2.0rc2, 19.2.0, 19.2.1, 19.7.0rc1, 19.7.0, 19.10.0rc1, 19.10.0, 20.3.0rc1, 20.3.0, 21.2.0rc1, 21.2.0, 21.7.0rc1, 21.7.0rc2, 21.7.0rc3, 21.7.0, 22.1.0rc1, 22.1.0, 22.2.0rc1, 22.2.0, 22.4.0rc1, 22.4.0)
ERROR: No matching distribution found for Twisted~=23.10.0

Quick fix can be installing packages with edited dependecies using pip like this: jasmin-0.11.0.tar.gz smpp.twisted3-0.8.tar.gz treq-23.11.0.tar.gz txAMQP3-0.9.4.tar.gz

But this is not fix in long run. It's just "back to functional state" solution. Will try to investigate further, but now I do not have time for that. Final solution might involve change in packaging for RPM (maybe DEB too?). I might have an idea - using python VENV to separate jasmin dependecies from rest of the system - but it is only idea.

farirat commented 8 months ago

Hello @Kisuke-CZE

This is weird, Twisted 23.10.0 is already released

And running pip3 install jasmin==0.11.0 is fine on my side:

pip3 install jasmin==0.11.0
Collecting jasmin==0.11.0
  Downloading jasmin-0.11.0.tar.gz (1.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 283.9 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting pyasn1~=0.5.0 (from jasmin==0.11.0)
  Downloading pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.9/83.9 kB 128.4 kB/s eta 0:00:00
Collecting Twisted~=23.10.0 (from jasmin==0.11.0)
  Downloading twisted-23.10.0-py3-none-any.whl.metadata (9.5 kB)
Collecting treq~=23.11.0 (from jasmin==0.11.0)
  Downloading treq-23.11.0-py3-none-any.whl.metadata (3.4 kB)
Collecting pyparsing~=3.1.1 (from jasmin==0.11.0)
  Downloading pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting python-dateutil~=2.8.2 (from jasmin==0.11.0)
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 341.1 kB/s eta 0:00:00
Collecting service_identity~=23.1.0 (from jasmin==0.11.0)
  Downloading service_identity-23.1.0-py3-none-any.whl.metadata (5.5 kB)
Collecting lockfile~=0.12.2 (from jasmin==0.11.0)
  Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
Collecting falcon~=3.1.1 (from jasmin==0.11.0)
  Downloading falcon-3.1.1-cp311-cp311-macosx_10_9_universal2.whl (3.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 230.0 kB/s eta 0:00:00
Collecting txredisapi~=1.4.7 (from jasmin==0.11.0)
  Downloading txredisapi-1.4.10-py3-none-any.whl.metadata (22 kB)
Collecting tabulate~=0.8.7 (from jasmin==0.11.0)
  Downloading tabulate-0.8.10-py3-none-any.whl (29 kB)
Collecting txAMQP3~=0.9.4 (from jasmin==0.11.0)
  Using cached txAMQP3-0.9.4-py3-none-any.whl
Collecting smpp.pdu3~=0.6 (from jasmin==0.11.0)
  Downloading smpp.pdu3-0.6-py2.py3-none-any.whl (31 kB)
Collecting smpp.twisted3~=0.8 (from jasmin==0.11.0)
  Using cached smpp.twisted3-0.8-py3-none-any.whl
Collecting python-messaging~=0.5.13 (from jasmin==0.11.0)
  Using cached python_messaging-0.5.13-py3-none-any.whl
Collecting cryptography~=41.0.5 (from jasmin==0.11.0)
  Downloading cryptography-41.0.5-cp37-abi3-macosx_10_12_x86_64.whl.metadata (5.2 kB)
Collecting pyopenssl~=23.3.0 (from jasmin==0.11.0)
  Downloading pyOpenSSL-23.3.0-py3-none-any.whl.metadata (12 kB)
Collecting celery~=5.3.5 (from jasmin==0.11.0)
  Downloading celery-5.3.5-py3-none-any.whl.metadata (21 kB)
Collecting redis~=5.0.1 (from jasmin==0.11.0)
  Downloading redis-5.0.1-py3-none-any.whl.metadata (8.9 kB)
Collecting requests~=2.31.0 (from jasmin==0.11.0)
  Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting python-mimeparse~=1.6.0 (from jasmin==0.11.0)
  Downloading python_mimeparse-1.6.0-py2.py3-none-any.whl (6.1 kB)
Collecting prometheus-client~=0.18.0 (from jasmin==0.11.0)
  Downloading prometheus_client-0.18.0-py3-none-any.whl.metadata (26 kB)
Collecting billiard<5.0,>=4.2.0 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading billiard-4.2.0-py3-none-any.whl.metadata (4.4 kB)
Collecting click-didyoumean>=0.3.0 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading click_didyoumean-0.3.0-py3-none-any.whl (2.7 kB)
Collecting click-plugins>=1.1.1 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Collecting click-repl>=0.2.0 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading click_repl-0.3.0-py3-none-any.whl.metadata (3.6 kB)
Collecting click<9.0,>=8.1.2 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting kombu<6.0,>=5.3.3 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading kombu-5.3.3-py3-none-any.whl.metadata (3.1 kB)
Collecting tzdata>=2022.7 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 341.8/341.8 kB 239.7 kB/s eta 0:00:00
Collecting vine<6.0,>=5.1.0 (from celery~=5.3.5->jasmin==0.11.0)
  Downloading vine-5.1.0-py3-none-any.whl.metadata (2.7 kB)
Collecting cffi>=1.12 (from cryptography~=41.0.5->jasmin==0.11.0)
  Downloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)
Collecting six>=1.5 (from python-dateutil~=2.8.2->jasmin==0.11.0)
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting charset-normalizer<4,>=2 (from requests~=2.31.0->jasmin==0.11.0)
  Downloading charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests~=2.31.0->jasmin==0.11.0)
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 441.7 kB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1 (from requests~=2.31.0->jasmin==0.11.0)
  Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests~=2.31.0->jasmin==0.11.0)
  Downloading certifi-2023.7.22-py3-none-any.whl.metadata (2.2 kB)
Collecting attrs>=19.1.0 (from service_identity~=23.1.0->jasmin==0.11.0)
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 116.6 kB/s eta 0:00:00
Collecting pyasn1-modules (from service_identity~=23.1.0->jasmin==0.11.0)
  Downloading pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.3/181.3 kB 428.8 kB/s eta 0:00:00
Collecting incremental (from treq~=23.11.0->jasmin==0.11.0)
  Downloading incremental-22.10.0-py2.py3-none-any.whl (16 kB)
Collecting hyperlink>=21.0.0 (from treq~=23.11.0->jasmin==0.11.0)
  Downloading hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.6/74.6 kB 505.6 kB/s eta 0:00:00
Collecting automat>=0.8.0 (from Twisted~=23.10.0->jasmin==0.11.0)
  Downloading Automat-22.10.0-py2.py3-none-any.whl (26 kB)
Collecting constantly>=15.1 (from Twisted~=23.10.0->jasmin==0.11.0)
  Downloading constantly-23.10.4-py3-none-any.whl.metadata (1.8 kB)
Collecting typing-extensions>=4.2.0 (from Twisted~=23.10.0->jasmin==0.11.0)
  Downloading typing_extensions-4.8.0-py3-none-any.whl.metadata (3.0 kB)
Collecting zope-interface>=5 (from Twisted~=23.10.0->jasmin==0.11.0)
  Downloading zope.interface-6.1-cp311-cp311-macosx_10_9_x86_64.whl.metadata (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 507.3 kB/s eta 0:00:00
Collecting pycparser (from cffi>=1.12->cryptography~=41.0.5->jasmin==0.11.0)
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 478.3 kB/s eta 0:00:00
Collecting prompt-toolkit>=3.0.36 (from click-repl>=0.2.0->celery~=5.3.5->jasmin==0.11.0)
  Downloading prompt_toolkit-3.0.41-py3-none-any.whl.metadata (6.5 kB)
Collecting amqp<6.0.0,>=5.1.1 (from kombu<6.0,>=5.3.3->celery~=5.3.5->jasmin==0.11.0)
  Downloading amqp-5.2.0-py3-none-any.whl.metadata (8.9 kB)
Requirement already satisfied: setuptools in ./venv3/lib/python3.11/site-packages (from zope-interface>=5->Twisted~=23.10.0->jasmin==0.11.0) (68.2.2)
Collecting wcwidth (from prompt-toolkit>=3.0.36->click-repl>=0.2.0->celery~=5.3.5->jasmin==0.11.0)
  Downloading wcwidth-0.2.10-py2.py3-none-any.whl.metadata (14 kB)
Downloading celery-5.3.5-py3-none-any.whl (421 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 421.9/421.9 kB 215.2 kB/s eta 0:00:00
Downloading cryptography-41.0.5-cp37-abi3-macosx_10_12_x86_64.whl (2.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 359.8 kB/s eta 0:00:00
Downloading prometheus_client-0.18.0-py3-none-any.whl (61 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 483.9 kB/s eta 0:00:00
Downloading pyOpenSSL-23.3.0-py3-none-any.whl (58 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 411.4 kB/s eta 0:00:00
Downloading pyparsing-3.1.1-py3-none-any.whl (103 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.1/103.1 kB 428.9 kB/s eta 0:00:00
Downloading redis-5.0.1-py3-none-any.whl (250 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 250.3/250.3 kB 312.5 kB/s eta 0:00:00
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 305.5 kB/s eta 0:00:00
Downloading service_identity-23.1.0-py3-none-any.whl (12 kB)
Downloading treq-23.11.0-py3-none-any.whl (65 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.2/65.2 kB 315.4 kB/s eta 0:00:00
Downloading twisted-23.10.0-py3-none-any.whl (3.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 252.6 kB/s eta 0:00:00
Downloading txredisapi-1.4.10-py3-none-any.whl (31 kB)
Downloading billiard-4.2.0-py3-none-any.whl (86 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.7/86.7 kB 393.0 kB/s eta 0:00:00
Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158.3/158.3 kB 251.4 kB/s eta 0:00:00
Downloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.4/182.4 kB 195.1 kB/s eta 0:00:00
Downloading charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl (121 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.4/121.4 kB 158.5 kB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 243.8 kB/s eta 0:00:00
Downloading click_repl-0.3.0-py3-none-any.whl (10 kB)
Downloading constantly-23.10.4-py3-none-any.whl (13 kB)
Downloading kombu-5.3.3-py3-none-any.whl (199 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.1/199.1 kB 267.8 kB/s eta 0:00:00
Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.6/104.6 kB 303.2 kB/s eta 0:00:00
Downloading vine-5.1.0-py3-none-any.whl (9.6 kB)
Downloading zope.interface-6.1-cp311-cp311-macosx_10_9_x86_64.whl (202 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 202.4/202.4 kB 439.4 kB/s eta 0:00:00
Downloading amqp-5.2.0-py3-none-any.whl (50 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.9/50.9 kB 356.6 kB/s eta 0:00:00
Downloading prompt_toolkit-3.0.41-py3-none-any.whl (385 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 385.5/385.5 kB 203.1 kB/s eta 0:00:00
Downloading wcwidth-0.2.10-py2.py3-none-any.whl (105 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.2/105.2 kB 342.0 kB/s eta 0:00:00
Building wheels for collected packages: jasmin
  Building wheel for jasmin (setup.py) ... done
  Created wheel for jasmin: filename=jasmin-0.11.0-py3-none-any.whl size=193882 sha256=e48fb45dfbb589f2b53ebc1fb2acb6213dc3da8c6046ac29a2eae61d69ca883e
  Stored in directory: /Users/farirat/Library/Caches/pip/wheels/9e/55/db/03132a7ecc64063a2d64abf9dea9b5d5adb4a8d8a65aad9f5c
Successfully built jasmin
Installing collected packages: wcwidth, smpp.pdu3, python-mimeparse, python-messaging, lockfile, incremental, zope-interface, vine, urllib3, tzdata, typing-extensions, tabulate, six, redis, pyparsing, pycparser, pyasn1, prompt-toolkit, prometheus-client, idna, falcon, constantly, click, charset-normalizer, certifi, billiard, attrs, requests, python-dateutil, pyasn1-modules, hyperlink, click-repl, click-plugins, click-didyoumean, cffi, automat, amqp, Twisted, kombu, cryptography, txredisapi, txAMQP3, smpp.twisted3, service_identity, pyopenssl, celery, treq, jasmin
Successfully installed Twisted-23.10.0 amqp-5.2.0 attrs-23.1.0 automat-22.10.0 billiard-4.2.0 celery-5.3.5 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 click-didyoumean-0.3.0 click-plugins-1.1.1 click-repl-0.3.0 constantly-23.10.4 cryptography-41.0.5 falcon-3.1.1 hyperlink-21.0.0 idna-3.4 incremental-22.10.0 jasmin-0.11.0 kombu-5.3.3 lockfile-0.12.2 prometheus-client-0.18.0 prompt-toolkit-3.0.41 pyasn1-0.5.0 pyasn1-modules-0.3.0 pycparser-2.21 pyopenssl-23.3.0 pyparsing-3.1.1 python-dateutil-2.8.2 python-messaging-0.5.13 python-mimeparse-1.6.0 redis-5.0.1 requests-2.31.0 service_identity-23.1.0 six-1.16.0 smpp.pdu3-0.6 smpp.twisted3-0.8 tabulate-0.8.10 treq-23.11.0 txAMQP3-0.9.4 txredisapi-1.4.10 typing-extensions-4.8.0 tzdata-2023.3 urllib3-2.1.0 vine-5.1.0 wcwidth-0.2.10 zope-interface-6.1

Please share more information about your env.

Kisuke-CZE commented 8 months ago

Hello,

But you are not running AlmaLinux 8, or are you? I've tested it from 3times, and error is always the same. (Even on fresh install)

Separating to own VENV and installing newer python works:

dnf install -y python39
dnf install -y python3-virtualenv
mkdir /opt/jasmin-sms-gateway
useradd jasmin
chown jasmin:jasmin /opt/jasmin-sms-gateway
sudo -u jasmin virtualenv -p python3.9  /opt/jasmin-sms-gateway/venv
source /opt/jasmin-sms-gateway/venv/bin/activate
sudo -u jasmin /opt/jasmin-sms-gateway/venv/bin/pip install jasmin==0.11.0

Seems problem is Twisted 23.10.0 is not available for python3.6 (which is RHEL8 default from distribution)

EDIT: Well, explanation is here: https://github.com/twisted/twisted/blob/HEAD/NEWS.rst#deprecations-and-removals-6

Another WA for now is issuing for example this before upgrade/installing jasmin

dnf install python311
update-alternatives --set python3 /usr/bin/python3.11
farirat commented 8 months ago

Yes, jasmin's python requirement is >=3.8, it's only written here.

I will add it to requirements.txt and docs for better clarity.

Kisuke-CZE commented 8 months ago

Oh, you are right. Also here.

But package in repository does not specify python3 version:

dnf repoquery --requires jasmin-sms-gateway 
Last metadata expiration check: 0:00:37 ago on Wed 15 Nov 2023 03:03:21 PM CET.
epel-release
python3
python3-amqp
python3-celery
python3-dateutil
python3-jookies-messaging
python3-lockfile
python3-mimeparse
python3-pyparsing
python3-redis
python3-requests
python3-setuptools
python3-smpp-pdu3
python3-smpp-twisted3
python3-tabulate
python3-treq
python3-twisted
python3-txamqp3
python3-txredisapi

So default one is installed if you do not specify otherwise. How unfortunate.

Not to mention nothing provides python3 >= 3.8, because python311 provides python311 = 3.11.2-2.el8 instead. What a hell. Dedicated package maintainer for RHEL really needed to keep track of this.

Anyway, I am closing the issue. I believe you cannot do anything to fix that in current state of things.