Skip to content
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

Error Using near login with NEAR CLI: Failed to Save Access Key to Keychain on WSL Linux Environment #435

Open
Amira1502 opened this issue Jan 10, 2025 · 1 comment
Assignees

Comments

@Amira1502
Copy link

Description:

I encountered an issue while trying to use near login to deploy a Rust contract for the NEAR auction tutorial on a Linux environment (running in Windows, WSL). The CLI fails to save the access key to the keychain due to a missing org.freedesktop.secrets service.

Steps to Reproduce:

  1. Run the command:
    near login
  2. Follow the provided URL to authenticate via the browser.
  3. Return to the CLI and enter the account ID as prompted.
  4. Select the option to save the access key in the keychain.
  5. Encounter the following error:

Error Message:

Failed to open a temporary file to store a cli command
Error:
   0: Failed to save the access key <ed25519:...> to the keychain
   1: Failed to save password to keychain. You may need to install the secure keychain package by following this instruction: https://github.com/jaraco/keyring#using-keyring-on-headless-linux-systems
   2: Platform secure storage failure: DBus error: The name org.freedesktop.secrets was not provided by any .service files
   3: DBus error: The name org.freedesktop.secrets was not provided by any .service files
   4: The name org.freedesktop.secrets was not provided by any .service files

Location:
   src/common.rs:1349

Expected Behavior:

The CLI should successfully save the access key to the selected keychain without errors.

Actual Behavior:

The CLI fails to save the access key, indicating a missing org.freedesktop.secrets service.
image

Environment:

  • NEAR CLI version: near-cli-rs 0.17.0
  • Operating System: windows 11
@gagdiez
Copy link
Contributor

gagdiez commented Jan 10, 2025

tldr; when login in a system that does not support keychains the user gets an error if they choose to save the keys into the keychain (which is always the first option)

we could:

  • either not show keychains if the system does not support them
  • either default to legacy-keychain if saving into the keychain raises an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

No branches or pull requests

3 participants