-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to handle Ambiguous
?
#201
Comments
Ambiguous
?Ambiguous
?
Ambiguous
?Ambiguous
?
Hi @ReactorScram, thanks much for reporting this, because I've always wondered whether anyone has ever actually gotten an
Hearing that it is only your dev machine that is exhibiting this problem does not surprise me. Here's my suggestion on how to proceed if you want to use only the keyring to debug and fix the situation:
Alternatively, and possibly preferentially, I would suggest that you use a UI-based secret service client (typically this is included in your system settings UI) to find the ambiguous credentials and look at their attributes. My guess above may be correct, but it may also be the case that they are both v2/v3 credentials and they are sitting in different collections (one of which used to be the default but then had its collection file renamed to something other than "login"). If that's the case, you will probably have to use the UI tool to fix the issue; the keyring's cross-platform interface doesn't have the juice to deal with platform-specific issues like this (or, frankly, with ambiguity arising from the use of credential managers with other attribute conventions). Please let me know if this helps, and what you find! As I said at the beginning, I really want to know! |
Okay! So I've run into a couple strange things already:
![]() |
Wow! Great detective work! You've already found at least one bug... in the CLI! :) Looking at these lines:
I can see that the CLI is not letting you replicate the API call that firezone is making: notice the additional Since firezone is using a target, keyring will be creating a secret-service collection named for the target and storing the credential there. I don't have any experience either with the KWallet or the KDEWalletManager, so I'm not exactly sure how one can use the manager UI to see non-default collections created by the secret service. Looking at this page on the ArchWiki, it seems like looking at the Please let me know what you find out; I really appreciate you digging into this! |
I removed that entire if-statement but now I'm just getting the same output as Firezone:
I'm not sure how it's an Also I somehow got KWallet and
But I only see one secret there. |
Using the target as the search attribute is not reliable for finding the duplicate credential, because the duplicate probably doesn't have a target attribute. Try searching against an attribute that you know is identical (and non-empty) between the two, such as the
Wow! Another bug you've found!! The CLI should be down-casting the Any to the correct platform-specific credential type so that it can be debug-printed (which would also provide clients an example of how to do that)! I will fix that right now also! |
Okay now I'm seeing this from
And noticing a couple more oddities:
|
Hmmmm. Two credentials that have explicit target attributes should not be seen as ambiguous. Yes, keyring does its initial search for credentials by using just the
I'm fascinated to hear what you find! Thanks again for pushing on this! |
I tried those commands and it's just returning the same two secrets. I don't see any obvious bugs in the Very strange. |
OK, we obviously need the CLI to tell us what it's finding, in detail. I'm working on that, stay tuned. |
As reported in hwchen#201, the existing debug print of credentials gives no information about the underlying platform credential. This fixes that.
As reported in hwchen#201, the existing debug print of credentials gives no information about the underlying platform credential. This fixes that.
As reported in hwchen#201, the existing debug print of credentials gives no information about the underlying platform credential. This fixes that.
OK, please upgrade to v3.1.0 and try the CLI again to see which credentials it thinks are ambiguous. I'm very interested! I'm going to leave this question open until we figure out what's going on with your dev machine. |
Huh, well it's not saying ambiguous anymore.
I checked out the Does |
I believe your dev VM just fixed itself overnight. Did you log out or reboot or take an update or do anything else that might have caused the secret service to be restarted? Given what you reported yesterday about it sometimes showing you labels and sometimes not, I suspect there may have been cached data that was corrupt and coming back as partial results, and that's why you were getting the I'm going to close this issue. While I'm happy things are working for you, I'm kind of bummed we didn't get to try out the shiny new diagnostics it caused me to build :). Ah, well, I'll have to be satisfied with my manufactured tests... Thanks again for reporting this and working it with me. It's a delight for me to have the opportunity for a give and take with a client dev! It's exactly the kind of thing open source makes possible and "my real job" never did! |
I think I did reboot it, the UTM VMs hang for no reason every now and then, I think it hanged yesterday. It shows an uptime of 1 day, 1:45 which I guess means 1h45m, so I must have rebooted it yesterday before my last comment where Yeah, on the Firezone issue I'll chalk it up to "My VM is bad please re-open if this happens to anyone else" |
okay well the new I'll come back to this |
So sorry about the failure to publish 3.1 to crates.io: that's now fixed. On the Windows side, I took a dependabot-suggested update to the latest Microsoft-supported windows crate as part of 3.1. Let me know if that introduces some conflict; I am willing to roll it back. |
By the way, if you can get 3.1 working on your dev machine, I would love to see the error output from 3.1 (which will show us the credential details). |
Yeah 3.1 does work standalone. Output of (Pretty-printed by hand, secrets didn't appear to be included)
Here they are in sorted order:
So how are they ambiguous if the target actually does vary? |
OK, now we are getting somewhere!
Here's my current thinking about what's going on:
|
OK, with a bunch more research, I think I know exactly what's happening on your dev machine. Please see the comments on #204 for a reproduced example. I am thinking about the right way to handle this problem. |
From firezone/firezone#6175
I got into a weird situation, my dev VM is returning the
Ambiguous
error for bothget_password
andset_password
on the current 3.x version.This doesn't happen when I use the same code on my test VM, so I believe it's a problem with my secret service state in the dev VM, not with my code.
But I'm not sure how I would fix this if it happened on a production system. If
delete_credential
can also returnAmbiguous
, does that mean there is no way to repair this incorrect state using onlykeyring-rs
itself? (aside from some workaround like picking a new key name and saving it to disk)I'm also not sure how I got into this state. I don't run many programs on the dev VM, though I have run multiple builds of the Firezone Client, including builds with the old 2.x
keyring-rs
library.So I am hesitant to fix the VM without knowing how to replicate or even fix the issue.
Thoughts?
The text was updated successfully, but these errors were encountered: