New Posts New Posts RSS Feed: Random exception. What should I look for?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Random exception. What should I look for?

 Post Reply Post Reply
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Random exception. What should I look for?
    Posted: 12-Apr-2012 at 2:10pm
Under load I'm getting some exceptions that look like so:
 
Object reference not set to an instance of an object.
Anonymously Hosted DynamicMethods Assembly
   at lambda_method(Closure )    
   at IdeaBlade.Linq.LocalizingExpressionVisitor.ConstantizeExpression(Expression expression, Type type)    
   at IdeaBlade.Linq.LocalizingExpressionVisitor.MakeLocal(Expression e)    
   at IdeaBlade.Linq.LocalizingExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()    
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)    
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressions(IEnumerable`1 expressions)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()    
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)    
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressions(IEnumerable`1 expressions)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()    
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)    
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressions(IEnumerable`1 expressions)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e)    
   at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr)    
   at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr)    
   at IdeaBlade.Linq.LocalizingExpressionVisitor.Visit(Expression expr)    
   at IdeaBlade.EntityModel.ServerEntityQuery..ctor(EntityQuery query)    
   at IdeaBlade.EntityModel.EntityQuery`1.GetServerQuery()    
   at IdeaBlade.EntityModel.EntityQueryFinder.get_ServerQuery()    
   at IdeaBlade.EntityModel.EntityQueryFinder.Execute()    
   at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)    
   at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)    
   at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()    
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)    
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)    
   at IDATT.Web.Services.MobileService.GetTripData(DateTime lastSyncOn) in C:\CodeWorkspace\idatt\Code\ServerSide\IDATT.Web.Services\Rest\MobileService.cs:line 457    
   at IDATT.Web.Services.MobileService.GetUserTrips(String userName) in C:\CodeWorkspace\idatt\Code\ServerSide\IDATT.Web.Services\Rest\MobileService.cs:line 231
 
This is query executed locally. Looks like this:
 
var mblTrips =
                this.ApplicationEntityManager.MBLTrips
                .Include("DSPTruck")
                .Include("DSPTrailer")
                .Include("MBLTripAttributes.SYSAttribute")
                .Include("MBLTripStops.LOCAddress.LOCCountry")
                .Include("MBLTripStops.LOCAddress.LOCTimeZone")
                .Include("MBLTripStops.MBLTripStopAttributes.SYSAttribute")
                .Where(t =>
                    (t.DriverKey.HasValue && t.UpdatedOn > lastSyncOn && t.DriverKey.Value.Equals(this.Driver.DriverKey))
                    ||
                    (!t.DriverKey.HasValue && t.MBLTripOffers.Any(to => to.UpdatedOn > lastSyncOn && to.DriverKey.Equals(this.Driver.DriverKey)))).OrderBy(t => t.TripId).ToList();
            foreach (var mblTrip in mblTrips)
            {
 
 
I have this exception about 10 times in my log in 10 hours and 20000 calls. What should I look for?
 
Also, same query produces another exception and I see this one once in a while however logging inner and actual exception doesn't make much difference as far as helping me understand what's actually wrong with it..
 

      An error occurred while reading from the store provider's data reader. See the inner exception for details.
         at IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception ex, Boolean tryToHandle, PersistenceOperation operation, Boolean throwOnError)    
         at IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)    
         at IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)    
         at IdeaBlade.EntityModel.EntityQueryFinder.Execute()    
         at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)    
         at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)    
         at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()    
         at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)    
         at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)    
         at IDATT.Web.Services.MobileService.GetTripData(DateTime lastSyncOn) in C:\CodeWorkspace\idatt\Code\ServerSide\IDATT.Web.Services\Rest\MobileService.cs:line 457
         at IDATT.Web.Services.MobileService.GetUserTrips(String userName) in C:\CodeWorkspace\idatt\Code\ServerSide\IDATT.Web.Services\Rest\MobileService.cs:line 231
        
            at IdeaBlade.EntityModel.EntityServerProxy.CheckConnection(Exception e)    
            at IdeaBlade.EntityModel.EntityServerProxy.ExecFunc[T](Func`1 func, Boolean funcWillHandleException)    
            at IdeaBlade.EntityModel.EntityServerProxy.ExecuteOnServer[T](Func`1 func, Boolean funcWillHandleException)    
            at IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)
 


Edited by katit - 12-Apr-2012 at 2:27pm
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 13-Apr-2012 at 2:05pm
Hi katit,

I can't see anything obvious from the stack trace and message. My first suggestion is to see if the debug log provides some clues there for the second error. The log might not be useful for the first error since it's a CacheOnly query.

For the first error, my suggestion is to see if you can narrow it down to certain data values. Probably put some kind of logging and trace messages that log what data are being passed to the .Where clause.




Back to Top
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Posted: 13-Apr-2012 at 2:33pm
Originally posted by DenisK

The log might not be useful for the first error since it's a CacheOnly query.
 
Can you elaborate on this? What do you mean by cache-only query?
 
It is executed on web server (not via Silverlight). But I'm hitting database.
 
It's in WCF service and each call get's new instance of EntityManager.
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 13-Apr-2012 at 3:33pm
A cache-only query is a query executed against the EntityManager's cache with a QueryStrategy.CacheOnly. It doesn't hit the database. I thought this was the case since you said that the query is being executed locally. But apparently, you meant locally as in on the web server and still hitting the database :)

Since this is the case then the debug log should have some info as well.
Back to Top
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Posted: 20-Apr-2012 at 10:17am
Seems like it is fixed. Not exactly how I wanted to fix it but..
 
Issue appeared when I pre-compiled views for EF along with other changes. Seems like removing those pre-compiled views fixed this random issues.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down