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

DBus Issue #478

Closed
woo2 opened this issue Mar 13, 2017 · 11 comments
Closed

DBus Issue #478

woo2 opened this issue Mar 13, 2017 · 11 comments
Labels
bug Something isn't working 🔒 Outdated needs more info Further information is requested stale Inactive issue: will be closed soon if no activity

Comments

@woo2
Copy link

woo2 commented Mar 13, 2017

I get the following error when I run jrnl with Python 2.7.13 on my updated Fedora 25 machine. It only seems to happen when I am editing an encrypted journal, though I did notice that no editor is opened when I run jrnl by itself to edit the default journal, even though vim is set as my editor and it used to work normally.

$ jrnl --edit encrypted_journal.txt
Traceback (most recent call last):
  File "/usr/bin/jrnl", line 11, in <module>
    load_entry_point('jrnl==1.9.8', 'console_scripts', 'jrnl')()
  File "/usr/lib/python2.7/site-packages/jrnl/cli.py", line 194, in run
    journal = Journal.Journal(journal_name, **config)
  File "/usr/lib/python2.7/site-packages/jrnl/Journal.py", line 39, in __init__
    self.open()
  File "/usr/lib/python2.7/site-packages/jrnl/Journal.py", line 105, in open
    journal = util.get_password(keychain=self.name, validator=validate_password)
  File "/usr/lib/python2.7/site-packages/jrnl/util.py", line 37, in get_password
    pwd_from_keychain = keychain and get_keychain(keychain)
  File "/usr/lib/python2.7/site-packages/jrnl/util.py", line 56, in get_keychain
    return keyring.get_password('jrnl', journal_name)
  File "/usr/lib/python2.7/site-packages/keyring/core.py", line 42, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "/usr/lib/python2.7/site-packages/keyring/backends/SecretService.py", line 58, in get_password
    collection = self.get_preferred_collection()
  File "/usr/lib/python2.7/site-packages/keyring/backends/SecretService.py", line 50, in get_preferred_collection
    collection.unlock()
  File "/usr/lib/python2.7/site-packages/secretstorage/collection.py", line 63, in unlock
    return unlock_objects(self.bus, [self.collection_path], callback)
  File "/usr/lib/python2.7/site-packages/secretstorage/util.py", line 168, in unlock_objects
    return exec_prompt_glib(bus, prompt)[0]
  File "/usr/lib/python2.7/site-packages/secretstorage/util.py", line 134, in exec_prompt_glib
    exec_prompt(bus, prompt, callback)
  File "/usr/lib/python2.7/site-packages/secretstorage/util.py", line 122, in exec_prompt
    prompt_iface.connect_to_signal('Completed', new_callback)
  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 544, in connect_to_signal
    dbus_interface, **keywords)
  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 369, in connect_to_signal
    **keywords)
  File "/usr/lib64/python2.7/site-packages/dbus/bus.py", line 148, in add_signal_receiver
    path, **keywords)
  File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 400, in add_signal_receiver
    self._require_main_loop()
RuntimeError: To make asynchronous calls, receive signals or export objects, D-Bus connections must be attached to a main loop by passing mainloop=... to the constructor or calling dbus.set_default_main_loop(...)

This is what my .jrnl_config looks like.

  "default_hour": 9, 
  "timeformat": "%Y-%m-%d %H:%M", 
  "linewrap": 79, 
  "encrypt": true, 
  "editor": "vim", 
  "default_minute": 0, 
  "highlight": true, 
  "journals": {
    "default": "/home/paul/writing/thoughts.text"
  }, 
  "tagsymbols": "@"
}

I completely reinstalled jrnl, but nothing was fixed:

$ pip2 install "jrnl[encrypted]" --ignore-installed --upgrade
Collecting jrnl[encrypted]
  Using cached jrnl-1.9.8.tar.gz
Collecting parsedatetime>=1.2 (from jrnl[encrypted])
  Using cached parsedatetime-2.3-py2-none-any.whl
Collecting pytz>=2013b (from jrnl[encrypted])
  Using cached pytz-2016.10-py2.py3-none-any.whl
Collecting six>=1.6.1 (from jrnl[encrypted])
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting tzlocal>=1.1 (from jrnl[encrypted])
  Using cached tzlocal-1.3.tar.gz
Collecting keyring>=3.3 (from jrnl[encrypted])
  Using cached keyring-10.3-py2.py3-none-any.whl
Collecting python-dateutil==1.5 (from jrnl[encrypted])
  Using cached python-dateutil-1.5.tar.gz
Collecting pycrypto>=2.6 (from jrnl[encrypted])
  Using cached pycrypto-2.6.1.tar.gz
Collecting future (from parsedatetime>=1.2->jrnl[encrypted])
  Using cached future-0.16.0.tar.gz
Collecting secretstorage; sys_platform == "linux2" or sys_platform == "linux" (from keyring>=3.3->jrnl[encrypted])
  Using cached SecretStorage-2.3.1.tar.gz
