btcpayserver / btcpayserver

Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
https://btcpayserver.org/
MIT License
6.32k stars 1.64k forks source link

fail: PayServer: Error on the MigratorHostedService #875

Closed mariodian closed 5 years ago

mariodian commented 5 years ago

Describe the problem/bug When running btcpay I'm getting the following error:

info: Configuration:  Data Directory: /home/satoshi/.btcpayserver/Main
info: Configuration:  Configuration File: /home/satoshi/.btcpayserver/Main/settings.config
info: Configuration:  Network: Mainnet
info: Configuration:  Supported chains: BTC
info: Configuration:  Network: Mainnet
info: Configuration:  Supported chains: BTC
info: Configuration:  Root Path: /
info: Configuration:  Postgres DB used (User ID=satoshi;Password=<redacted>;Host=localhost;Port=5432;Database=btcpayserver;)
info: Configuration:  BTC: Explorer url is http://127.0.0.1:24445/
info: Configuration:  BTC: Cookie file is /home/satoshi/.nbxplorer/Main/.cookie
info: PayServer:      Starting listening NBXplorer (BTC)
info: PayServer:      Start watching invoices
info: Events:         NBXplorer BTC: NotConnected => Ready
fail: PayServer:      Error on the MigratorHostedService
System.NullReferenceException: Object reference not set to an instance of an object.
   at BTCPayServer.Data.StoreData.GetSupportedPaymentMethods(BTCPayNetworkProvider networks)+MoveNext() in /home/satoshi/source/btcpayserver/BTCPayServer/Data/StoreData.cs:line 93
   at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()
   at BTCPayServer.HostedServices.MigratorHostedService.ConvertConvertWalletKeyPathRoots() in /home/satoshi/source/btcpayserver/BTCPayServer/HostedServices/MigratorHostedService.cs:line 99
   at BTCPayServer.HostedServices.MigratorHostedService.Update() in /home/satoshi/source/btcpayserver/BTCPayServer/HostedServices/MigratorHostedService.cs:line 77
info: PayServer:      Starting payment request expiration watcher
info: PayServer:      BTC: Checking if any pending invoice got paid while offline...
info: PayServer:      BTC: 0 payments happened while offline
info: PayServer:      Connected to WebSocket of NBXplorer (BTC)
info: Configuration:  Listening on http://127.0.0.1:23001
info: PayServer:      0 pending payment requests being checked since last run

When I visit the web administration, I don't see my stores, nor apps. Also, some pages are blank (e.g. when trying to create a store).

I haven't updated btcpay in a while so I don't know when this issue occurred. It seems the design of the UI has changed quite a lot (the sidebar is little more polished, gray color, smaller font).

Your environment The latest master 2ca8cc6, manual deployment Ubuntu 18.04

NicolasDorier commented 5 years ago

checking now.

NicolasDorier commented 5 years ago

@mariodian if you can easily debug can you tell me what is null?

On the line specified, I don't see anything that could be null.

if (network == networks.BTC && paymentMethodId.PaymentType == PaymentTypes.BTCLike && btcReturned)
NicolasDorier commented 5 years ago

Ah I found the issue.

NicolasDorier commented 5 years ago

Releasing new version soon, try on master

NicolasDorier commented 5 years ago

Pushed new version 1.0.3.108

mariodian commented 5 years ago

It works! Thanks!