Open rcpeene opened 1 week ago
@jwodder - do you have any suggestions for @rcpeene ? or what to delete to rest the keyring?
@rcpeene Could you show the (non-exception) output from the script when run, particularly the part that asks you for a password etc.?
Even when providing my dandi api key, I get a prompt to enter a keyring password.
How are you providing the API key?
@rcpeene, I have run into this myself, and because I don't really use my system keyring, I end up doing something like:
$ export DANDI_API_KEY=<paste in API key here>
and then the CLI will no longer prompt for passwords etc. Just be careful about who can see your screen etc., as you want to protect that key from unauthorized use by others.
jwodder may have a more comprehensive solution but exporting your key to your shell should get you unstuck.
@jwodder I apologize, I left this out of the snippet
client = dandiapi.DandiAPIClient(token=dandi_api_key)
dandiset = client.get_dandiset(dandiset_id)
Here is the keyring prompt:
@rcpeene The download()
function uses its own client instance, so doing client = dandiapi.DandiAPIClient(token=dandi_api_key)
has no effect on it. As @waxlamp said, setting the API key via an environment variable may be the simplest way to pass it to download()
.
It seems you previously stored your API key in an encrypted keyring file on the system. You can remove this keyfile and start over by deleting ~/.local/share/python_keyring/crypted_pass.cfg
. See the handbook for more information on how dandi uses keyrings.
This makes sense. On my local machine I already have the DANDI_API_KEY defined which is probably why I didn't have the problem.
I still don't understand why entering my dandi api key into the keyring prompt returns 'incorrect password' though
I still don't understand why entering my dandi api key into the keyring prompt returns 'incorrect password' though
If you mean the "Please enter password for encrypted keyring" prompt, that's because it's not asking you for your API key. Encrypted keyfiles are well, encrypted, and that encryption involves a user-defined password that would have been set when you first created the keyfile, so now it's asking you for the password used to encrypt the keyfile so it can decrypt the file and retrieve the API key stored within.
I am running a notebook on dandihub and trying to download an embargoed file that I have access to. Even when providing my dandi api key, I get a prompt to enter a keyring password. I don't know where to find such a password. I don't have this error when running locally or Google collab, just Dandihub.
And the error (After entering an empty password to the keyring prompt):