Miningcore does not start, no clear error!
VaderCoinCryptoNote opened this issue · 4 comments
[2023-02-11 18:00:10.2927] [F] [Diagnostics] Application startup exception System.NullReferenceException: Object reference not set to an instance of an object.
at Miningcore.Program.<>c.
at Microsoft.Extensions.Options.ConfigureNamedOptions
1.Configure(String name, TOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup.Configure(MvcOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action
1 configureRoutes)at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app)
at Miningcore.Program.<>c__DisplayClass0_0.b__5(IApplicationBuilder app) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 233
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass17_0.b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) at Miningcore.Program.<>c.b__0_9(JsonOptions options) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 181
at Microsoft.Extensions.Options.ConfigureNamedOptions
1.Configure(String name, TOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup.Configure(MvcOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action
1 configureRoutes)at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app)
at Miningcore.Program.<>c__DisplayClass0_0.b__5(IApplicationBuilder app) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 233
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass17_0.b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
[2023-02-11 18:00:10.3338] [I] [Lifetime] Application is shutting down...
[2023-02-11 18:00:10.3316] [E] [ltc1] System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException()
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters)at Autofac.ResolutionExtensions.ResolveNamed[TService](IComponentContext context, String serviceName, IEnumerable
1 parameters) at Miningcore.Crypto.HashAlgorithmFactory.InstantiateHash(IComponentContext ctx, String name, Object[] parameters) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Crypto/HashAlgorithmFactory.cs:line 47 at Miningcore.Crypto.HashAlgorithmFactory.GetHash(IComponentContext ctx, JObject definition) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Crypto/HashAlgorithmFactory.cs:line 25 at Miningcore.Configuration.BitcoinTemplate.<.ctor>b__89_1() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Configuration/ClusterConfigExtensions.cs:line 36 at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode)at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue()at System.Lazy
1.get_Value() at Miningcore.Configuration.BitcoinTemplate.get_HeaderHasherValue() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Configuration/ClusterConfigExtensions.cs:line 53 at Miningcore.Blockchain.Bitcoin.BitcoinJobManager.PostChainIdentifyConfigure() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManager.cs:line 116 at Miningcore.Blockchain.Bitcoin.BitcoinJobManagerBase
1.PostStartInitAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManagerBase.cs:line 471at Miningcore.Blockchain.JobManagerBase
1.StartAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/JobManagerBase.cs:line 112 at Miningcore.Blockchain.Bitcoin.BitcoinPool.SetupJobManager(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 368 at Miningcore.Mining.PoolBase.RunAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Mining/PoolBase.cs:line 392 at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException() at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable
1 parameters, Object& instance)at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters) at Autofac.ResolutionExtensions.ResolveNamed[TService](IComponentContext context, String serviceName, IEnumerable
1 parameters)at Miningcore.Crypto.HashAlgorithmFactory.InstantiateHash(IComponentContext ctx, String name, Object[] parameters) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Crypto/HashAlgorithmFactory.cs:line 47
at Miningcore.Crypto.HashAlgorithmFactory.GetHash(IComponentContext ctx, JObject definition) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Crypto/HashAlgorithmFactory.cs:line 25
at Miningcore.Configuration.BitcoinTemplate.<.ctor>b__89_1() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Configuration/ClusterConfigExtensions.cs:line 36
at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)at System.Lazy
1.CreateValue() at System.Lazy
1.get_Value()at Miningcore.Configuration.BitcoinTemplate.get_HeaderHasherValue() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Configuration/ClusterConfigExtensions.cs:line 53
at Miningcore.Blockchain.Bitcoin.BitcoinJobManager.PostChainIdentifyConfigure() in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManager.cs:line 116
at Miningcore.Blockchain.Bitcoin.BitcoinJobManagerBase
1.PostStartInitAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManagerBase.cs:line 471 at Miningcore.Blockchain.JobManagerBase
1.StartAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/JobManagerBase.cs:line 112at Miningcore.Blockchain.Bitcoin.BitcoinPool.SetupJobManager(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 368
at Miningcore.Mining.PoolBase.RunAsync(CancellationToken ct) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Mining/PoolBase.cs:line 392
System.NullReferenceException: Object reference not set to an instance of an object.
at Miningcore.Program.<>c.b__0_9(JsonOptions options) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 181
at Microsoft.Extensions.Options.ConfigureNamedOptions
1.Configure(String name, TOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup.Configure(MvcOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action
1 configureRoutes)at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app)
at Miningcore.Program.<>c__DisplayClass0_0.b__5(IApplicationBuilder app) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 233
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass17_0.b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Miningcore.Program.Main(String[] args) in /home/fluffelbuff/Downloads/ltc-pool/miningcore/src/Miningcore/Program.cs:line 245
Cluster cannot start. Good Bye!
fluffelbuff@fluffelbuff-MacBookPro:~/Downloads/ltc-pool/miningcore/build$
I have no idea where the error should be. Can anyone understand this exception?
Seems like you're trying to run miningcore on a macbook. I highly doubt miningcore supports that. Can you try on linux?
I don't think the mac is causing the error, I'm running this on ubuntu 22.04 and I'm also getting the error.
@VaderCoinCryptoNote do you try to run Monero? I would rather think it's config related / daemon & RPC
Did you resolve this?
The error
System.NullReferenceException: Object reference not set to an instance of an object.
at Miningcore.Program.<>c.
at Microsoft.Extensions.Options.ConfigureNamedOptions
1.Configure(String name, TOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Mvc.MvcCoreMvcOptionsSetup.Configure(MvcOptions options) at Microsoft.Extensions.Options.OptionsFactory
1.Create(String name)at Microsoft.Extensions.Options.UnnamedOptionsManager
1.get_Value() at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action
1 configureRoutes)at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app)
at Miningcore.Program.<>c__DisplayClass0_0.b__5(IApplicationBuilder app) in /root/miningcore/src/Miningcore/Program.cs:line 233
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass17_0.b__2(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Miningcore.Program.Main(String[] args) in /root/miningcore/src/Miningcore/Program.cs:line 245
So the problem was that the config in the examples was not up to date.
The section is
"api": { "enabled": true, // Binding address (Default: 127.0.0.1) "listenAddress": "127.0.0.1", // Binding port (Default: 4000) "port": 4000, // IP address whitelist for requests to Prometheus Metrics (default 127.0.0.1) "metricsIpWhitelist": [], // Limit rate of requests to API on a per-IP basis "rateLimiting": { "disabled": false, // disable rate-limiting all-together, be careful // override default rate-limit rules, refer to https://github.com/stefanprodan/AspNetCoreRateLimit/wiki/IpRateLimitMiddleware#defining-rate-limit-rules "rules": [ { "Endpoint": "*", "Period": "1s", "Limit": 5 } ], // List of IP addresses excempt from rate-limiting (default: none) "ipWhitelist": [] } },
is missing from the examples, which comes down to the error I had.
Will created a PR this week with the correct config