pulb / mailnag

An extensible mail notification daemon
GNU General Public License v2.0
253 stars 32 forks source link

mailnag-config doesn't start #155

Closed atomGit closed 7 years ago

atomGit commented 7 years ago

mint 18.1/kde

the config utility does not start - if i run mailnag-config in terminal...

$ mailnag-config
/usr/bin/mailnag-config:27: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py:38: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GnomeKeyring
Traceback (most recent call last):
  File "/usr/bin/mailnag-config", line 55, in <module>
    if __name__ == "__main__":  main()
  File "/usr/bin/mailnag-config", line 38, in main
    confwin = ConfigWindow()
  File "/usr/lib/python2.7/dist-packages/Mailnag/configuration/configwindow.py", line 95, in __init__
    self._accountman = AccountManager(CredentialStore.from_string(self._cfg.get('core', 'credentialstore')))
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 73, in from_string
    cs = CredentialStore.get_default()
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 64, in get_default
    CredentialStore._instance = SupportedCredentialStores[_credentialstoretype]()
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 94, in __init__
    raise KeyringUnlockException('Failed to unlock default keyring')
Mailnag.common.credentialstore.KeyringUnlockException: Failed to unlock default keyring
pulb commented 7 years ago

It seems the password of your default keyring does not match the login password. Either make those passwords match or tell mailnag to save passwords into a plain text file by setting credentialstore = none in ~/.config/mailnag/mailnag.cfg

atomGit commented 6 years ago

i'd like to reopen this - as of version 1.1.0: "The GNOME-Keyring dependency is optional now"

except is seems this not entirely true - if install a fresh copy of mailnag (v1.2.1.0) where there is no config file from a previous install, then mailnag-config will not start...

Mailnag.common.credentialstore.KeyringUnlockException: Failed to unlock default keyring

pulb commented 6 years ago

@atomGit: Is this happening in KDE? Please check if you have the gir1.2-gnomekeyring package installed.

atomGit commented 6 years ago

KDE, yes i installed the gir1.2-gnomekeyring package and this was the result (mailnag-config still won't start)...

$ mailnag-config
Traceback (most recent call last):
  File "/usr/bin/mailnag-config", line 61, in <module>
    if __name__ == "__main__":  main()
  File "/usr/bin/mailnag-config", line 44, in main
    confwin = ConfigWindow()
  File "/usr/lib/python2.7/dist-packages/Mailnag/configuration/configwindow.py", line 100, in __init__
    self._accountman = AccountManager(CredentialStore.from_string(self._cfg.get('core', 'credentialstore')))
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 75, in from_string
    cs = CredentialStore.get_default()
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 66, in get_default
    CredentialStore._instance = SupportedCredentialStores[_credentialstoretype]()
  File "/usr/lib/python2.7/dist-packages/Mailnag/common/credentialstore.py", line 96, in __init__
    raise KeyringUnlockException('Failed to unlock default keyring')
Mailnag.common.credentialstore.KeyringUnlockException: Failed to unlock default keyring

if this has anything to do with the KDE Wallet app, note that i don't use it, never have, never configured it and the subsystem is disabled, however i did start it and open the default wallet for testing (after installing the package you recommended) and the result was the same

pulb commented 6 years ago

If the gir1.2-gnomekeyring package is installed, mailnag tries to read passwords from GNOME-keyring. I'd suggest uninstalling this package or setting credentialstore = none in ~/.config/mailnag/mailnag.cfg

atomGit commented 6 years ago

installed or not, mailnag-config won't run - and there is no mailnag.cfg because it never ran

pulb commented 6 years ago

What's the error output in the terminal if you uninstall the keyring package?

atomGit commented 6 years ago

same as the first post

the package was never installed until you suggested it

pulb commented 6 years ago

GNOME-Keyring is definitely installed on your system, this error won't be raised otherwise. Do you have other GMOME-Keyring packages installed, like gnome-keyring?

pulb commented 6 years ago

...or libgnome-keyring?

atomGit commented 6 years ago

i have the default packages that shipped with mint 17.x ...

gnome-keyring libgnome-keyring-common ibgnome-keyring0

and several others

pulb commented 6 years ago

The most suspicious ones are those with gir in the name. You're using KDE - can't you simply uninstall all of them?

atomGit commented 6 years ago

where are you seeing packages that i listed with 'gir' in the name?

you mentioned the gir1.2-gnomekeyring package which wasn't (was NOT) installed - and mailnag didn't work - and so i installed it and it still didn't work - it has since been removed

pulb commented 6 years ago

You said "several others"...

Dude, gnome-keyring is installed (and misconfigured) on your system, so mailnag will use it. If you don't want that, either remove related packages or use an existing config file with the credentialstore set to None.

atomGit commented 6 years ago

You said "several others"...

none with 'gir' in them - once again, i have never used these keyring packages so the only packages installed are whatever ships with mint

Dude, gnome-keyring is installed (and misconfigured)

so software that ships with the OS that i never used is "misconfigured"? and how were you able to determine this? because mailnag won't run, or because you coded it poorly and are passing the buck? take a look at the console output again, because all i see are mailnag messages

the point of this ticket is that you state that "The GNOME-Keyring dependency is optional now" which i would argue is not accurate - if that were true, then why the hell is mailnag trying to use it before the user is ever presented with the option? ... dude?

pulb commented 6 years ago

Gnome-keyring is a gnome desktop component. The keyring is configured by Gnome and is usualy unlocked when the user logs in and starts a new Gnome session. I have no idea why gnome desktop components are installed in your KDE system and if they behave the same as in a Gnome session. But it's clearly not mailnags job to to integrate and configure those components in alien desktop environments.

Gnome-keyring IS an optional dependency - if it is missing mailnag will fall back to an unencrypted backend, if it is present mailnag will use it.

pulb commented 6 years ago

I googled this up for you: http://tuxrocket.com/2013/01/03/getting-gnome-keyring-to-work-under-kde-and-kdm/

Maybe you should file a bugreport in your distros bugtracker so this will be enabled by default.

alekksander commented 6 years ago

kde neon here and same problem – mailnag won't start

pulb commented 6 years ago

As a workaround please issue the following command in a terminal:

printf "[core]\ncredentialstore = none\n" > ~/.config/mailnag/mailnag.cfg

alekksander commented 6 years ago

No such file or directory :(

pulb commented 6 years ago

Sorry: mkdir -p ~/.config/mailnag printf "[core]\ncredentialstore = none\n" > ~/.config/mailnag/mailnag.cfg

alekksander commented 6 years ago

@pulb Thank You so much!

alekksander commented 6 years ago

should it show something in system tray? how to manually check mail, set time intervals, and so on? (lastes user edition kde neon)

pulb commented 6 years ago

@alekksander: you need a desktop-shell plugin for that. There are plugins for GNOME-Shell, Ubuntu Unity and Cinnamon, but I'm afraid nobody has created a plugin for KDE yet. If you can install Ubuntu's messaging menu in KDE you can try the MessagingMenu plugin though.

alekksander commented 6 years ago

Thank You.