Collecting cryptography (from secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached cryptography-1.8.1.tar.gz
Collecting idna>=2.1 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached idna-2.5-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached asn1crypto-0.21.1-py2.py3-none-any.whl
Collecting packaging (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached packaging-16.8-py2.py3-none-any.whl
Collecting setuptools>=11.3 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached setuptools-34.3.2-py2.py3-none-any.whl
Collecting enum34 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting ipaddress (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached ipaddress-1.0.18-py2-none-any.whl
Collecting cffi>=1.4.1 (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached cffi-1.9.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting pyparsing (from packaging->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools>=11.3->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached appdirs-1.4.3-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring>=3.3->jrnl[encrypted])
  Using cached pycparser-2.17.tar.gz
Installing collected packages: future, parsedatetime, pytz, six, tzlocal, idna, asn1crypto, pyparsing, packaging, appdirs, setuptools, enum34, ipaddress, pycparser, cffi, cryptography, secretstorage, keyring, python-dateutil, pycrypto, jrnl
  Running setup.py install for future ... done
  Running setup.py install for tzlocal ... done
  Running setup.py install for pycparser ... done
  Running setup.py install for cryptography ... done
  Running setup.py install for secretstorage ... done
  Running setup.py install for python-dateutil ... done
  Running setup.py install for pycrypto ... done
  Running setup.py install for jrnl ... done
Successfully installed appdirs-1.4.3 asn1crypto-0.21.1 cffi-1.9.1 cryptography-1.8.1 enum34-1.1.6 future-0.16.0 idna-2.5 ipaddress-1.0.18 jrnl-1.9.8 keyring-10.3 packaging-16.8 parsedatetime-2.3 pycparser-2.17 pycrypto-2.6.1 pyparsing-2.2.0 python-dateutil-1.5 pytz-2016.10 secretstorage-2.3.1 setuptools-34.3.2 six-1.10.0 tzlocal-1.3
@maebert
Copy link
Contributor

maebert commented Mar 13, 2017

Could you try and run pip install -U keyring and see if this changes anything?

@maebert maebert added the bug Something isn't working label Mar 13, 2017
@woo2
Copy link
Author

woo2 commented Mar 14, 2017

Nothing changed.

$ pip install -U keyring
Requirement already up-to-date: keyring in /usr/lib/python3.5/site-packages
Requirement already up-to-date: secretstorage; sys_platform == "linux2" or sys_platform == "linux" in /usr/lib/python3.5/site-packages (from keyring)
Requirement already up-to-date: cryptography in /usr/lib64/python3.5/site-packages (from secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: idna>=2.1 in /usr/lib/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: asn1crypto>=0.21.0 in /usr/lib/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: packaging in /usr/lib/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: six>=1.4.1 in /usr/lib/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: setuptools>=11.3 in /usr/lib/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: cffi>=1.4.1 in /usr/lib64/python3.5/site-packages (from cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: pyparsing in /usr/lib/python3.5/site-packages (from packaging->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/lib/python3.5/site-packages (from setuptools>=11.3->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)
Requirement already up-to-date: pycparser in /usr/lib/python3.5/site-packages (from cffi>=1.4.1->cryptography->secretstorage; sys_platform == "linux2" or sys_platform == "linux"->keyring)

@maebert
Copy link
Contributor

maebert commented Mar 14, 2017

Ah, looks like this is a known issue (see jaraco/keyring#223) in the secretstorage module, which keyring depends on (the module that manages storing your password in your key chain. Here's how to fix it:

pip install dbus-python

Does that work for you?

@woo2
Copy link
Author

woo2 commented Mar 14, 2017

Installing dbus-python resulted in this:

Collecting dbus-python
  Using cached dbus-python-1.2.4.tar.gz
Installing collected packages: dbus-python
  Running setup.py install for dbus-python ... done
Successfully installed dbus-python-1.2.4

I noticed that running jrnl --edit on an encrypted journal no longer causes the error, but it also does not bring up my editor. jrnl -n # still causes the same error when opening encrypted files. Running jrnl to edit the default journal does not work either, but I don't remember how it normally works.

@boardfish
Copy link

boardfish commented Apr 22, 2017

After doing all of the things listed here, I got different results. Running jrnl --edit resulted in a prompt asking me to create a password, and I'm now able to use jrnl fully as intended using that password. I'm surprised it doesn't work for @woo2, but...best of luck, I guess.

@boardfish
Copy link

I'm now getting this error when using a second journal work using jrnl work. Any commands involving jrnl work now result in this error.

@mmaalo
Copy link

mmaalo commented Feb 14, 2019

uninstalling and then reinstalling jrnl fixed this for me.

just run sudo pip uninstall jrnl
then run sudo pip install jrnl

@wren
Copy link
Member

wren commented Jul 20, 2019

Does this still happen with v2.0? We've dropped Python 2 support, so it would be helpful is someone can confirm if this still happens with Python 3 on Jrnl 2.0+

@wren wren added the needs more info Further information is requested label Jul 20, 2019
@woo2
Copy link
Author

woo2 commented Jul 20, 2019 via email

@stale
Copy link

stale bot commented Sep 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issue: will be closed soon if no activity label Sep 18, 2019
@stale stale bot closed this as completed Sep 25, 2019
@maebert maebert mentioned this issue Nov 8, 2019
7 tasks
@lock
Copy link

lock bot commented May 21, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 🔒 Outdated needs more info Further information is requested stale Inactive issue: will be closed soon if no activity
Projects
None yet
Development

No branches or pull requests

5 participants