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)
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.
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.
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.
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)
Hi Alexey
So when you delete the cache file and Tea Commerce generates it, the file is generated correctly?
Kind regards
Anders
Hi Anders,
Yes, after we remove it, TC generate correct new cache file.
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.
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.
Hi Alexey
That is great with more info. We will try and look into it
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
is working on a reply...