***************************************************************************************************************************************
*NOTE: I posted this as a bug but wanted to include it here because this is the first place I searched when I ran into the issue
***************************************************************************************************************************************
My users started experiencing "/Application Error" in mulitple scenarios that had nothing to do with server configuration because it was working fine for months then all of sudden started happening.
I tracked down the issue and discovered the problem, a user account was deleted that had bugs created by the user. Future releases the code should be changed so that users with records can not be deleted, but here is the fix.
Run the followin query to update the BugsView view and the problem will go away. The code was unable to handle a NULL reference in the view, specifically in the stored procedure :
Found In Version:
-----------------------------
ALTER VIEW [dbo].[BugsView]
AS
SELECT dbo.Bug.BugID, dbo.Bug.Summary, dbo.Bug.Description, dbo.Bug.ReportedDate, dbo.Bug.StatusID, dbo.Bug.PriorityID, dbo.Bug.TypeID,
dbo.Bug.ComponentID, dbo.Bug.ProjectID, dbo.Bug.ResolutionID, dbo.Bug.VersionID, dbo.Bug.LastUpdate, dbo.Bug.ReporterUserId,
dbo.Bug.AssignedToUserId, dbo.Bug.LastUpdateUserId, dbo.Status.Name AS StatusName, dbo.Component.Name AS ComponentName,
dbo.Priority.Name AS PriorityName, dbo.Project.Name AS ProjectName, dbo.Project.Code AS ProjectCode, dbo.Resolution.Name AS ResolutionName,
dbo.Type.Name AS TypeName, ISNULL(dbo.Version.Name, 'Unassigned') AS VersionName, ISNULL(LastUpdateUsers.UserName, N'none')
AS LastUpdateUserName, ISNULL(ReportedUsers.UserName, N'none') AS ReporterUserName, ISNULL(AssignedUsers.UserName, 'Unassigned')
AS AssignedToUserName, dbo.Bug.DueDate, dbo.Bug.FixedInVersionId, ISNULL(FixedInVersion.Name, 'Unassigned') AS FixedInVersionName,
dbo.Bug.Visibility, ISNULL
((SELECT SUM(Duration) AS Expr1
FROM dbo.BugTimeEntry AS BTE
WHERE (BugId = dbo.Bug.BugID)), 0.00) AS TimeLogged, dbo.Bug.Estimation
FROM dbo.Bug LEFT OUTER JOIN
dbo.Component ON dbo.Bug.ComponentID = dbo.Component.ComponentID LEFT OUTER JOIN
dbo.Priority ON dbo.Bug.PriorityID = dbo.Priority.PriorityID LEFT OUTER JOIN
dbo.Project ON dbo.Bug.ProjectID = dbo.Project.ProjectID LEFT OUTER JOIN
dbo.Resolution ON dbo.Bug.ResolutionID = dbo.Resolution.ResolutionID LEFT OUTER JOIN
dbo.Status ON dbo.Bug.StatusID = dbo.Status.StatusID LEFT OUTER JOIN
dbo.Type ON dbo.Bug.TypeID = dbo.Type.TypeID LEFT OUTER JOIN
dbo.Version ON dbo.Bug.VersionID = dbo.Version.VersionID LEFT OUTER JOIN
dbo.aspnet_Users AS AssignedUsers ON dbo.Bug.AssignedToUserId = AssignedUsers.UserId LEFT OUTER JOIN
dbo.aspnet_Users AS ReportedUsers ON dbo.Bug.ReporterUserId = ReportedUsers.UserId LEFT OUTER JOIN
dbo.aspnet_Users AS LastUpdateUsers ON dbo.Bug.LastUpdateUserId = LastUpdateUsers.UserId LEFT OUTER JOIN
dbo.Version AS FixedInVersion ON dbo.Bug.FixedInVersionId = FixedInVersion.VersionID
Steps to repeat:
1) Create a user account and give them access to a project to add new issues
2) Login as that user and create a new issue
3) Logout and then Login as admin and delete the new user account.
4) Navigate back through the project and you will see errors everywhere the stored procedure "BugNET_Bug_GetRecentlyAddedBugsByProject" is called.
This happens cause the view returns NULL for the ReportedUser