solokeys / solo2-cli

Solo 2 library and CLI in Rust
https://docs.rs/solo2
Apache License 2.0
170 stars 31 forks source link

solo2.exe - The smart card cannot be accessed because of other connections outstanding #46

Closed colemickens closed 2 years ago

colemickens commented 2 years ago

Hi!

I updated my Solo2 and tried just a basic solo2.exe ls:

PS C:\Users\colem> solo2
solo2 0.1.1
SoloKeys Developers
solo2 is the go-to tool to interact with a Solo 2 security key

USAGE:
    solo2.exe [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

TRANSPORT:
        --ctap    Prefer CTAP transport
        --pcsc    Prefer PCSC transport

SELECTION:
    -u, --uuid <UUID>    Specify UUID of a Solo 2 device

SUBCOMMANDS:
    app           Interact with on-device applications
    bootloader    Interact with bootloader
    help          Print this message or the help of the given subcommand(s)
    list          List all available devices [aliases: ls]
    pki           PKI-related
    update        Update to latest firmware published by SoloKeys. Warns on Major updates

PS C:\Users\colem> solo2 ls
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: The smart card cannot be accessed because of other connections outstanding', src\device\pcsc.rs:98:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
colemickens commented 2 years ago

Aha, I had a suspicion, I removed my daily-driver Yubikey and then the error goes away.

pbl987 commented 2 years ago

I have the same issue, but i don't even have a Yubikey. Win 20H2.

PS C:\Users\patrick\Downloads> .\solo2-v0.1.1-x86_64-pc-windows-msvc.exe list thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: The smart card has been removed, so further communication is not possible', src\device\pcsc.rs:98:50 note: run withRUST_BACKTRACE=1environment variable to display a backtrace

nickray commented 2 years ago

If there's some other process using PCSC (or I guess, trying to), then this would be expected (should handle the failure more gracefully of course). PR https://github.com/solokeys/solo2-cli/pull/60 (merged but unreleased) helps with a related case issue where one has a "real" smartcard reader attached (but in this case would probably just filter out the device you're actually trying to use).

I'm not sure how to find out on Windows what if anything else is trying to use the PCSC interface on the Solo 2.

nickray commented 2 years ago

I believe this is fixed with the release of https://github.com/solokeys/solo2-cli/releases/tag/v0.2.0.