Skip to content

Remove keyring package for Linux #190

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

Closed
yatesco opened this issue Feb 12, 2019 · 8 comments
Closed

Remove keyring package for Linux #190

yatesco opened this issue Feb 12, 2019 · 8 comments
Assignees
Labels
help wanted This issue is available, comment if you want to fix it priority:medium Non-critical improvement to functionality or usability type:refactor

Comments

@yatesco
Copy link

yatesco commented Feb 12, 2019

Describe the bug
pip3 install vorta --user has a pretty impressive back-trace when starting (see the stack trace at the bottom). coliny@dev-os:~$ pip3 install --upgrade keyrings.alt makes the world a better place:

Collecting keyrings.alt
  Downloading https://files.pythonhosted.org/packages/f2/97/e0601ee8e936a13245686af0ac9ed2e2bb61706b4155e4e629cf063ad248/keyrings.alt-3.1.1-py2.py3-none-any.whl
Collecting six (from keyrings.alt)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, keyrings.alt
Successfully installed keyrings.alt-3.1.1 six-1.12.0
coliny@dev-os:~$ 
coliny@dev-os:~$ ./.local/bin/vorta 
Forking to background (see system tray).

To Reproduce
Desktop (please complete the following information):
OS: Ubuntu Budgie 18.10 - all up to date and pip3 install vorta --user

Additional context

coliny@dev-os:~$ pip3 install vorta --user
Collecting vorta
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/45/c4/8b5ad0d7547a48f229ad1feef582d83bf16c399dd7f4c89b1ff1c21a8aa6/vorta-0.6.8.tar.gz (167kB)
    100% |████████████████████████████████| 174kB 4.3MB/s 
