btcpayserver / btcpayserver/BTCPayServer.Vault

Error when fetching device on Raspbian, Raspberry Pi

Open
#20 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
178
Forks
88
PR merge metrics
No merged PRs in 30d

Description

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.<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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with BTCPayServer.Hwi.Transports.CliTransport.StartProcess and the HWI bridge entry point shown in the stack trace. Reproduce the hwi enumerate request on linux-arm and inspect how the bundled hwi executable is selected or launched. Done means the Ledger Nano S can be enumerated on Raspbian without the Exec format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, linux, raspberry-pi
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.