-
Notifications
You must be signed in to change notification settings - Fork 216
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
Using KDE Wallet works at 2nd attempt only ("Save SSH key password" disabled) #1321
Comments
THX for your detailled description! Could you please append a screen shot of the settings dialog with the greyed-out "Save password to Keyring" checkbox (= 1st-time opening of the settings dialog). PLEASE ANONYMIZE HOST-ADRESS (UNLESS IT SHOWS LOCALHOST ;-) I need this to try to reproduce the behaviour in virtual machine... |
There is only and exactly one line of code where the checkbox "Save password to Keyring" is enabled and disabled: When backintime/qt/settingsdialog.py Line 262 in bcf4b90
The DEBUG output with the "keyringSupported" status is called from several code locations during the GUI startup (in this order):
According to the DEBUG log only the first call returned I need to set up a VM for this (sorry, this may take some time due to higher prioritization of other issues ATM)... |
@petaramesh Perfect, THX a lot (esp. for the complete DEBUG log with the code line numbers)! |
If I immediately close the config dialog (cancel) and open it again, this time the “save passphrase” box appears both available and already checked, and the debug list shows only one « DEBUG: [common/tools.py:827 keyringSupported] Found appropriate keyring 'keyring.backends.kwallet' » line. Note that in the meantime, a cronned snapshot has run successfully without prompting for a passphrase... |
Which OS distro and version are you using (allows me to pick other issues for the same version to be debugged in the same VM)? Which python version is used? |
I'm using here a Manjaro (Arch based) ARM “aarch64” on a Pinebook Pro (Rockchip RK3399 ARM SOC). So that's no x86 architecture, you may have hard times getting the exact same setup in Virtualbox, but an x86_64 Manjaro should be close enough ;) Or you may have a Raspberry Pi 4 somewhere ? Python is 3.10.7. All Manjaro packages are most recent and up-to-date. BTW I compiled Backintime on my machine from Arch's AUR, and during build, the “make tests” systematically failed, so I had to remove the “make tests” phase from the build process, in order to get a Backintime package - that actually works fine except for the bugs that I reported. About the tests that failed, some seemed to be timeouts that may be related to the fact that this ARM machine is relatively slow, some other failed tests seemed to be rsync, which I now possibly relate to the rsync version issue. Thanks for all your kind help. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
#1308 also mentions a keyring DEBUG output:
|
Related to
See also:
|
OK, I think
Why it works when the "open settings dialog" is opened again (2nd time) I don't understand yet... Anyhow there could be a work-around with a config file to specify the used backend as default:
For a sustainable solution I'd like to implement what @jaraco proposed here: @petaramesh Could you please try to create such a config file and report here if it helped? Edit: Your default backend
|
Hello, Thanks for all the help. Actually, after I had read other bug reports and forum entries, and before reporting this one, I had already created : ❯ cat .config/python_keyring/keyringrc.cfg Without this, it wouldn't work at all With this, it exhibits this strange “works on 2nd attempt” behaviour. BTW the “2nd attempt” thing concerns only the configuration dialog, besides this, i.e. cronned backups seem to work just fine. As per : For the record, my wife has an x86 Deepin 20.7 Linux machine (so a rather different distro, more or less debian-based, with DDE which is a QT-based GUI) with Backintime 1.1.24, python 3.7.3 and python 2.7.16. On this machine, I also can save the SSH passphrase only if I create the exact same .config/python_keyring/keyringrc.cfg, but on this machine it doesn't show the strange “works only the 2nd time” issue. As per you suggestion of creating a “choose secret management” dialog, Sirikali (Disk encryption GUI that supports cryptsetup, gocryptfs, ecryptfs, cryfs and more) has this exact feature ; you might like to take a peek at its code ? Kind regards. |
I already forgot that you have put this info into your issue description 😄 THX, Sirikali is a great reference (just looking into the CPP code there not only for the GUI but also for the implementation)... I am currently preparing a PR with more DEBUG output in the BiT keyring detection function to get more info what is going on in the background since I still cannot reproduce the issue despite it is obviously there (perhaps a DBus issue on slow computers)... |
Well, I don't have a feeling it's a matter of speed, the behaviour is perfectly reproductible even when the computer is basically doing nothig and there's plenty of RAM available. It's this triple, contradictory message that puzzles me : DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.kwallet' can't be used with BackInTime As it first always says that 'keyring.backends.kwallet' can't be used with BackIntime, and just afterwards that it's appropriate... Of course I wish to help, so if you throw some code I could test I believe I will figure out how to compile it using existing AUR's PKGBUILD... (Although I will have very litle availability from this evening until tuesday, at best). BTW, on my wife's Deepin machine that doesn't have the issue, I get : And when opening the config dialog for the first time, I get 3 DEBUG outputs that read : So you see that I get 3 successes instead of 1 failure then 2 successes on my machine ; also the code line numbers are different so I assume the versions are different (Backintime 1.1.24, python 3.7.3 and python 2.7.16 on my wife's machine) Both machines agree on using 'keyring.backends.kwallet' anyway. On my machine, the question seems to be « Why is line 829 unhappy and line 827 happy ? » ;-) |
Perfect summary :-) And luckily I can reproduce this behavior now on one machine. It looks like that for some
THX for your offer to test this! There is no need to repackage BiT, I have prepared a standalone python script to test this: Please download the file and rename it to Then run the code with: In my case the debug output clearly shows the same behavior (excerpt):
One difference on this machine is that I am using OT: In fact Possible fixesPlease edit the py file and uncomment the line 33 ( The available keyring backends should then be recognized already in the first call (as on my machine):
BTW: If I use keyring version 18.0.1 it also works immediately (without any fix) so I think it is a |
Hi, Your test script crashes on me with : ❯ python3 keyringCheck.py During handling of the above exception, another exception occurred: Traceback (most recent call last): I tried to comment out the SecretService lines to check for other keyring backends, but it crashes on every one it tries, in turn. |
Sorry, my bad, the logger module source code of BiT was still used.
|
Looks bettter now, that's whhat I get : First run : ❯ python3 keyringCheck.py Second run after uncommenting line # 33 ❯ python3 keyringCheck.py |
THX a lot, this reproduces the behavior on your computer The fix should be a one-liner and you could edit the original code file from the package manager: You need to find and edit the file
|
Hi, Many thanks for all your great help ! |
Happy to hear that it works now 😃 Couldn't have done it without your precise descriptions and support! I will prepare a bug fix PR for the next BiT version and perhaps a patch file for package maintainers who want to back-port this fix (since it is so easy). Have nice weekend! |
Nice week-end to you too, many thx again ! |
Internal notes for a fixReason for the bugAssuming the keyring backend configuration is correct (existing default backend) See: TODO Add link to issue/code change at Helpful diagnosticsTerminal commands:
Planned fixI will just move the Lines 840 to 858 in 7145a11
so that I don't have to call Just moving code has no impact on the used (and assumed) API. I will also add more Alternatives to fix
This requires Next steps
(ALL DONE): Open TODOs and questions
|
Fix #1321: Settings GUI: "Save password to Keyring" was disabled
Here comes a patch with only the minimal changes required as HOTFIX and possible BACKPORT to v1.2.1. The issue itself is fixed in the USE THE PATCH AT YOUR OWN RISK (NOT DEEPLY TESTED)! To apply the fix on the cloned git version use the attached patch file in the root folder of the git repo:
Note: This patch can also be applied to version 1.2.1 which is the version packaged for Ubuntu 20.04 (the current Git version as of today is 1.3.2). You just have to patch or manually modify the installed file of the packaged version of BiT (for Ubuntu: in patch_issue_1321_hotfix.diff.txt BTW: The patch file has the suffix *.txt to be able to upload it here at Github into the comment... |
Hello,
I use Backintime Version: 1.3.2 with KDE plasma.
At first the “Save SSH key password” box was greyed out, and I found here the suggestion to create a :
~/.config/python_keyring/keyringrc.cfg containing :
[backend]
default-keyring=keyring.backends.kwallet.DBusKeyring
But now it works rather wierdly. The 1st time I open the configuration dialog, Backintime debug prints :
DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.kwallet' can't be used with BackInTime
DEBUG: [common/tools.py:827 keyringSupported] Found appropriate keyring 'keyring.backends.kwallet'
DEBUG: [common/tools.py:827 keyringSupported] Found appropriate keyring 'keyring.backends.kwallet'
...But the “save password” checkbox stays greyed out.
Now if I exit the configuration dialog and open it again, Backintime debug prints :
DEBUG: [common/tools.py:827 keyringSupported] Found appropriate keyring 'keyring.backends.kwallet'
(Only once)
...And now I get the proper “save password” checkbox, and it works.
Looks like a bug to me.
The text was updated successfully, but these errors were encountered: