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

"Save password to keyring" option is disabled #545

Closed
harmancode opened this issue Feb 17, 2016 · 30 comments
Closed

"Save password to keyring" option is disabled #545

harmancode opened this issue Feb 17, 2016 · 30 comments
Milestone

Comments

@harmancode
Copy link

"Save password to keyring" option is disabled. What can be the reason?

Cache password option is enabled but I am asked to enter the password again on every backup.

I use debian 8.3. BackinTime 1.0.36-1. Seahorse 3.14.0 is installed.

@Germar
Copy link
Member

Germar commented Feb 17, 2016

Please make sure python-secretstorage or python-gnomekeyring is installed

@harmancode
Copy link
Author

python-secretstorage 2.1.1-1 and python-gnomekeyring 2.32.0+dfsg-3 are installed but it is still disabled.

@Germar
Copy link
Member

Germar commented Feb 19, 2016

Please post the output of python -c "import keyring; print keyring.get_keyring()"

@harmancode
Copy link
Author

$ python -c "import keyring; print keyring.get_keyring()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named keyring

@harmancode
Copy link
Author

I am not sure if it is related but it looks related, so I will mention about this just in case.

Now when I run BackinTime I get three consecutive error messages:

First:

Can't mount 'encfs --extpass=backintime-askpass /media/xxx/mountpoint':

Gtk-Message: Failed to load module "canberra-gtk-module"
WARNING: import keyring failed
Error decoding volume key, password incorrect

Second:

Can't find snapshots folder.
If it is on a removable drive please plug it and then press OK

Thirdly, I see the first message again.

Then snapshots of backup set are not loaded.

When I create a new profile with local folders, no encryption, I get only the first error message and process suddenly ends, dialogs disappear.

In my current main profile;

  • Local backup with encryption is selected.
  • Source files are located in an external drive, encrypted with dm-crypt but unlocked. Accessible.
  • Backup location is located in another external drive, not encrypted. I checked, drive is connected and backup folder is there, accessible by file manager.

@Germar
Copy link
Member

Germar commented Feb 19, 2016

Please install python-keyring and libcanberra-gtk-module. Than run backintime --pw-cache stop and try again.

@harmancode
Copy link
Author

Problem solved! Thank you very much. :)

@Germar Germar closed this as completed Feb 19, 2016
@simgunz
Copy link

simgunz commented Feb 25, 2016

I have the same problem on Manjaro linux KDE.

I've installed python2-secretstorage and python-secretstorage (python3)

The following command run fine for both python2 and python3:

python -c "import keyring; print keyring.get_keyring()"
  1. Is backinitme using python2 or python3?
  2. Does python-secretstorage replace python-keyring? Or we need both?

How is libcanberra-gtk-module related to the keyring? Is it needed in KDE?

In my case "Save password to keyring" is not greyed out, but I cannot check the checkbox when I click on it. I don't know if it's just an artifact of the theme I'm using tough, but it doesn't seem so.

@harmancode
Copy link
Author

Well, I keep getting the error messages mentioned by me above from time to time. backintime --pw-cache stop command solves this error after a BIT restart, however this workaround is not a solution, because despite I have set my backup schedule as "every 6 hour", I don't see backups from last 2 days.

I got those errors 15 minutes ago and I used that command again, then I changed my backup schedule as "every 5 minutes", then I closed BIT. Now I check and see that BIT took backup according to new schedule.

My conclusion: BIT does not apply schedule when this problem (about pw-cache) occurs in background.

Update: BIT took only 1 backup in 25 minutes. I run that command again. Now if it will take another backup in a few minutes, I think it means BIT only takes 1 backup after that command, then stops and does not apply the backup schedule anymore.

Update 2: No, BIT did not take another backup despite I run that command. Strange.

Update 3: I have compiled and updated to v1.1.12. We will see if the problem persists in this latest version.

@Germar
Copy link
Member

Germar commented Feb 25, 2016

@simgunz:

  1. BIT version < 1.1.0 uses Python2. BIT version >= 1.1.0 uses Python3
  2. python-secretstorage is a backend for python-keyring. It supports both Gnome-Keyring (aka Seahorse) and KDE Kwallet. You need both python-secretstorage and python-keyring in your case for Python3
  3. libcanberra-gtk-module is an dependency of backintime-gnome in BIT < 1.1.0. You don't need it.
  4. If it's not grayed out it should work. Please run backintime-qt4 --debug from command line and watch out for 'Warning: import keyring failed', Debug: No keyring due to import errror, Debug: Found appropriate keyring or Debug: No appropriate keyring found messages

@DX486 the schedule every 6 hour starts BIT on 0:00, 6:00, 12:00 and 18:00. If your machine wasn't turned on at that time it will never run. You could use schedule Repeatedly (anacron) with 6h frequency to start BIT every 6 hours when your machine is turned on.

@simgunz
Copy link

simgunz commented Feb 26, 2016

If I run backintime-qt4 --debug I get the following:

DEBUG: [common/tools.py:611 keyring_supported] Found appropriate keyring 'keyring.backends.kwallet' DEBUG: [common/sshtools.py:192 SSH.unlock_ssh_agent] Add private key /home/simone/.ssh/backup_id_rsa to ssh agent DEBUG: [common/sshtools.py:197 SSH.unlock_ssh_agent] Password available: True

and right afterwards a dialog appears asking me the password for SSH (every time).

The backend seems to be present, still the checkbox is not clickable. Also if I position the cursor on the field "SSH private key" and I hit tab the next field focused is "Cache Password for Cron...".

It seems that the field "Save password to keyring" is somehow disabled or ignored.

@Germar
Copy link
Member

