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 when fetching from Ledger nano s #27

Closed
aaronzomback opened this issue Dec 22, 2020 · 31 comments
Closed

Error when fetching from Ledger nano s #27

aaronzomback opened this issue Dec 22, 2020 · 31 comments

Comments

@aaronzomback
Copy link

I receive this error when I try to generate BTC derivation scheme to configure my store with my hardware ledger wallet....

"An unexpected error happened. (Error reading JArray from JsonReader. Path '', line 0, position 0.)"

  • running macOS High Sierra 10.13.6
  • Ledger firmware: Secure Element 1.6.1 / Microcontroller 1.12 / Bootloader 0.11
  • Bitcoin version: 1.5.1
    -Tried both Firefox & Chrome
  • Ledger Live app is closed
    -Tried BTC Pay Vault version 1.0.7 and 1.0.6
@NicolasDorier
Copy link
Member

You are the second one reporting this.
I never could reproduce. I think @britttttk tried on mac and could not as well.
Are you good enough in dotnet to debug the situation?

@NicolasDorier
Copy link
Member

Do you see better logs in btcpayserver itself? Can you run the vault in command line to maybe see more logs?

@aaronzomback
Copy link
Author

Hey @NicolasDorier thanks for the response. I decided to put this aside and connect with my electrum wallet instead, which is working. Open source FTW!

@NicolasDorier
Copy link
Member

