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

Failed to establish context: Service not available. (0x8010001D) #5

Open
Sjors opened this issue Dec 22, 2023 · 0 comments
Open

Failed to establish context: Service not available. (0x8010001D) #5

Sjors opened this issue Dec 22, 2023 · 0 comments

Comments

@Sjors
Copy link

Sjors commented Dec 22, 2023

I got a Bolt Card at last years Bitcoin Amsterdam conference. I'm trying read from it (and then hopefully write to it) with a ACR122U-A9 NFC reader connected to my Ubuntu 23.10 machine.

Python version 3.12.1, libpcsclite-dev 2.0.0 and swig 4.1.0 are installed.

I then installed v0.2.0 via pip install boltlib.

When I put the card on the reader it beeps and the light goes from red to green.

But boltcard read fails with a cryptic error:

Traceback (most recent call last):
  File "/home/sjors/.pyenv/versions/3.12.1/bin/boltcard", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/boltlib/cli.py", line 29, in read
    cs = boltlib.wait_for_card()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/boltlib/core.py", line 73, in wait_for_card
    cardrequest = CardRequest(cardType=cardtype, timeout=timeout)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/smartcard/CardRequest.py", line 58, in __init__
    self.pcsccardrequest = PCSCCardRequest(newcardonly, readers,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/smartcard/pcsc/PCSCCardRequest.py", line 81, in __init__
    self.hcontext = PCSCContext().getContext()
                    ^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/smartcard/pcsc/PCSCContext.py", line 56, in __init__
    self.renewContext()
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/smartcard/pcsc/PCSCContext.py", line 70, in renewContext
    PCSCContext.instance = PCSCContext.__PCSCContextSingleton()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sjors/.pyenv/versions/3.12.1/lib/python3.12/site-packages/smartcard/pcsc/PCSCContext.py", line 40, in __init__
    raise EstablishContextException(hresult)
smartcard.pcsc.PCSCExceptions.EstablishContextException: Failed to establish context: Service not available. (0x8010001D)

I also tried cloning the repo and running it from inside a poetry shell. This results in the same 0x8010001D error.

Happy to test potential fixes...

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

No branches or pull requests

1 participant