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 device on Raspbian, Raspberry Pi #20

Open
gradientskier opened this issue Jun 20, 2020 · 2 comments
Open

Error when fetching device on Raspbian, Raspberry Pi #20

gradientskier opened this issue Jun 20, 2020 · 2 comments

Comments

@gradientskier
Copy link

Checked out BTCPayVault v1.0.2 and built for linux-arm. The app is starting, but it fails to interface with the hardware wallet (ledger nano s).

This is the log when importing derivation scheme from the vault.

info: BTCPayServer.Vault.Hwi[0]
      Permission to https://btcpay.local got granted
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HM0L50FT2O22" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 2018.7584ms 200 
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST http://127.0.0.1:65092/hwi-bridge/v1 text/plain;charset=UTF-8 24
trce: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[2]
      All hosts are allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[1]
      POST requests are not supported
dbug: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[2]
      The request has an origin header: 'https://btcpay.local'.
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
      CORS policy execution successful.
dbug: Microsoft.AspNetCore.Server.Kestrel[25]
      Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": started reading request body.
dbug: Microsoft.AspNetCore.Server.Kestrel[26]
      Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": done reading request body.
dbug: BTCPayServer.Vault.Hwi.Cli[0]
      /home/pi/tmp/.net/BTCPayServer.Vault/udcgk2ts.1vo/hwi enumerate
fail: BTCPayServer.Vault.Hwi.Cli[0]
      Failed to call hwi
System.ComponentModel.Win32Exception (8): Exec format error
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at BTCPayServer.Hwi.Transports.CliTransport.StartProcess(ProcessStartInfo startInfo, CancellationToken cancel)
   at BTCPayServer.Hwi.Transports.CliTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HM0L50FT2O22", Request id "0HM0L50FT2O22:00000002": An unhandled exception was thrown by the application.
System.ComponentModel.Win32Exception (8): Exec format error
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at BTCPayServer.Hwi.Transports.CliTransport.StartProcess(ProcessStartInfo startInfo, CancellationToken cancel)
   at BTCPayServer.Hwi.Transports.CliTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
   at BTCPayServer.Vault.HWI.InternalTransport.SendCommandAsync(String[] arguments, CancellationToken cancel)
   at BTCPayServer.Vault.HWI.HwiServer.Handle(HttpContext ctx)
   at Microsoft.Extensions.DependencyInjection.HwiServerExtensions.<>c.<<UseHwiServer>b__1_2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
      Connection id "0HM0L50FT2O22" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 203.2648ms 500 

Any idea?

@NicolasDorier
Copy link
Member

NicolasDorier commented Jun 22, 2020

Yes, I know why. The hwi program we are using are the one distributed here: https://github.com/bitcoin-core/HWI/releases and it supports only amd64. (the one in /home/pi/tmp/.net/BTCPayServer.Vault/udcgk2ts.1vo/hwi )

What you can do is compile hwi in arm32 (or arm64 if that's what you use) and replace the hwi executable, then it should work.

If you can improve the build process of hwi project, so @achow101 can easily ship arm versions, I can take that into account to use this on arm machines.

@NicolasDorier
Copy link
Member

you can also probably take the binary shipped by https://pypi.org/project/hwi/ and replace

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

2 participants