r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

Error in with_lock cannot lock keyring file #124

Closed RosalynLP closed 2 years ago

RosalynLP commented 2 years ago

Hi,

I am having issues with a specific keyring. Whenever I try to do anything other than delete the keyring it comes up with an error

Error in with_lock(file_name, private$keyring_write_file(keyring, nonce = sodium::random(24L),  : 
  Cannot lock keyring file

If I remake the keyring I still get the same error. I can create other keyrings with different names, this is a problem specific to that keyring name.

I tried uninstalling and reinstalling the package but the keyrings from before still remained, along with the problem. Is there some way I can remove any additional files which might be blocking me from making a new keyring with this name and using it? I need to keep the same name so that it is compatible with other scripts I am running.

Thanks :)

Edit: I found the file I needed to delete in .config/r-keyrings

gaborcsardi commented 2 years ago

Is this Linux? Check the access rights of the keyring file, and the directory where the file is. E.g. if one of these are owned by root, and you are trying to use them as an ordinary user, that would explain the errors.

RosalynLP commented 2 years ago

Yes it's linux, sorry for not specifying! I think the error was due to a remaining .lck file in .config/r-keyrings, once deleted I was able to create a new keyring as normal. Thanks!