Problem with database after upgrading fom 0.9 to 1.0

Topics: Installing BugNET
Aug 8, 2012 at 8:00 AM
Edited Aug 8, 2012 at 8:04 AM

Hello,

Yesterday I have upgraded my Bugnet from 0.9 to 1.0. I received an information that the database is in new version, so it seemed to be ok, however when I try to open Default.aspx I receive the following error:

 

Invalid object name 'BugNet_P1_CFV'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'BugNet_P1_CFV'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Invalid object name 'BugNet_P1_CFV'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +59
   System.Data.SqlClient.SqlDataReader.get_MetaData() +118
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6387937
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6389506
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +256
   System.Data.SqlClient.SqlCommand.ExecuteReader() +291
   BugNET.Providers.DataProviders.SqlDataProvider.ExecuteReaderCmd(SqlCommand sqlCmd, GenerateListFromReader`1 gcfr, List`1& list) +162
   BugNET.Providers.DataProviders.SqlDataProvider.PerformQuery(List`1 queryClauses, ICollection`1 sortFields, Int32 projectId) +3129

[DataAccessException: Database Error]
   BugNET.Providers.DataProviders.SqlDataProvider.PerformQuery(List`1 queryClauses, ICollection`1 sortFields, Int32 projectId) +3571
   BugNET._Default.rptProject_ItemDataBound(Object sender, RepeaterItemEventArgs e) +2104
   System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +204
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +627
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +167
   BugNET._Default.Page_Load(Object sender, EventArgs e) +689
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

 

 

What's more: I can see MyIssues, but when I try to open any of them I receive the following error:

 

IssueCount

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: IssueCount

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[IndexOutOfRangeException: IssueCount]
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +308
   BugNET.Providers.DataProviders.SqlDataProvider.GenerateCategoryListFromReader(IDataReader returnData, List`1& categoryList) +379
   BugNET.Providers.DataProviders.SqlDataProvider.ExecuteReaderCmd(SqlCommand sqlCmd, GenerateListFromReader`1 gcfr, List`1& list) +179
   BugNET.Providers.DataProviders.SqlDataProvider.GetCategoriesByProjectId(Int32 projectId) +316
   BugNET.BLL.CategoryTree.GetCategoryTreeByProjectId(Int32 projectId) +101
   BugNET.Issues.IssueDetail.BindOptions() +327
   BugNET.Issues.IssueDetail.BindValues(Issue currentIssue) +110
   BugNET.Issues.IssueDetail.Page_Load(Object sender, EventArgs e) +1664
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   BugNET.UserInterfaceLayer.BasePage.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

 What might be the cause?

Aug 8, 2012 at 2:12 PM

Were there any errors when upgrading?

The upgrade should take care of creating those custom views although there may be unforeseen circumstances that caused it to fail but you would have seen an error in the upgrade.

Aug 8, 2012 at 3:21 PM

If you log in as a Super User you can enter tha address /Administration/Projects/ProjectList.aspx there will be a button to re-generate the custom views, if when doing this you receive an exception there might be a character in the special field name that may be causing the the issue.  So far the only characters that I found where an issue were [ & ].  If you have these characters you can try changing them to ( & ).

Also the new custom field logic will only work on SQL Server versions that support the PIVOT keyword (2005+).  If you are running on 2000 you will have to restore to your previous version.

Aug 8, 2012 at 4:46 PM

When I was using last 0.9 version everything was correct, but after the upgrade to 1.0 (I replaced old files with the new ones) those errors appeared. I did not change anything in views (they are exactly the same as original views). I was trying to set the database on MS SQL Server Express 2012 and MS SQL Server 2008 R2 and the result is exactly the same.