• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Forums

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Mar 2019 10:23 AM by  Ben Shillito
Azure - WinIOError
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Marshalls UK



New Member


Posts:1
New Member


--
27 Nov 2017 10:12 AM
    Hi

    We have some MVC sites hosted in Azure and several times over the last few months the sites have thrown exceptions for specific devices. For example, the latest issue meant that the site was visible for desktop and iOS browsers but when viewing on an Android device the site never loads and an ASP.NET error page is displayed (error below). This bypasses the custom error pages we have set up, so the customer sees the full error. Restarting the web app resolves the issue.

    We are using 51degrees.mobi version 3.2.8.1 with auto updating of device data.

    Is this down to a bad auto update, and is there anything we can do to resolve or prevent it?

    Thanks.

    Error details:

    An unexpected network error occurred.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.IOException: An unexpected network error occurred.


    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:
    [IOException: An unexpected network error occurred.
    ]
    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +13010840
    System.IO.FileStream.ReadCore(Byte[] buffer, Int32 offset, Int32 count) +12548698
    System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count) +210
    System.IO.BinaryReader.FillBuffer(Int32 numBytes) +70
    System.IO.BinaryReader.ReadInt16() +21
    FiftyOne.Foundation.Mobile.Detection.Entities.Node..ctor(DataSet dataSet, Int32 offset, BinaryReader reader) +61
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.NodeV31..ctor(DataSet dataSet, Int32 offset, BinaryReader reader) +29
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.NodeStreamFactoryV31.Construct(DataSet dataSet, Int32 offset, Reader reader) +61
    FiftyOne.Foundation.Mobile.Detection.Factories.NodeFactory.Create(DataSet dataSet, Int32 offset, Reader reader) +16
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.VariableList`1.CreateEntity(Int32 offset, Reader reader) +59
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.BaseList`1.get_Item(Int32 key) +66
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.CacheList`1.FiftyOne.Foundation.Mobile.Detection.ICacheLoader<System.Int32,T>.Fetch(Int32 key) +5
    FiftyOne.Foundation.Mobile.Detection.Cache`2.get_Item(K key, ICacheLoader`2 loader) +128
    FiftyOne.Foundation.Mobile.Detection.Entities.Stream.CacheList`1.get_Item(Int32 key) +11
    FiftyOne.Foundation.Mobile.Detection.Entities.NodeIndexBase.get_Node() +230
    FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetNextNode(MatchState state) +184
    FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state) +21
    FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state) +35
    FiftyOne.Foundation.Mobile.Detection.Controller.Evaluate(MatchState state) +52
    FiftyOne.Foundation.Mobile.Detection.Controller.Match(MatchState state) +78
    FiftyOne.Foundation.Mobile.Detection.Provider.MatchNoCache(String targetUserAgent, MatchState state) +105
    FiftyOne.Foundation.Mobile.Detection.MatchState.FiftyOne.Foundation.Mobile.Detection.ICacheLoader<System.String,FiftyOne.Foundation.Mobile.Detection.MatchResult>.Fetch(String key) +21
    FiftyOne.Foundation.Mobile.Detection.Cache`2.get_Item(K key, ICacheLoader`2 loader) +128
    FiftyOne.Foundation.Mobile.Detection.Provider.Match(String targetUserAgent, MatchState state) +33
    FiftyOne.Foundation.Mobile.Detection.Provider.Match(NameValueCollection headers, Match match) +159
    FiftyOne.Foundation.Mobile.Detection.WebProvider.GetMatch(HttpRequest request) +306
    FiftyOne.Foundation.Mobile.Detection.MobileCapabilitiesProvider.GetBrowserCapabilities(HttpRequest request) +70
    System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request) +9848239
    System.Web.HttpRequest.get_Browser() +79
    System.Web.Security.CookielessHelperClass.UseCookieless(HttpContext context, Boolean doRedirect, HttpCookieMode cookieMode) +9811783
    System.Web.Security.FormsAuthenticationModule.ExtractTicketFromCookie(HttpContext context, String name, Boolean& cookielessTicket) +1781
    System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) +107
    System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +80
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
    0

    JoshGrew



    New Member


    Posts:24
    New Member


    --
    28 Nov 2017 04:50 PM
    Hi There

    You mentioned that restarting the Web app resolved this, is this the same case for other issues that have come up in the past? Any other examples you could send over would be great.

    It shouldn't be down to the auto update but there have been quite a few changes to the API since your current version including changes to support MVC. You may find upgrading will prevent some of the issues you are experiencing, is this a feasible option for you?

    Josh
    0

    JoshGrew



    New Member


    Posts:24
    New Member


    --
    11 Dec 2017 10:10 AM
    Just following up to see how you are getting on, have you had a chance to look at the above?
    0

    Marshalls UK



    New Member


    Posts:1
    New Member


    --
    12 Dec 2017 04:03 PM
    Hi Josh, apologies for the tardy response.

    This is the only type of issue we have had with 51Degrees since migrating to Azure. Every time the error signature is the same, and every time a web app restart resolves the problem. We can look at updating the package during our next maintenance cycle.
    0

    JoshGrew



    New Member


    Posts:24
    New Member


    --
    14 Dec 2017 03:52 PM
    Thanks for getting back. Our recommendation is to definitely try with our most up-to-date API. Please let me know how you get on.
    0

    IgorDR



    New Member


    Posts:2
    New Member


    --
    08 Mar 2019 08:49 AM
    Same problem here on Azure.
    I'm using the latest version (3.2.21.1).
    After restarting the web site, it worked for 2 days.
    Now some mobile devices are not able to see the website because (only for them) the web application crashes.

    Exception information:

    Exception type: IOException

    Exception message: An unexpected network error occurred.

    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.ReadCore(Byte[] buffer, Int32 offset, Int32 count)
    at System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count)
    at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
    at System.IO.BinaryReader.ReadInt16()
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node..ctor(IDataSet dataSet, Int32 offset, BinaryReader reader)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Stream.Node..ctor(IStreamDataSet dataSet, Int32 offset, BinaryReader reader)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Stream.NodeV32..ctor(IStreamDataSet dataSet, Int32 offset, BinaryReader reader)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Stream.NodeStreamFactoryV32.Construct(IStreamDataSet dataSet, Int32 offset, Reader reader)
    at FiftyOne.Foundation.Mobile.Detection.Factories.NodeFactory`1.Create(D dataSet, Int32 offset, Reader reader)
    at FiftyOne.Foundation.Mobile.Detection.DataSetBuilder.EntityLoader`2.Load(Int32 key)
    at FiftyOne.Foundation.Mobile.Detection.Caching.LruCache`2.get_Item(K key, IValueLoader`2 loader)
    at FiftyOne.Foundation.Mobile.Detection.DataSetBuilder.LruEntityLoader`2.Load(Int32 key)
    at FiftyOne.Foundation.Mobile.Detection.StreamList`2.get_Item(Int32 i)
    at FiftyOne.Foundation.Mobile.Detection.Entities.NodeIndexBase.get_Node()
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetNextNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Entities.Node.GetCompleteNode(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Controller.Evaluate(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Controller.Match(MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Provider.MatchNoCache(String targetUserAgent, MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.MatchState.FiftyOne.Foundation.Mobile.Detection.Caching.IValueLoader<System.String,FiftyOne.Foundation.Mobile.Detection.MatchResult>.Load(String key)
    at FiftyOne.Foundation.Mobile.Detection.Caching.LruCache`2.get_Item(K key, IValueLoader`2 loader)
    at FiftyOne.Foundation.Mobile.Detection.Provider.Match(String targetUserAgent, MatchState state)
    at FiftyOne.Foundation.Mobile.Detection.Provider.Match(NameValueCollection headers, Match match)
    at FiftyOne.Foundation.Mobile.Detection.WebProvider.GetMatch(HttpRequest request)
    at FiftyOne.Foundation.Mobile.Detection.MobileCapabilitiesProvider.GetBrowserCapabilities(HttpRequest request)
    at System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request)
    at System.Web.HttpRequest.get_Browser()
    at System.Web.Security.CookielessHelperClass.UseCookieless(HttpContext context, Boolean doRedirect, HttpCookieMode cookieMode)
    at System.Web.Security.FormsAuthenticationModule.ExtractTicketFromCookie(HttpContext context, String name, Boolean& cookielessTicket)
    at System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e)
    at System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs)
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    0

    IgorDR



    New Member


    Posts:2
    New Member


    --
    12 Mar 2019 07:53 PM
    After a further investigation it seems that this problem happens only on websites that change the domain on device detection.
    My website when it detects that the device is moblie, redirects to the m-.mydomain.com, that's the same website but with a different domain and different master page (the app is the same).
    My other websites that on mobile device detection change only the master page but keep the same www domain, do not seem to suffer this bug.

    Using memoryMode="true" seems to be another solution.
    0

    Ben Shillito



    New Member


    Posts:9
    New Member


    --
    13 Mar 2019 10:23 AM
    Hi,

    It looks like the error is likely due to an unreliable connection to the file sytem. As the data set is running in stream mode, anything which is not cached must be loaded from disk. This is what is happening in this stacktrace, and there is an error reading. The fact that you are using Azure probably means the disk containing the data file is not directly connected, so that would seem the most likely answer.

    To avoid this, I suggest running the API in memory mode, meaning that the data file is read into memory at startup, so this disk is not accessed again. To do this, open up your 51degrees.config and add
    memoryMode="true"
    to the detection section (here https://github.com/51Degrees/dotNET...nfig#L106)

    I'm confident this will solve the issue, but let me know if not and we can look into it some more.

    Thanks,
    Ben.
    0
    You are not authorized to post a reply.