Collecting appdirs (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Collecting apscheduler (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/97/3a/fa3213cc325091b7729616594611fff31d72c2d4d590418c3efdf7424ae2/APScheduler-3.5.3-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 7.2MB/s 
Collecting keyring (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/28/01/06f2e55264994a89d543ee37f2cfc4af85800824a8ca5c6532f715ff41a9/keyring-17.1.1-py2.py3-none-any.whl
Collecting paramiko (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/cf/ae/94e70d49044ccc234bfdba20114fa947d7ba6eb68a2e452d89b920e62227/paramiko-2.4.2-py2.py3-none-any.whl (193kB)
    100% |████████████████████████████████| 194kB 4.2MB/s 
Collecting peewee (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/3b/10/619604d488416fb99a2f8ae145ae94f3ebac2812dbd1d334b0785ce7de2e/peewee-3.8.2.tar.gz (816kB)
    100% |████████████████████████████████| 819kB 1.8MB/s 
Collecting psutil (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/6e/a0/833bcbcede5141cc5615e50c7cc5b960ce93d9c9b885fbe3b7d36e48a2d4/psutil-5.5.0.tar.gz (425kB)
    100% |████████████████████████████████| 430kB 2.8MB/s 
Collecting pyqt5 (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/5e/91/9ac8827d0af428e756f461a3aa7bcbc53d6450edfe026e27569f5ff3689e/PyQt5-5.12-5.12.1-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl (61.0MB)
    100% |████████████████████████████████| 61.1MB 35kB/s 
Collecting python-dateutil (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
    100% |████████████████████████████████| 235kB 3.6MB/s 
Collecting qdarkstyle (from vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/15/ee/e31ce8218e1a9c24d199509ad35d33512d629d65d9af723a8adb20140433/QDarkStyle-2.6.5-py2.py3-none-any.whl (173kB)
    100% |████████████████████████████████| 174kB 4.0MB/s 
Collecting pytz (from apscheduler->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
    100% |████████████████████████████████| 512kB 2.7MB/s 
Collecting six>=1.4.0 (from apscheduler->vorta)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting tzlocal>=1.2 (from apscheduler->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/cb/89/e3687d3ed99bc882793f82634e9824e62499fdfdc4b1ae39e211c5b05017/tzlocal-1.5.1.tar.gz
Collecting setuptools>=0.7 (from apscheduler->vorta)
  Downloading https://files.pythonhosted.org/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl (575kB)
    100% |████████████████████████████████| 583kB 2.5MB/s 
Collecting entrypoints (from keyring->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl
Collecting secretstorage; sys_platform == "linux" and python_version >= "3.5" (from keyring->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/82/59/cb226752e20d83598d7fdcabd7819570b0329a61db07cfbdd21b2ef546e3/SecretStorage-3.1.1-py3-none-any.whl
Collecting pyasn1>=0.1.7 (from paramiko->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 6.6MB/s 
Collecting cryptography>=1.5 (from paramiko->vorta)
  Downloading https://files.pythonhosted.org/packages/98/71/e632e222f34632e0527dd41799f7847305e701f38f512d81bdf96009bca4/cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl (2.4MB)
    100% |████████████████████████████████| 2.4MB 821kB/s 
Collecting pynacl>=1.0.1 (from paramiko->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/27/15/2cd0a203f318c2240b42cd9dd13c931ddd61067809fee3479f44f086103e/PyNaCl-1.3.0-cp34-abi3-manylinux1_x86_64.whl (759kB)
    100% |████████████████████████████████| 768kB 2.0MB/s 
Collecting bcrypt>=3.1.3 (from paramiko->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d0/79/79a4d167a31cc206117d9b396926615fa9c1fdbd52017bcced80937ac501/bcrypt-3.1.6-cp34-abi3-manylinux1_x86_64.whl (55kB)
    100% |████████████████████████████████| 61kB 9.2MB/s 
Collecting PyQt5_sip<4.20,>=4.19.14 (from pyqt5->vorta)
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/94/b5/ee9e2f594e11e762c1a04529549b4a3264037861c01b073fbc992676066b/PyQt5_sip-4.19.14-cp36-cp36m-manylinux1_x86_64.whl (67kB)
    100% |████████████████████████████████| 71kB 6.6MB/s 
Collecting jeepney (from secretstorage; sys_platform == "linux" and python_version >= "3.5"->keyring->vorta)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/2b/f7/ff23b9b59534f501d47c327576aadda59da5b83d76ff837e6075bc325b9f/jeepney-0.4-py3-none-any.whl (59kB)
    100% |████████████████████████████████| 61kB 7.1MB/s 
Collecting asn1crypto>=0.21.0 (from cryptography>=1.5->paramiko->vorta)
  Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
    100% |████████████████████████████████| 102kB 4.6MB/s 
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=1.5->paramiko->vorta)
  Downloading https://files.pythonhosted.org/packages/6d/c0/47db8f624f3e4e2f3f27be03a93379d1ba16a1450a7b1aacfa0366e2c0dd/cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl (421kB)
    100% |████████████████████████████████| 430kB 3.1MB/s 
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=1.5->paramiko->vorta)
  Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
    100% |████████████████████████████████| 163kB 4.6MB/s 
Building wheels for collected packages: vorta, peewee, psutil, tzlocal, pycparser
  Running setup.py bdist_wheel for vorta ... done
  Stored in directory: /home/coliny/.cache/pip/wheels/b0/f9/1b/84fb788bce018288dffb95ee9c357a051e4a4ee41885e0a08f
  Running setup.py bdist_wheel for peewee ... done
  Stored in directory: /home/coliny/.cache/pip/wheels/86/57/bf/bb933e0e0a8876a3a05859c497bea001c472f2ea57375d5755
  Running setup.py bdist_wheel for psutil ... done
  Stored in directory: /home/coliny/.cache/pip/wheels/23/6f/5a/f84c1790d7c9be43de2842cf8782fa84c9ec07e72b041d7251
  Running setup.py bdist_wheel for tzlocal ... done
  Stored in directory: /home/coliny/.cache/pip/wheels/15/ae/df/a67bf1ed84e9bf230187d36d8dcfd30072bea0236cb059ed91
  Running setup.py bdist_wheel for pycparser ... done
  Stored in directory: /home/coliny/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built vorta peewee psutil tzlocal pycparser
Installing collected packages: appdirs, pytz, six, tzlocal, setuptools, apscheduler, entrypoints, asn1crypto, pycparser, cffi, cryptography, jeepney, secretstorage, keyring, pyasn1, pynacl, bcrypt, paramiko, peewee, psutil, PyQt5-sip, pyqt5, python-dateutil, qdarkstyle, vorta
Successfully installed PyQt5-sip-4.19.14 appdirs-1.4.3 apscheduler-3.5.3 asn1crypto-0.24.0 bcrypt-3.1.6 cffi-1.11.5 cryptography-2.5 entrypoints-0.3 jeepney-0.4 keyring-17.1.1 paramiko-2.4.2 peewee-3.8.2 psutil-5.5.0 pyasn1-0.4.5 pycparser-2.19 pynacl-1.3.0 pyqt5-5.12 python-dateutil-2.8.0 pytz-2018.9 qdarkstyle-2.6.5 secretstorage-3.1.1 setuptools-40.8.0 six-1.12.0 tzlocal-1.5.1 vorta-0.6.8
coliny@dev-os:~$ vvort^C
coliny@dev-os:~$ ./.local/bin/vorta
Error initializing plugin EntryPoint('Windows (alt)', 'keyrings.alt.Windows', None, Distribution('keyrings.alt', '3.0')).
Traceback (most recent call last):
  File "/home/coliny/.local/lib/python3.6/site-packages/keyring/backend.py", line 194, in _load_plugins
    init_func = ep.load()
  File "/home/coliny/.local/lib/python3.6/site-packages/entrypoints.py", line 82, in load
    mod = import_module(self.module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/Windows.py", line 9, in <module>
    from . import file_base
  File "/usr/lib/python3/dist-packages/keyrings/alt/file_base.py", line 13, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint('file', 'keyrings.alt.file', None, Distribution('keyrings.alt', '3.0')).
Traceback (most recent call last):
  File "/home/coliny/.local/lib/python3.6/site-packages/keyring/backend.py", line 194, in _load_plugins
    init_func = ep.load()
  File "/home/coliny/.local/lib/python3.6/site-packages/entrypoints.py", line 82, in load
    mod = import_module(self.module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/file.py", line 11, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint('pyfs', 'keyrings.alt.pyfs', None, Distribution('keyrings.alt', '3.0')).
Traceback (most recent call last):
  File "/home/coliny/.local/lib/python3.6/site-packages/keyring/backend.py", line 194, in _load_plugins
    init_func = ep.load()
  File "/home/coliny/.local/lib/python3.6/site-packages/entrypoints.py", line 82, in load
    mod = import_module(self.module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/pyfs.py", line 8, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Forking to background (see system tray).
@ThomasWaldmann
Copy link
Collaborator

these lots of warnings look like a pip issue, but at least it says it installed the stuff.

not sure about that traceback at the end, works for me (i use virtualenv usually). :)

@m3nu
Copy link
Contributor

m3nu commented Feb 13, 2019

The keyring package is a mess and I already replaced it with my own Pyobjc implementation in macOS. I'm looking to do the same for Linux eventually and get rid of it.

@m3nu m3nu added priority:medium Non-critical improvement to functionality or usability type:refactor help wanted This issue is available, comment if you want to fix it labels Feb 13, 2019
@yatesco
Copy link
Author

yatesco commented Feb 13, 2019

I only really threw this up here as a "FYI" rather than a bug with Vorta itself, and to help others in the same situation. Happy to close this if you want.

@m3nu m3nu changed the title Error on ubuntu 18.10 due to keyrings.alt when installing from pip3 Remove keyring package for Linux Feb 13, 2019
@m3nu
Copy link
Contributor

m3nu commented Feb 13, 2019

Thanks. It's known and it should be handled. Renamed here and will update when it's changed.

@m3nu
Copy link
Contributor

m3nu commented Feb 13, 2019

Here is a package that looks more recent. It only supports Python 3 and Linux/DBus keychains.

https://secretstorage.readthedocs.io/en/latest/

You're interested in this @Hofer-Julian ? Would just need a new wrapper class to use the functions of this package.

@Hofer-Julian
Copy link
Collaborator

I am interested. I will look into it.

@Hofer-Julian Hofer-Julian self-assigned this Feb 14, 2019
@Hofer-Julian
Copy link
Collaborator

@m3nu I just looked into your code for macOS and you still use the keyring package. Is the goal to remove the use of "keyring.backends.SecretService" ?

@m3nu
Copy link
Contributor

m3nu commented Feb 15, 2019

True, we still inherit from keyring.backend.KeyringBackend, but only to keep it compatible when selecting the keyring. This could as well be removed. We just need the basic set_password() and get_password() methods. Currently there are 2 different keychains:

  • VortaDarwinKeyring – Pyobjc implementation for macOS
  • VortaDBKeyring – simple fallback that saves passwords to the settings database unencrypted.

Third one could be:

  • VortaSecretServiceKeyring (or some better name) – uses the above secretstorage package (or it's own implementation if it's short enough and maintainable)

Since the availability of those keystore services on Linux isn't guaranteed, it should test before using it. This already happens in vorta.utils:46. I guess the above package has some way to do the same.

@m3nu m3nu closed this as completed in a1d4161 Mar 6, 2019
@m3nu m3nu mentioned this issue Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is available, comment if you want to fix it priority:medium Non-critical improvement to functionality or usability type:refactor
Projects
None yet
Development

No branches or pull requests

4 participants