Germar commented Feb 26, 2016

@simgunz could you please manually remove the password from Kwallet, stop pw-cache with backintime pw-cache stop and try again to add it in Settings? I guess the password in Kwallet is wrong.

@simgunz
Copy link

simgunz commented Feb 27, 2016

I can't even find it in KWallet. Under which name/category should the password be stored?

@simgunz
Copy link

simgunz commented Feb 27, 2016

I've also tried to create a new SSH profile, and also in that case the checkbox cannot be checked.

@Germar
Copy link
Member

Germar commented Feb 28, 2016

@simgunz I'll make myself a Manjaro VM and test it. Sounds like a bigger problem.

@Germar Germar reopened this Feb 28, 2016
@Germar Germar added bug and removed question labels Feb 28, 2016
@simgunz
Copy link

simgunz commented Feb 28, 2016

Thanks to look into this.

@phlinx
Copy link

phlinx commented Feb 28, 2016

Hi. Just wanted to add that the Problem appears in plain archlinux as well (Using latest KF5/Plasma5). My SSH Key is in the ssh-agent, connecting to the server from the terminal works like expected, no password for the key needed. Starting backintime-qt4 --debug in the same terminal gives me the above output (with password available: true).

@harmancode
Copy link
Author

Just a note: I don't have any problem since I've upgraded BIT to v1.1.12 (on debian 8.3 stable).

@simgunz
Copy link

simgunz commented Feb 29, 2016

I'm actually running v1.1.12

@Germar
Copy link
Member

Germar commented Mar 1, 2016

Okay, there was a logic error with the Found appropriate keyring ... debug message. But the real problem is python-keyring and KWallet both changed and python-keyring has a bug with connecting to KWallet. I filled a bug report on Arch for python-keyring.

@Germar Germar added this to the 1.1.14 milestone Mar 1, 2016
@simgunz
Copy link

simgunz commented Mar 1, 2016

I'm glad you've already found the problem! Thanks

@phlinx
Copy link

phlinx commented Mar 2, 2016

I can confirm that the patch works. I also mentioned it in the according bug in the python-keyring bugtracker: jaraco/keyring#168

@simgunz
Copy link

simgunz commented Mar 25, 2016

The problem seems to be solved now, using python-keyring 8.5.1

@Germar Germar added question and removed bug labels Mar 25, 2016
@Germar
Copy link
Member

Germar commented Mar 25, 2016

Thanks for the feedback. I'll close this bug as it was no bug in BIT.

@Germar Germar closed this as completed Mar 25, 2016
@simgunz
Copy link

simgunz commented Jun 23, 2016

I need to ask your support again on this issue, because it's happening again.

The debug output I'm getting is the same as above, and the checkbox is disabled so that I cannot save the SSH password.

I'm using backintime 1.1.12 and python-keyring 9.0

DEBUG: [common/tools.py:611 keyring_supported] Found appropriate keyring 'keyring.backends.kwallet'
DEBUG: [common/mount.py:50 Mount.__init__] pw-cache is not running
DEBUG: [common/mount.py:59 Mount.__init__] Call command: /usr/bin/backintime pw-cache start
DEBUG: [common/sshtools.py:192 SSH.unlock_ssh_agent] Add private key /home/simone/.ssh/backup_id_rsa to ssh agent
DEBUG: [common/sshtools.py:197 SSH.unlock_ssh_agent] Password available: True
ERROR: [common/sshtools.py:229 SSH.unlock_ssh_agent] Failed to unlock SSH private key /home/simone/.ssh/backup_id_rsa: 
DEBUG: [common/sshtools.py:239 SSH.unlock_ssh_agent] Was not able to unlock private key /home/simone/.ssh/backup_id_rsa

@Germar
Copy link
Member

Germar commented Jun 23, 2016

I backported the patch for 1.1.12 and asked the package maintainer for the AUR package to include it. Should be fixed soon...

@graysky2
Copy link
Contributor

I backported the patch for 1.1.12 and asked the package maintainer for the AUR package to include it. Should be fixed soon...

Updated in backintime 1.1.12-4

@simgunz
Copy link

simgunz commented Jun 24, 2016

Ok. Sorry, I reported it again because I remember it was already fixed on my system, so I thought it broke again. While the patch was not yet there, so maybe I remember wrong.

In any case I've tested the AUR package today, and it works correctly.

Thanks again

@Germar
Copy link
Member

Germar commented Jun 24, 2016

No worries, mate

@Azimoth
Copy link

Azimoth commented Apr 29, 2019

I'm having this issue using version 1.2.0~alpha0 on Gentoo.
The thing is: It WAS working until I installed something else that required PyQt5.

Then backintime stopped working properly by complaining about being unable to access the password, so I removed it manually from kwallet, expecting to be asked for it again.
Then the GUI didn't come up anymore, which I could fix by installing xdpyinfo.

Now Backintime is working again, but the "Save password to keyring" option is disabled.

I also tried re-installing Backintime (also removing ~/.config/backintime and ~/.local/share/backintime), but it still doesn't work.

backintime --debug

doesn't show anything that seems to be out of the ordinary...

$ python -c "import keyring; print(keyring.get_keyring())"
keyring.backends.chainer.ChainerBackend (priority: 10)
$ backintime --pw-cache stop
INFO: Run command 'pw-cache' instead of argument '--pw-cache' due to backwards compatibility.

Back In Time
Version: 1.2.0~alpha0

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

WARNING: Failed to read PID and process name from /home/user/.local/share/backintime/password_cache/PID: [2] No such file or directory
ERROR: pidfile /home/user/.local/share/backintime/password_cache/PID does not exist. Daemon not running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants