Credentials are lost

Asked by Massimiliano Arione on 2017-10-21

I'm using gmail with 2FA. So, I generated an app password and put it inside Unity mail.
Unfortunately, as soon as I logged out and re-logged in, the credentials were lost.
I already generated app passwords three times, and each time Unity mail seems to work, but next time the configuration windows pops up without credentials.

(Unity Mail 1.7.6 on Ubuntu 16.0.4.3)

Question information

Language:
English Edit question
Status:
Answered
For:
Unity Mail Edit question
Assignee:
No assignee Edit question
Last query:
2017-10-22
Last reply:
2017-10-22
Robert Tari (robert-tari) said : #1

That is curious, I am also using 2-Step Verification and the password persists. In fact, Unity Mail does not care how you authenticate: when you provide the password, it asks the Keyring to store it for you.

It you did it like this all should be fine:
https://answers.launchpad.net/unity-mail/+question/651020

From your symptoms I'd say it is either something on the Google side, or your Keyring is damaged. You can check what password is stored for Unity Mail using Seahorse.

Massimiliano Arione (garakkio) said : #2

I had to remove seahorse because it was keeping asking me a passphrase to use my ssh keys

Robert Tari (robert-tari) said : #3

This is not related to Unity Mail, then. You should fix your keyring+seahorse and once it's done, all applications using the keyring will work properly.

Sorry I can't help you more, but this is a different software issue...

Massimiliano Arione (garakkio) said : #4

So, if I understand correctly: your package is depending on another package, but it's not explicitly requiring it (I removed seahorse and Ubuntu didn't remove UnityMail).
If so, I think that the issue is with *this* software

Robert Tari (robert-tari) said : #5

Unity Mail does not require Seahorse, all dependencies are explicitly listed in the Debian control file. It uses python3-secretstorage to communicate with the keyring. If the keyring is "healthy", and you have proper read/write access, your account data will be saved. I suggested Seahorse because it is preinstalled and easy to use, but you can choose any other application or method to inspect/fix the state of your keyring.

Massimiliano Arione (garakkio) said : #6

My current situation: I cannot edit options anymore. If I click on "edit account", nothing happens.
Is there a way to run the program in the terminal or to see a log?

Robert Tari (robert-tari) said : #7

You can do this:

1. killall unity-mail
2. unity-mail-reset
3. unity-mail

Running it like this will tell you if it fails to unlock the keyring.

Massimiliano Arione (garakkio) said : #8

1. A "ps" shows no process named "unity-mail"
2. got errors reported below
3. got error reported below

Error on step 3:
Unity Mail: CRITICAL: The name org.freedesktop.secrets was not provided by any .service files

Errors on step 2:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.secrets': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/secretstorage/util.py", line 52, in bus_get_object
    return bus.get_object(name, object_path, introspect=False)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/unity-mail-reset", line 14, in <module>
    oCollection = secretstorage.get_default_collection(oBus)
  File "/usr/lib/python3/dist-packages/secretstorage/collection.py", line 155, in get_default_collection
    return Collection(bus)
  File "/usr/lib/python3/dist-packages/secretstorage/collection.py", line 34, in __init__
    collection_obj = bus_get_object(bus, SECRETS, collection_path)
  File "/usr/lib/python3/dist-packages/secretstorage/util.py", line 56, in bus_get_object
    raise SecretServiceNotAvailableException(e.get_dbus_message())
secretstorage.exceptions.SecretServiceNotAvailableException: The name org.freedesktop.secrets was not provided by any .service files

Robert Tari (robert-tari) said : #9

Ignore all the errors from step 2, unity-mail-reset is just a small helper script, there is no error handling in there. The important thing is the message from Unity Mail: it basically says that you have no keyring!

The keyring (most notably the gnome-keyring package) is an integral part of Ubuntu, is it possible that your system is somehow running without it?

Look, I'm not an Ubuntu expert, but I'm using it since 2005 and if there's one thing I learned, is that requirements need to be explicit.
In this case, it's clear that seahorse is not a requirement to run Ubuntu (I removed it without consequences on my system) but it's a requirement for UnityMail.
So, you should: A) explicit such requirement, or B) make UnityMail working without seahorse (like many other programs that store password do)
I vote for B.

Robert Tari (robert-tari) said : #11

As I may have said earlier, Seahorse is not a dependency, you do not need it to run Unity Mail.

I am closing this question, your problem has been identified: your system is missing the keyring - that is why you cannot use the secret storage. This affects, but is not limited to Unity Mail - any application will fail to work that relies on storing sensitive user data in this manner.

Can you help with this problem?

Provide an answer of your own, or ask Massimiliano Arione for more information if necessary.

To post a message you must log in.