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

[Bug]: #5051

Closed
1 task done
agandix opened this issue Jun 6, 2023 · 3 comments
Closed
1 task done

[Bug]: #5051

agandix opened this issue Jun 6, 2023 · 3 comments

Comments

@agandix
Copy link

agandix commented Jun 6, 2023

What is your BTCPay version?

"version": 250000,
"subversion": "/Satoshi:25.0.0/",
"protocolversion": 70016,
"localservices": "0000000000000408",

How did you deploy BTCPay Server?

btcpayserver-docker

What happened?

Getting a 502 bad gateway after restarting btcpay server, also getting a "Error on the MigrationStartupTask" whenever i check the logs for generated_btcpayserver_1

How did you encounter this bug?

Updated server via btcpay-update.sh (not sure which version was before the update, but some old one from 2021)
Restarted the server via btcpay-restart.sh and got a 502 bad gateway.

Relevant log output

info: Configuration:  Data Directory: /datadir
info: Configuration:  Configuration File: /datadir/Main/settings.config
info: BTCPayServer.Plugins.PluginManager: Loading plugins from /root/.btcpayserver/Plugins
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer - 1.10.1
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer.Plugins.Shopify - 1.10.1
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer.Plugins.PointOfSale - 1.10.1
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer.Plugins.PayButton - 1.10.1
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer.Plugins.NFC - 1.10.1
info: BTCPayServer.Plugins.PluginManager: Adding and executing plugin BTCPayServer.Plugins.Crowdfund - 1.10.1
info: Configuration:  Supported chains: LTC,BTC
info: Configuration:  BTC: Explorer url is http://nbxplorer:32838/
info: Configuration:  BTC: Cookie file is /root/.nbxplorer/Main/.cookie
info: Configuration:  LTC: Explorer url is http://nbxplorer:32838/
info: Configuration:  LTC: Cookie file is /root/.nbxplorer/Main/.cookie
info: Configuration:  Network: Mainnet
info: Configuration:  LogFile: /datadir/btcpay.log
info: Configuration:  Log Level: Debug
fail: BTCPayServer.Hosting.MigrationStartupTask: Error on the MigrationStartupTask
Newtonsoft.Json.JsonSerializationException: Error converting value 25 to type 'BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel+Item[]'. Path '', line 1, position 2.
 ---> System.ArgumentException: Could not cast or convert from System.Int64 to BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel+Item[].
   at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
   at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at BTCPayServer.Services.Apps.AppService.Parse(String template, Boolean includeDisabled) in /source/BTCPayServer/Services/Apps/AppService.cs:line 353
   at BTCPayServer.Hosting.MigrationStartupTask.MigrateAppCustomOption() in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 669
   at BTCPayServer.Hosting.MigrationStartupTask.MigrateAppCustomOption() in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 681
   at BTCPayServer.Hosting.MigrationStartupTask.ExecuteAsync(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 176
Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error converting value 25 to type 'BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel+Item[]'. Path '', line 1, position 2.
 ---> System.ArgumentException: Could not cast or convert from System.Int64 to BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel+Item[].
   at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)
   at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at BTCPayServer.Services.Apps.AppService.Parse(String template, Boolean includeDisabled) in /source/BTCPayServer/Services/Apps/AppService.cs:line 353
   at BTCPayServer.Hosting.MigrationStartupTask.MigrateAppCustomOption() in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 669
   at BTCPayServer.Hosting.MigrationStartupTask.MigrateAppCustomOption() in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 681
   at BTCPayServer.Hosting.MigrationStartupTask.ExecuteAsync(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 176
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.StartWithTasksAsync(IWebHost webHost, CancellationToken cancellationToken) in /source/BTCPayServer/Extensions/WebHostExtensions.cs:line 19
   at BTCPayServer.Program.Main(String[] args) in /source/BTCPayServer/Program.cs:line 76

What browser do you use?

Chrome

Additional information

Running BTCpay behind Apache reverse proxy.
Seeing errors in Docker nginx image similar to:

[error] 2604#2604: *22 no live upstreams while connecting to upstream, client: 172.28.0.1, server: btcpay.domain.com, request: "GET /Account/Login HTTP/1.1", upstream: "http://btcpay/Account/Login", host: "btcpay.domain.com"
btcpay.domain.com 172.28.0.1 - - [06/Jun/2023:23:30:25 +0000] "GET /Account/Login HTTP/1.1" 502 552 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"

I'm not 100% sure what all the variables are setup correctly.
IMO, this issue is kind similar to #4162

Are you sure this is a bug report?

  • I confirm this is a bug report
@NicolasDorier
Copy link
Member

We will make a new release for unblocking you today.

@Kukks
Copy link
Member

Kukks commented Jun 7, 2023

@agandix Hey, we just released this fix. Please update and let us know

@agandix
Copy link
Author

agandix commented Jun 7, 2023

Just to let everybody know - the fix worked!
I've updated via btcpay-update.sh to (b7b1fe1b832b67f9912b8350c7e6fe5c429cd208 added today, few hours ago) - and it started working right away (so, all the million settings, that I was trying to tune up for 2 days non-stop, were actually correct!). BTW the new version looks completely different!
Thank you!

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

Successfully merging a pull request may close this issue.

3 participants