RDN-97
1

Sending Message

Scott on 6/27/2015 6:42 PM

Scott on 9/13/2015 7:28 PM

%
(hrs)
Logged

0 (hrs)


 Description

The below error is coming from our error logging system.  To make this error pop, do the following.

  1. Login to RDN.League.
  2. Go to Messages.
  3. View a Message.
  4. Upon adding a new message, this error is meant to pop.

I don't know under what circumstance, but can you look at that stacktrace below and figure it out?  As you can see, you have line numbers to work with, so you should be able to track this down fairly fast.  If you can't recreate it, let me know, but try to recreate it.

 

 

 

HTTP_HOST league.rdnation.com
PATH_INFO /message/PostMessage
REQUEST_METHOD POST
QUERY_STRING  
REMOTE_ADDR 166.170.42.1
ALL_RAW Connection: keep-alive Content-Length: 110 Content-Type: application/json; charset=UTF-8 Accept: application/json, text/javascript, */*; q=0.01 Accept-Encoding: gzip, deflate Accept-Language: en-us Cookie: ASP.NET_SessionId=0jfabudwo3tw3fgopvrczc2y; .ASPXAUTH=C24D27F1B6668A08464B0E455FEA33A1C694707D3F21106E028794E80C86D8EB962D27669604C2184152218444EA873209DD9A5C47D8E6D6651FB6EF15B1006BC5EDCD4854B22475BEC08D12B8A1FFA45B4DB99AE325819305269F88AFC9D405746D513F160DE631B842A996F248A0706FA84D054D11886D307ACA9698E7FF7B5BE65DBD1268C2D3557CB1D950594200E990A045; __utma=167125117.967848630.1429454383.1433083892.1435424492.7; __utmb=167125117.9.10.1435424492; __utmc=167125117; __utmt=1; __utmz=167125117.1429454383.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) Host: league.rdnation.com Referer: https://league.rdnation.com/messages/view/329736 User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4 X-Requested-With: XMLHttpRequest Origin: https://league.rdnation.com
URL https://league.rdnation.com/message/PostMessage
URL_REFFERER https://league.rdnation.com/messages/view/329736
 

Method: Translate
LINQ to Entities does not recognize the method 'RDN.Library.DataModels.Messages.MessageRecipient get_Item(Int32)' method, and this method cannot be translated into a store expression.

at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.DefaultTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MemberAccessTranslator.TypedTranslate(ExpressionConverter parent, MemberExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MemberAccessTranslator.TypedTranslate(ExpressionConverter parent, MemberExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.EqualsTranslator.TypedTranslate(ExpressionConverter parent, BinaryExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.UnarySequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq) at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.Convert() at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.<GetResults>b__a() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.<GetResults>b__9() at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation) at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source) at RDN.Library.Classes.Messages.Messages.AddNewMessageToGroup(Int64 groupId, Guid ownerMemberId, String message) in d:\Personal\RDNation\RDN.Library\Classes\Communications\Messages\Messages.cs:line 361  

Additional Information:
 
Skip Navigation Links
 

Scott Monday, August 03, 2015 8:33 PM #

ya, I like that idea.  Go ahead and try it.

 

Icatalin Sunday, August 02, 2015 10:19 PM #

Hi I have tried to reproduce this without success. Everything runs ok. But after a bit of digging and research I have found out the most probable cause of this issue is that EF is complaining when you pass a property of an object to it instead of a variable. So in RDN.League all it's fine, but in RDN.API there is a call to the method in question here where you give as a parameter some properties of an object and I think( I am not sure) that this is the issue here.

So to fix this, it can be done something like this:

                            long groupId = ob.GroupMessageId;
                            Guid ownerMemberId = mem.MemberId;
                            string message = ob.Message;
                            Messages.AddNewMessageToGroup(groupId, ownerMemberId, message); //this is how the method should be called and not like:

                            Messages.AddNewMessageToGroup(ob.GroupMessageId, mem.MemberId, ob.Message); //possible source of error 

This is in PostMessage() in RDNation\RDN.Api\Controllers\Member\MessageController.cs file

Appart from this I don't have other ideas at this time.


Powered by BugNET 1.6.339.0