Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexey Badyl 33 posts 205 karma points
    Jul 30, 2014 @ 13:39
    Alexey Badyl
    0

    Broken cache file of Finalized orders

    Hi, we are using TC 2.3.2 and Umbraco 6.1.6.

    Two tims a month we catch the following exeption as result a lot of orders can't be processed.  And if this issue happen at night, that mean we have to communicate to all customer who did order when chache was broken.

    System.Xml.XmlException: Unexpected end of file while parsing Name has occurred. Line 1779, position 138266.

    at System.Xml.XmlTextReaderImpl.Throw(Exception e)

    at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)

    at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)

    at System.Xml.XmlTextReaderImpl.ParseEndElement()

    at System.Xml.XmlTextReaderImpl.ParseElementContent()

    at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)

    at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)

    at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)

    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)

    at TeaCommerce.Api.Persistence.Repositories.OrderRepository.GetOrCreateXmlCache(Int64 storeId)

    at TeaCommerce.Api.Persistence.Repositories.OrderRepository.UpdateFinalizedOrdersXmlCache(Order order, Boolean removeOrder)

    at TeaCommerce.Api.Persistence.Repositories.OrderRepository.Save(Order order)

    at TeaCommerce.Api.Models.Order.Save()

    at TeaCommerce.Api.Models.Order.Finalize(Decimal amountAuthorized, String transactionId, PaymentState paymentState, String paymentType, String paymentIdentifier)

    Currently size of cache file is 125 MB (~ 9000 finalized orders). 

    Our hot fix is to remove cache file. But we can't remove it manually all time. And we need solution to make our webshop more stable.

    Any ideas what can be done here? What is the source of problem?
    See bellow incorrect end of file.

     

  • Anders Burla 2560 posts 8256 karma points
    Jul 31, 2014 @ 08:45
    Anders Burla
    0

    Hi Alexey

    So when you delete the cache file and Tea Commerce generates it, the file is generated correctly?

    Kind regards
    Anders

  • Alexey Badyl 33 posts 205 karma points
    Jul 31, 2014 @ 13:30
    Alexey Badyl
    0

    Hi Anders,

    Yes, after we remove it, TC generate correct new cache file. 

     

     

  • Anders Burla 2560 posts 8256 karma points
    Aug 01, 2014 @ 11:52
    Anders Burla
    0

    Hmm looks like some kind of stuff stopping the process. Do you have any recycle of the website that just cuts the process? In tht code for writing to the xml file we have a lock so it should not be a race condition. And the save process of an xml file I think is synchronous.

  • Alexey Badyl 33 posts 205 karma points
    Aug 18, 2014 @ 09:51
    Alexey Badyl
    0

    Hi, today the same issue appier and I checed Application Errors. I found that the following error was throw duting finalizing the order:

     

    Application: w3wp.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: System.AccessViolationException

     

    As resutl IIS was restarted => cache become broken.

    So, I think there are two steps to fix this issue.

    1.  Fix unhandled exception

    2. Clear cache in case it was broken. So we need to know before we start finalization if cache file is valid (like if all module of TC work well). If everything ok - continue, if not remove cache file. Or throw custom exception from TC in case cache file broken - to be able catch it.

    Any I deas how to better manage point 2? Because we a not protected from other unhandled exceptions. 

     

  • Anders Burla 2560 posts 8256 karma points
    Aug 20, 2014 @ 15:53
    Anders Burla
    0

    Hi Alexey

    That is great with more info. We will try and look into it

  • Alexey Badyl 33 posts 205 karma points
    Aug 22, 2014 @ 15:09
    Alexey Badyl
    0

    Hi, Anders

    Just to be sure you understand me correctly.

    This System.AccessViolationException was thrown NOT by TeaCommerce, but by our functionality which excecuted by sheduler at the same time as order was finalized in separate thread.

    In IIS if code throw unhandled exception => server stop work and restarts. 

     

    Best regards,

    Alexey Badyl  
     

     

Please Sign in or register to post replies

Write your reply to:

Draft