flyte: [BUG] Keyring errors when intialising flyte remote client
Describe the bug
Get a keyring error when initialising a simple flyte remote client. It seems to only happen on some systems and the exact error varies slightly. I’ve seen
InitError: Failed to create the collection: Prompt dismissed..
KeyringLocked: Failed to unlock the collection!
Expected behavior
I’m not trying to use any authentication so I would expect it to ignore any exceptions about the system keyring. Alternatively we could add AuthType.NONE so that all keyvault related code can be avoided.
Additional context to reproduce
On my system I can reproduce with:
from flytekit.configuration import Config
from flytekit.remote import FlyteRemote
config = Config.for_sandbox()
remote = FlyteRemote(config=config)
remote.client
This is SSHing from one linux system to another linux system. Both are used with a Desktop setup so they probably have the GNOME keyring installed.
I tried using all the different Auth types but they all failed for one reason or another (this is largely expected because we do not have any authentication configured on our flyte deployment).
Full stack trace: stack_trace.txt
Screenshots
No response
Are you sure this issue hasn’t been raised already?
- Yes
Have you read the Code of Conduct?
- Yes
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15 (11 by maintainers)
We just rolled out flytekit 1.15 with this change and it seems to be working nicely. Thanks for fixing it 🙂
@Tom-Newton can you help me test this one? https://github.com/flyteorg/flytekit/pull/2962
hmmm I guess we always call upgrade_channel_to_authenticated which will always call get_authenticator which will always initialize the pkce authenticator if that’s the selected option.
can we delay this somehow please? can we make it so that only when there’s an error, do we create the authenticator? or something like that.
this is the weird part of the stack trace
if there’s no 401 received, we shouldn’t be trying to instantiate a
PKCEAuthenticatoror any other Authenticator. not sure what’s happening. the only weird part of the auth stuff is this line. maybe there’s another error happening? Technically we should only be checking fore.code() == grpc.StatusCode.UNAUTHENTICATED. But we addede.code() == grpc.StatusCode.UNKNOWNas a hack because some reverse-proxy setups + grpc versions?? were not returning the correct error.