Bug? ECB Exchange Provider "The requested name is valid"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 2 años
Hello,

Using nopC 4.40.4

I have successfully setup a second currency and compared the store results with an online currency exchange conversion tool which prices match perfectly. When the scheduler runs the exachange update task to update exchange rates, it presents an errror in the log.

I am guessing here but visiting the url in the error redirects (301) somewhere else. So maybe the expected enpoint has been changed by the exchange website?

301 REDIRECT TEST
https://www.ecb.int
301 Moved Permanently
https://www.ecb.europa.eu/
302 Found
https://www.ecb.europa.eu/home/html/index.en.html
200 OK

System.Net.Http.HttpRequestException: The requested name is valid, but no data of the requested type was found. (www.ecb.int:80)
---> System.Net.Sockets.SocketException (11004): The requested name is valid, but no data of the requested type was found.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at Nop.Plugin.ExchangeRate.EcbExchange.EcbExchangeRateProvider.GetCurrencyLiveRatesAsync(String exchangeRateCurrencyCode)
Hace 2 años
This is the endpoint that is hardcoded in the plugin.  It returns the proper result.
http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml

I tested the plugin locally, and I don't get any errors logged.  I suspect you have some problem hitting that URL from your site (DNS issue??).
Hace 2 años
Agree. Could be a one off isolated dns issue. Maybe timeout issue with not one but two redirects. First a 301 then a 302.

Task is firing on schedule and has an updated date. Manual firing does not produce an error.

Actual URL
https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

Regards
Hace 2 años
Thanks a lot! We'll update it - https://github.com/nopSolutions/nopCommerce/issues/5789
Hace 2 años
itinnovations wrote:
Hello,

Using nopC 4.40.4

I have successfully setup a second currency and compared the store results with an online currency exchange conversion tool which prices match perfectly. When the scheduler runs the exachange update task to update exchange rates, it presents an errror in the log.

I am guessing here but visiting the url in the error redirects (301) somewhere else. So maybe the expected enpoint has been changed by the exchange website?

301 REDIRECT TEST
https://www.ecb.int
301 Moved Permanently
https://www.ecb.europa.eu/
302 Found
https://www.ecb.europa.eu/home/html/index.en.html
200 OK

System.Net.Http.HttpRequestException: The requested name is valid, but no data of the requested type was found. (www.ecb.int:80)
---> System.Net.Sockets.SocketException (11004): The requested name is valid, but no data of the requested type was found.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at Nop.Plugin.ExchangeRate.EcbExchange.EcbExchangeRateProvider.GetCurrencyLiveRatesAsync(String exchangeRateCurrencyCode)


Hi! Resolved this problem here: https://github.com/nopSolutions/nopCommerce/pull/5824
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.