dgarage / NBXplorer

NBitcoin Explorer
MIT License
319 stars 212 forks source link

Docker image "fail: Explorer: NBitcoin.RPC.RPCException: getinfo. This call was removed in version 0.16.0." #27

Closed brunoaduarte closed 6 years ago

brunoaduarte commented 6 years ago

Bug when running the docker image from https://hub.docker.com/r/nicolasdorier/nbxplorer/

info: Configuration:  Data Directory: /datadir
info: Configuration:  Configuration File: /datadir/settings.config
info: Configuration:  Creating configuration file
info: Configuration:  Network: Main
info: Configuration:  Testing RPC connection to http://127.0.0.1:8332/
info: Configuration:  RPC connection successfull
fail: Explorer:       Exception thrown while running the server
fail: Explorer:       NBitcoin.RPC.RPCException: getinfo

      This call was removed in version 0.16.0. Use the appropriate fields from:
      - getblockchaininfo: blocks, difficulty, chain
      - getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings
      - getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion

      bitcoin-cli has the option -getinfo to collect and format these in the old format.
         at NBitcoin.RPC.RPCResponse.ThrowIfError()
         at NBitcoin.RPC.RPCClient.<SendCommandAsyncCore>d__46.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at NBitcoin.RPC.RPCClient.<SendCommandAsync>d__43.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at NBitcoin.RPC.RPCClient.SendCommand(RPCRequest request, Boolean throwIfRPCError)
         at NBitcoin.RPC.RPCClient.SendCommand(RPCOperations commandName, Object[] parameters)
         at NBXplorer.Configuration.RPCArgs.ConfigureRPCClient(Network network) in /source/NBXplorer/Configuration/RPCArgs.cs:line 105
         at NBXplorer.ExplorerRuntime..ctor(ExplorerConfiguration configuration) in /source/NBXplorer/ExplorerRuntime.cs:line 35
         at NBXplorer.Extensions.<>c.<AddNBXplorer>b__2_4(IServiceProvider o) in /source/NBXplorer/Extensions.cs:line 50
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at NBXplorer.Extensions.UseNBXplorer(IApplicationBuilder app) in /source/NBXplorer/Extensions.cs:line 78
         at NBXplorer.Startup.Configure(IApplicationBuilder app, IServiceProvider prov, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceProvider serviceProvider) in /source/NBXplorer/Startup.cs:line 50
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
         at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
         at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
         at NBXplorer.Program.Main(String[] args) in /source/NBXplorer/Program.cs:line 36
NicolasDorier commented 6 years ago

I guess you are running old version of NBXlporer, getinfo is not used anymore.

docker pull nicolasdorier/nbxplorer

Then try again.

brunoaduarte commented 6 years ago

Hi @NicolasDorier , that's the point, i'm already using the latest docker image, but it seems this image contains an old version of NBXplorer, maybe the autobuild failed somewhere

root@ubuntu:/home/ubuntu# docker pull nicolasdorier/nbxplorer
Using default tag: latest
latest: Pulling from nicolasdorier/nbxplorer
Digest: sha256:f604c27c33e6a73cde91cd1f76fdc7791923999f39f6aed27226d79d551ca067
Status: Image is up to date for nicolasdorier/nbxplorer:latest

and still

root@ubuntu:/home/ubuntu# docker run --rm --network container:bitcoind_mainnet nicolasdorier/nbxplorer
info: Configuration:  Data Directory: /datadir
info: Configuration:  Configuration File: /datadir/settings.config
info: Configuration:  Creating configuration file
info: Configuration:  Network: Main
info: Configuration:  Testing RPC connection to http://127.0.0.1:8332/
info: Configuration:  RPC connection successfull
fail: Explorer:       Exception thrown while running the server
fail: Explorer:       NBitcoin.RPC.RPCException: getinfo

      This call was removed in version 0.16.0. Use the appropriate fields from:
      - getblockchaininfo: blocks, difficulty, chain
      - getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings
      - getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion

      bitcoin-cli has the option -getinfo to collect and format these in the old format.
         at NBitcoin.RPC.RPCResponse.ThrowIfError()
         at NBitcoin.RPC.RPCClient.<SendCommandAsyncCore>d__46.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at NBitcoin.RPC.RPCClient.<SendCommandAsync>d__43.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at NBitcoin.RPC.RPCClient.SendCommand(RPCRequest request, Boolean throwIfRPCError)
         at NBitcoin.RPC.RPCClient.SendCommand(RPCOperations commandName, Object[] parameters)
         at NBXplorer.Configuration.RPCArgs.ConfigureRPCClient(Network network) in /source/NBXplorer/Configuration/RPCArgs.cs:line 105
         at NBXplorer.ExplorerRuntime..ctor(ExplorerConfiguration configuration) in /source/NBXplorer/ExplorerRuntime.cs:line 35
         at NBXplorer.Extensions.<>c.<AddNBXplorer>b__2_4(IServiceProvider o) in /source/NBXplorer/Extensions.cs:line 50
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at NBXplorer.Extensions.UseNBXplorer(IApplicationBuilder app) in /source/NBXplorer/Extensions.cs:line 78
         at NBXplorer.Startup.Configure(IApplicationBuilder app, IServiceProvider prov, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceProvider serviceProvider) in /source/NBXplorer/Startup.cs:line 50
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
         at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
         at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
         at NBXplorer.Program.Main(String[] args) in /source/NBXplorer/Program.cs:line 36
brunoaduarte commented 6 years ago

Ok, the thing is your docker "latest" tag is 5 months old. So i did

docker pull nicolasdorier/nbxplorer:1.0.1.24

now it works...

NicolasDorier commented 6 years ago

A good point I need to change this.

NicolasDorier commented 6 years ago

Publishing a correct latest now.