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

New Keyring not creating in Ubuntu headless renv #148

Open anemiroffsumer opened 9 months ago

anemiroffsumer commented 9 months ago

Distributor ID: Ubuntu (HEADLESS) Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

We are running R in non sudo mode as a user. When trying to create a keyring:

sudo keyring::keyring_create(keyring = "example")

We get:

Error: unexpected symbol in "sudo keyring"

keyring::keyring_create(keyring = "dbsumeR_keyring") Password:
OK Error in b_ss_keyring_create_direct(self, private, keyring, password) : Secret service keyring error in 'create_keyring': 'No such secret collection at path: /' In addition: Warning message: In b_ss_keyring_create_direct(self, private, keyring, password) : Password ignored, will be read interactively

sudo keyring::keyring_create(keyring = "dbsumeR_keyring") Error: unexpected symbol in "sudo keyring" keyring::keyring_create(keyring = "dbsumeR_keyring") Password:
OK Error in b_ss_keyring_create_direct(self, private, keyring, password) : Secret service keyring error in 'create_keyring': 'No such secret collection at path: /' In addition: Warning message: In b_ss_keyring_create_direct(self, private, keyring, password) : Password ignored, will be read interactively

When running R in Sudo mode

We are able to successfully create a Keyring and a OK status returns.

How can we allow keyring creation in user mode within R ?

gaborcsardi commented 9 months ago
sudo keyring::keyring_create(keyring = "example")

That is not valid R syntax, so I am not sure how this can be successful. You are clearly getting an error.

anemiroffsumer commented 9 months ago

Ignore the Sudo part. I did not mean to add that syntax in. I realize thats invalid.

keyring::keyring_create(keyring = "dbsumeR_keyring") Password:
OKb Error in b_ss_keyring_create_direct(self, private, keyring, password) : Secret service keyring error in 'create_keyring': 'No such secret collection at path: /' In addition: Warning message: In b_ss_keyring_create_direct(self, private, keyring, password) : Password ignored, will be read interactively

That is the error message in a non sudo version of R

gaborcsardi commented 9 months ago

Can you include a stack trace? I.e. the output of traceback() right after error happens?

anemiroffsumer commented 9 months ago

Of course

anemiroffsumer commented 9 months ago

Hi, is this what you want?

keyring::keyring_create(keyring = "dbsumeR_keyring") Password:
OK Error in b_ss_keyring_create_direct(self, private, keyring, password) : Secret service keyring error in 'create_keyring': 'No such secret collection at path: /' In addition: Warning message: In b_ss_keyring_create_direct(self, private, keyring, password) : Password ignored, will be read interactively

traceback() 5: b_ss_keyring_create_direct(self, private, keyring, password) 4: private$keyring_create_direct(keyring, password) 3: b_ss_keyring_create(self, private, keyring, password) 2: default_backend()$keyring_create(keyring, password) 1: keyring::keyring_create(keyring = "dbsumeR_keyring")

gaborcsardi commented 8 months ago

Maybe this is a permission issue, and your regular user does not have access to some files it needs to have access to?