cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DatabaseCalls_Error.log fills with Object not set to reference

I've been seeing a daily frequent number of entries in my DatabaseCalls_Error.log and wondering what view is being called and if there is any solution to this? Should I set the log level to Error?  This and other queries fill up the Error log file in App Portal with entries that really are not errors.

Object reference not set to an instance of an object. at AppPortal.Business.SCCMDeploymentStatus.<>c.<GetEmailRequestsByQuery>b__76_4(IUser u)
at System.Linq.Lookup`2.CreateForJoin(IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.<GroupJoinIterator>d__41`4.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__23`3.MoveNext()
at AppPortal.Business.SCCMDeploymentStatus.GetEmailRequestsByQuery(String query)

(1) Solution
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

Sorry, I had meant to respond, but did not really end up with any kind of solution, so I lost track of this. I'll give you and overview of what is being done, but I'm not sure that it will help. First the following query is run:

SELECT DISTINCT TOP 100 PERCENT ADGUID, LastNotify FROM dbo.WD_ApprovalNotify
WHERE Notified = 1
AND (DATEDIFF(minute, LastNotify, getutcdate()) >= 1440) GROUP BY ADGUID, RequestID_FK, LastNotify

Note that the 1440 is 24 hours.. Basically getting those users who have not received a reminder to approve email in 24 hours. 

App Broker then loops through the list of approvers based on their AD GUID, running the following query for each:

SELECT pr.UniqueRequesterName, pr.UniqueUserName,pr.UserResourceID,pr.RequesterResourceID, pr.DateTime, pr.RequestID, pr.GUID, pr.Deleted, pr.Notified,
pr.AltName, pr.ParentRequestID, pr.AcceptedBy, pr.AcceptedOn, pr.OrderNo,
wp.PackageTitle, wp.Type, wp.PackageID, wp.LicenseID_FK, wp.PackageID, wp.LicenseID_FK, wp.CatalogCost, wp.UseInventoryCost,
rt.MachineName, an.ADGUID, an.LastNotify, an.ApproverTypeID, wp.Type
FROM dbo.WD_PackageRequests pr
INNER JOIN dbo.WD_WebPackages wp ON wp.PackageID = pr.PackageID_FK
INNER JOIN dbo.WD_RequestTarget rt ON rt.RequestID = pr.RequestID
LEFT OUTER JOIN dbo.WD_License l ON l.LicenseID = wp.LicenseID_FK
INNER JOIN dbo.WD_ApprovalNotify an ON an.RequestID_FK = pr.RequestID
WHERE an.ADGUID = '<AD GUID VALUE>' AND pr.Deleted = 0 AND pr.AcceptedBy IS NULL

It appears that the exception is thrown when trying to process the results from the above query.. I'd guess that some value is empty where it should contain a value. I really don't see any additional log messages that would help us to determine the "bad" record(s). 

View solution in original post

(2) Replies
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

Sorry, I had meant to respond, but did not really end up with any kind of solution, so I lost track of this. I'll give you and overview of what is being done, but I'm not sure that it will help. First the following query is run:

SELECT DISTINCT TOP 100 PERCENT ADGUID, LastNotify FROM dbo.WD_ApprovalNotify
WHERE Notified = 1
AND (DATEDIFF(minute, LastNotify, getutcdate()) >= 1440) GROUP BY ADGUID, RequestID_FK, LastNotify

Note that the 1440 is 24 hours.. Basically getting those users who have not received a reminder to approve email in 24 hours. 

App Broker then loops through the list of approvers based on their AD GUID, running the following query for each:

SELECT pr.UniqueRequesterName, pr.UniqueUserName,pr.UserResourceID,pr.RequesterResourceID, pr.DateTime, pr.RequestID, pr.GUID, pr.Deleted, pr.Notified,
pr.AltName, pr.ParentRequestID, pr.AcceptedBy, pr.AcceptedOn, pr.OrderNo,
wp.PackageTitle, wp.Type, wp.PackageID, wp.LicenseID_FK, wp.PackageID, wp.LicenseID_FK, wp.CatalogCost, wp.UseInventoryCost,
rt.MachineName, an.ADGUID, an.LastNotify, an.ApproverTypeID, wp.Type
FROM dbo.WD_PackageRequests pr
INNER JOIN dbo.WD_WebPackages wp ON wp.PackageID = pr.PackageID_FK
INNER JOIN dbo.WD_RequestTarget rt ON rt.RequestID = pr.RequestID
LEFT OUTER JOIN dbo.WD_License l ON l.LicenseID = wp.LicenseID_FK
INNER JOIN dbo.WD_ApprovalNotify an ON an.RequestID_FK = pr.RequestID
WHERE an.ADGUID = '<AD GUID VALUE>' AND pr.Deleted = 0 AND pr.AcceptedBy IS NULL

It appears that the exception is thrown when trying to process the results from the above query.. I'd guess that some value is empty where it should contain a value. I really don't see any additional log messages that would help us to determine the "bad" record(s). 

Thanks for the reply Charles!