CrumpledDog / Umbraco-AzureCDNToolkit

Makes it easy to fully utilise the Azure CDN with a Umbraco website
13 stars 14 forks source link

Error resolving media url from the CDN #31

Open khraibani opened 3 years ago

khraibani commented 3 years ago

Hi @Jeavon I have a website running on Azure S3, and I am using Slimsy and AzureCDNTookit I am getting quiet few error intermittently

ERROR Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions - Error resolving media url from the CDN. Looked for: https://www.website.net/media/1761/pci-dss.jpg?anchor=center&mode=crop&rnd=131771577820000000 System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.<>c__DisplayClass6_1.b__0() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.TryFiveTimes(Action delegateAction) at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.UrlToCdnUrl(String cropUrl, Boolean htmlEncode, String currentDomain)

ERROR Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions - Error resolving media url from the CDN. Looked for: https://www.website.net/media/2156/ico-dd-a1.svg?mode=pad&rnd=132043040770000000 System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.<>cDisplayClass6_1.b__0() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.TryFiveTimes(Action delegateAction) at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.UrlToCdnUrl(String cropUrl, Boolean htmlEncode, String currentDomain) 2021-04-01 04:04:41,056 [P5988/D2/T13] ERROR Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions - Error resolving media url from the CDN. Looked for: https://www.allpay.net/media/2156/ico-dd-a1.svg?mode=pad&rnd=132043040770000000 System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.<>cDisplayClass6_1.b__0() at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.TryFiveTimes(Action delegateAction) at Our.Umbraco.AzureCDNToolkit.UrlHelperRenderExtensions.UrlToCdnUrl(String cropUrl, Boolean htmlEncode, String currentDomain)

I have read somewhere about setting the TLS to 1.2 in the applicationstart might solve the problem, its currently set to 1.2 in azure.

I am aware that you have retired this package but any help on this would be much appreciated.

Many thanks

Jeavon commented 3 years ago

@khraibani ah yes that does look like it might be the TLS version - there is a package - https://our.umbraco.com/packages/developer-tools/codesharetls12umbraco/ or you can incorporate the setting into your own codebase from - https://github.com/prjseal/CodeShare.TLS1.2.Umbraco/blob/master/CodeShare.TLS1.2.Umbraco/EventHandlers/RegisterEvents.cs#L8

khraibani commented 3 years ago

@Jeavon for the swift reply! I will give it a try. Happy Easter!