Copied to clipboard

Flag this post as spam?

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


  • Bjørn Fridal 274 posts 784 karma points
    Apr 18, 2013 @ 12:37
    Bjørn Fridal
    0

    Error: Sequence contains more than one element

    Hi,

    I have noticed this error pops up ever so often while setting up a Tea Commerce shop v. 2.0.1 I didn't pay to much attention to it at first, but it keeps coming back. I am not doing anything specific when it happens, just navigation the shop, not adding orders or checking out.

    I can see in the tracing that it comes to SessionController right before going to the OrderService.Get() where it looks for a cached order. Maybe something is cached twice since it complains that the sequence contains more than one element?

    Error Loading Razor Script (file: Navgation.Main) Sekvensen indeholder mere end ét tilsvarende element    ved System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
      ved TeaCommerce.Api.Services.OrderService.Get(Int64 storeId, Guid orderId)
      ved TeaCommerce.Api.Web.SessionController.CheckAndMoveOrderIds(Int64 storeId)
      ved TeaCommerce.Api.Web.SessionController.GetCurrentOrderId(Int64 storeId)
      ved TeaCommerce.Umbraco.Web.TC.HasCurrentOrder(Int64 storeId)
      ved ASP._Page_macroScripts_website_navigation_main_cshtml.Execute() i \navigation.main.cshtml:linje 19
      ved System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      ved System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
      ved System.Web.WebPages.WebPage.ExecutePageHierarchy()
      ved System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      ved umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      ved umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

    Cheers
    Bjørn

  • Anders Burla 2560 posts 8256 karma points
    Apr 18, 2013 @ 15:15
    Anders Burla
    0

    Hi Bjørn

    Looks like there is two order with the same id maybe or maybe some data associated with the order. Are you using SQL CE?

    Kind regards
    Anders

  • Bjørn Fridal 274 posts 784 karma points
    Apr 18, 2013 @ 23:33
    Bjørn Fridal
    0

    Hi Anders,

    Thanks for the help. We are using an MSSQL server. I do add some extra data to each order line such as a pickup date as a order line custom property. But I am pretty sure I got the error before I started doing that.

    Its one of those errors that are hard to pinpoint because I can't reproduce it on command and I can't put my finger on the pattern.

    Cheers
    Bjørn 

  • Anders Burla 2560 posts 8256 karma points
    Apr 19, 2013 @ 09:39
    Anders Burla
    0

    Hmm - it might be that - if more than one property with the same alias is added. Or maybe somehow you have an order line with the same id added twice or something else. If you can try and pinpoint what is happening and if you can recreate it everytime, then we can go ahead and debug to see if it is a bug.

    Kind regards
    Anders

  • Bjørn Fridal 274 posts 784 karma points
    Apr 19, 2013 @ 10:18
    Bjørn Fridal
    0

    Hi Anders,

    Thanks I will see what I can come up with.

    Just one question. How can I add an order line with the same id twice? Wouldn't that mean that I was doing some funky custom adding to the cart and not using the Tea Commerce API?

    Cheers
    Bjørn 

  • Bjørn Fridal 274 posts 784 karma points
    Apr 21, 2013 @ 14:41
    Bjørn Fridal
    0

    Hi again,

    I have uncovered some more information now :) The error occurs after I have added some items to the cart, gone through the first checkout steps, but then returned to the shop instead of going to payment page. Perhaps 10-20 minutes after doing that the error occurs. When that happens and I check my TeaCommerce cookie I have a currentPaymentProcessingOrderId with an order id. If I remove that from the cookie, then the error disappers along with the items in my cart.

    Cheers
    Bjørn 

  • Anders Burla 2560 posts 8256 karma points
    Apr 22, 2013 @ 13:17
    Anders Burla
    1

    Hi Bjørn

    Can you send us the website and DB and a walkthrough how to create the bug - with all the things to click and how long you waited :)
    Send to info at teacommerce.net

    I can't recreate the error at my machine - both using session and cookie.

    Kind regards
    Anders

  • Bjørn Fridal 274 posts 784 karma points
    Apr 23, 2013 @ 14:23
    Bjørn Fridal
    0

    Hi Anders,

    I have sent the files and db to the email. Thank you for taking the time to look into it.

    Cheers
    Bjørn 

  • Bjørn Fridal 274 posts 784 karma points
    May 01, 2013 @ 14:46
    Bjørn Fridal
    100

    Just wanted to follow up on this "error". I haven't seen it in a week since I move to another server. Anders has also tried to reproduce it without, which leads me to believe that it might have been caused by my local server setup.

    Once again thanks for the help :)

    Cheers
    Bjørn 

  • Anders Burla 2560 posts 8256 karma points
    May 06, 2013 @ 11:38
    Anders Burla
    0

    Hi Bjørn

    As states in your mail - it looks like this bug is still there somehow. Try and disable cookies in Tea Commerce and see if that fixes the problem. If it does - then we need to test if it has something to do with a race condition for getting the order in the Cache and it is added twice. But lets try and see if its the caching part first.

    Kind regards
    Anders

  • Bjørn Fridal 274 posts 784 karma points
    May 06, 2013 @ 11:40
    Bjørn Fridal
    0

    Hi Anders,

    Right I have disabled cookies for now, and will follow the Elmah log closely to see if anything happens.

    Cheers
    Bjørn 

  • Anders Burla 2560 posts 8256 karma points
    May 06, 2013 @ 12:00
    Anders Burla
    0

    Great. We must have been drunk for the beers you send us when we tried to debug things :)

  • Bjørn Fridal 274 posts 784 karma points
    May 06, 2013 @ 12:05
    Bjørn Fridal
    0

    Right, from now on only chocolate :)

Please Sign in or register to post replies

Write your reply to:

Draft