@aaronzomback just be aware about gap limit issues (see our doc) when you do this.
Also with electrum you leak your addresses to third party. I wished you could help us to debug your issue instead :(

@aaronzomback
Copy link
Author

@NicolasDorier didn't know that about the 3rd party leak, you mean the public keys, or IP address? I'm still interested in connecting my Ledger instead. Although I am not familiar with running dotnet. I am with command line - are there docs to run vault in command line? Maybe I can update you better with the errors then.

@NicolasDorier
Copy link
Member

yeah you can git clone this repo and run dotnet run from the BTCPayServer.Vault folder.
You need to install dotnet sdk 3.1.404 on https://dotnet.microsoft.com/download/visual-studio-sdks

You leak both, public keys and IP to the server electrum connects to.

@pavlenex
Copy link
Contributor

Can't replicate. Most people reporting these issues either have outdated version of fw or don't know they need to confirm export public key on the device and wait too long.

@NicolasDorier
Copy link
Member

would be nice to at least understand where it comes from so can get better error message

@NicolasDorier
Copy link
Member

@britttttk I remember you could not reproduce on mac, but were you running latest of both Vault and Ledger firmware/app?

@britttttk
Copy link
Contributor

@NicolasDorier I tried to reproduce it with:
Vault: v1.0.7
BTCPay: v1.0.6.4
Ledger Nano S: firmware v1.5.5, Bitcoin v1.3.13
MacOS: Catalina 10.15.7

I'll update my ledger firmware to try it.. but @aaronzomback what version of BTCPay is this happening for you?

@aaronzomback
Copy link
Author

aaronzomback commented Jan 7, 2021

@britttttk I'm running

BTCPay v1.0.6.4
Vault: v1.0.7
Ledger Nano S: firmware v1.6.1 (most recent as of 1/7/21), and Bitcoin v1.5.4
MacOS: HighSierra 10.13.6

Are you receiving the same error as me?

An unexpected error happened. (Error reading JArray from JsonReader. Path '', line 0, position 0.)

@NicolasDorier I haven't tried running the dotnet server yet, but I plan to do so at some point to get more info.

@NicolasDorier
Copy link
Member

ping @britttttk could repo/debug?

@NicolasDorier
Copy link
Member

Ping @aaronzomback are you tech savy enough to build the project in Debug and run it. It seems @britttttk does not manage to repro.

You just need .NET SDK 3.1, then run dotnet run in the BTCPayServer.Vault folder. You should then see debug logs that should help us.

@britttttk
Copy link
Contributor

@aaronzomback I updated everything to the latest. Can you try to run Vault from your terminal. If it's in your Applications: please try /Applications/BTCPayServer\ Vault.app/Contents/MacOS/BTCPayServer.Vault it will output some debug logs.

generate BTC derivation scheme to configure my store

Does it happen for every kind of wallet you try to generate? Do you make it to this screen or it fails before?
Screen Shot 2021-02-02 at 2 59 16 AM

@pavlenex
Copy link
Contributor

pavlenex commented Feb 2, 2021

@britttttk would be good to write up how to find debug logs in the issue template

@aaronzomback
Copy link
Author

aaronzomback commented Feb 2, 2021

@NicolasDorier will be glad to help the community with this.

Thanks @britttttk for the suggestion,
When I run vault from my terminal, should I have my ledger connected via usb to my computer?

I was actually able to configure xpub and connect to my BlueWallet just fine.

@NicolasDorier
Copy link
Member

@britttttk @aaronzomback you need to download .NET Core 3.1, clone this repo, then run dotnet run from inside the BTCPayServer.Vault directory.

Without this, you don't have debug logs.

Just run Vault like this, plug ledger, then try again to add your xpub via btcpay.

@aaronzomback
Copy link
Author

@NicolasDorier followed all your instructions and cloned this repo, but I'm getting this error in the CLI

Couldn't find a project to run. Ensure a project exists in /Users/aaronzomback/Sites/BTCPAY/BTCPayServer.Vault, or pass the path to the project using --project.

@NicolasDorier
Copy link
Member

@aaronzomback go in the BTCPayServer.Vault in the repo so BTCPayServer.Vault/BTCPayServer.Vault

@aaronzomback
Copy link
Author

aaronzomback commented Feb 2, 2021

@NicolasDorier is there a specific project I should run within that repo?

I'm getting this message when entering dotnet run

Specify which project file to use because /Users/aaronzomback/Sites/BTCPAY/BTCPayServer.Vault/BTCPayServer.Vault contains more than one project file.

The first time I entered I receveived the above message followed by
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.DotNet.Cli.Utils.ProcessReaper.HandleProcessExit(Object sender, EventArgs args) at System.AppContext.OnProcessExit() [1] 1745 abort dotnet run

@NicolasDorier
Copy link
Member

@aaronzomback dotnet run BTCPayServer.Vault.csproj

@aaronzomback
Copy link
Author

aaronzomback commented Feb 2, 2021

@NicolasDorier I tried running that in the dir
dotnet run BTCPayServer.Vault.csproj

but still gives me:
Specify which project file to use because /Users/aaronzomback/Sites/BTCPAY/BTCPayServer.Vault/BTCPayServer.Vault contains more than one project file.

@NicolasDorier
Copy link
Member

dotnet run -p BTCPayServer.Vault.csproj

@NicolasDorier
Copy link
Member

@aaronzomback we found somebody else having the same issue.

It would be helpful if you can help us on finding the issue.

@aaronzomback
Copy link
Author

@NicolasDorier

Running dotnet run -p BTCPayServer.Vault.csproj in the BTCPayServer repo doesn't seem to be producing anything in my CLI when the vault tries to fetch my ledger device.

If my BTCPayServer is not started the command prompts this...
dbug: Microsoft.Extensions.Hosting.Internal.Host[1] Hosting starting info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] User profile is available. Using '/Users/aaronzomback/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. info: BTCPayServer.Vault.Hwi[0] Ensuring hwi program is deployed...

Otherwise, if my BTCPayServer is running, I receive the usual error when ledger connected in my BTCPayServer vault
An unexpected error happened. (Error reading JArray from JsonReader. Path '', line 0, position 0.)
And then in my CLI it exits the dotnet command and prompts a blank new line

@NicolasDorier
Copy link
Member

@aaronzomback the CLI is crashing? it shows no error?

@aaronzomback
Copy link
Author

@NicolasDorier not sure if it's necessarily crashing, but it's true that it shows no error. Are you sure dotnet is the correct debugger?

@NicolasDorier
Copy link
Member

@aaronzomback if you run with dotnet run you normally see which are the exact parameters I send to hwi and the response.

@yeru83
Copy link

yeru83 commented Jul 2, 2021

So quiet... hey, I hope everyone is doing well... any progress on the issue? I can try to duplicate, on OSX 10.14 but I have not chosen HW yet. If Ledger s can't play nice, then I wouldn't know what's better.

@NicolasDorier
Copy link
Member

I replied to you on #29

@NicolasDorier
Copy link
Member

Closing this one as we got no feedback

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

5 participants