question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: ERR_RATE_UNAVAILABLE with Kraken

See original GitHub issue

What is your BTCPay version?

I’m running BTCPay 1.6.6.

How did you deploy BTCPay Server?

https://github.com/btcpayserver/btcpayserver-docker

What happened?

BTCPay gives an error when trying to get exchange rates from Kraken (see Screenshot):

BTC_EUR | (ERR_RATE_UNAVAILABLE(kraken, BTC_EUR)) * (0.995, 1.005) XMR_EUR | (ERR_RATE_UNAVAILABLE(kraken, XMR_BTC) * ERR_RATE_UNAVAILABLE(kraken, BTC_EUR)) * (0.995, 1.005)

btcpay

Getting the rates with curl works fine on the server:

# curl "https://api.kraken.com/0/public/Ticker?pair=XXBTZEUR,XXMRZEUR"
{"error":[],"result":{"XXBTZEUR":{"a":["23052.70000","4","4.000"],"b":["23052.60000","1","1.000"],"c":["23052.70000","0.00064988"],"v":["313.62198471","1165.18014950"],"p":["23302.98053","23480.07750"],"t":[7742,24326],"l":["23043.70000","23043.70000"],"h":["23461.00000","23759.10000"],"o":"23348.20000"},"XXMRZEUR":{"a":["160.89000000","3","3.000"],"b":["160.80000000","1","1.000"],"c":["160.82000000","0.17668000"],"v":["1963.85005144","3720.94757456"],"p":["165.23690132","164.58711410"],"t":[531,1339],"l":["160.82000000","160.82000000"],"h":["168.48000000","168.48000000"],"o":"164.18000000"}}}

How did you encounter this bug?

Creating an invoice failed after the upgrade.

Relevant log output

docker logs --tail 100 generated_btcpayserver_1
[...]
warn: PayServer:      Warning: Error while trying to load rates from cache
System.FormatException: Invalid currency pair
   at BTCPayServer.Rating.CurrencyPair.Parse(String str) in /source/BTCPayServer.Rating/CurrencyPair.cs:line 21
   at BTCPayServer.Services.Rates.BackgroundFetcherRateJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in /source/BTCPayServer.Rating/Providers/BackgroundFetcherRateProvider.cs:line 40
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   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 Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at BTCPayServer.Services.SettingsRepository.Deserialize[T](String value) in /source/BTCPayServer/Services/SettingsRepository.cs:line 72
   at BTCPayServer.Services.SettingsRepository.<>c__DisplayClass4_0`1.<<GetSettingAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at BTCPayServer.Services.SettingsRepository.<>c__DisplayClass4_0`1.<<GetSettingAsync>b__0>d.MoveNext() in /source/BTCPayServer/Services/SettingsRepository.cs:line 33
--- End of stack trace from previous location ---
   at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
   at BTCPayServer.Services.SettingsRepository.GetSettingAsync[T](String name) in /source/BTCPayServer/Services/SettingsRepository.cs:line 29
   at BTCPayServer.HostedServices.RatesHostedService.TryLoadRateCache() in /source/BTCPayServer/HostedServices/RatesHostedService.cs:line 118
info: PayServer:      Starting payment request expiration watcher
info: Configuration:  Now listening on: http://0.0.0.0:49392
info: PayServer:      23 pending payment requests being checked since last run
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)
warn: PayServer:      Error while contacting exchange kraken: EQuery:Invalid asset pair
warn: PayServer:      Error while contacting exchange kraken: EQuery:Invalid asset pair
warn: PayServer:      Error while contacting exchange kraken: EQuery:Invalid asset pair
[...]

What browser do you use?

No response

Additional information

No response

Are you sure this is a bug report?

  • I confirm this is a bug report

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Kukkscommented, Aug 21, 2022

This was fixed. Update to latest.

On Sun, Aug 21, 2022, 14:47 v ₿ @.***> wrote:

same error. In the setting I’ve setup Preferred Price Source coingeko however btcpay server keeps contacting contacting other exchanges resulting in 504 gateway time-out on the payment page.

2022-08-21 12:38:07.843 +00:00 [WRN] Error while contacting exchange coingecko: A task was canceled. 2022-08-21 12:38:07.845 +00:00 [WRN] Error while contacting exchange kraken: A task was canceled. 2022-08-21 12:38:37.844 +00:00 [WRN] Error while contacting exchange coingecko: A task was canceled. 2022-08-21 12:38:57.847 +00:00 [WRN] Error while contacting exchange kraken: A task was canceled. 2022-08-21 12:39:47.845 +00:00 [WRN] Error while contacting exchange coingecko: A task was canceled. 2022-08-21 12:39:47.845 +00:00 [WRN] Error while contacting exchange kraken: A task was canceled. 2022-08-21 12:39:57.852 +00:00 [WRN] Error while contacting exchange okex: APIRequest timeout 2022-08-21 12:40:37.846 +00:00 [WRN] Error while contacting exchange coingecko: A task was canceled. 2022-08-21 12:40:37.846 +00:00 [WRN] Error while contacting exchange kraken: A task was canceled. 2022-08-21 12:40:47.848 +00:00 [WRN] Error while contacting exchange okex: APIRequest timeout 2022-08-21 12:41:07.845 +00:00 [WRN] Error while contacting exchange coingecko: A task was canceled. 2022-08-21 12:41:07.845 +00:00 [WRN] Error while contacting exchange kraken: A task was canceled. 2022-08-21 12:41:37.844 +00:00 [WRN] Error while contacting exchange okex: APIRequest timeout

— Reply to this email directly, view it on GitHub https://github.com/btcpayserver/btcpayserver/issues/4027#issuecomment-1221539211, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN357QSCKWC4NEW7MQXQHLV2IQNJANCNFSM56AEMSHA . You are receiving this because you modified the open/close state.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does this error message mean?
"Service Unavailable"​​ If you receive this error message when adding a bank account for United States domestic withdrawals via Synapse, it means one...
Read more >
Kraken Terminal trading interface errors
This error means that the service is temporarily unavailable due to downtime. What you can do: Monitor the website response and uptime on...
Read more >
Unable to withdraw cryptocurrencies
Addresses that you already added to your account won't be affected. You may see a "Balance is insufficient for a withdrawal" error, or...
Read more >
API error messages
This error occurs when a flag or input parameter is disabled temporary or permanently. The error should come from one of the inputs...
Read more >
Unable to withdraw funds
You may see a "Balance is insufficient for a withdrawal" error or the withdrawal page may say that your funds are "Withheld" or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found