Upgrading BugNET from 0.9.152.0 to 0.9.161.0 failed

Topics: Installing BugNET
Jul 28, 2012 at 7:19 AM

Hi

I upgraded my website files, browsed to the upgraded website, and got this message:

Upgrading BugNET
Upgrade Status Report
Current Assembly Version: 0.9.161.0
Current Database Version: 0.9.152.0
00:00:00.7700010 - Upgrading To Version: 0.9.161.0

Error: Database Error
Upgrade Failed!

I took a look in the [dbo].[BugNet_ApplicationLog] table and see messages corresponding to my upgrade attempt:

System.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'UserId', table 'tregonni_BugNET.dbo.BugNet_UserRoles'; column does not allow nulls. INSERT fails.  The statement has been terminated.
     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
     at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
     at System.Data.SqlClient.SqlDataReader.get_MetaData()
     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
     at System.Data.SqlClient.SqlCommand.ExecuteScalar()
     at BugNET.Providers.DataProviders.SqlDataProvider.ExecuteScalarCmd(SqlCommand sqlCmd)
     at BugNET.Providers.DataProviders.SqlDataProvider.AddUserToRole(String userName, Int32 roleId)

How should I proceed?

Cheers,
Andrew

 


Jul 28, 2012 at 7:57 AM

Solved my own problem. I downloaded the source code, and looking through the upgrade code saw that the "Admin" username was hardcoded. I had renamed my Admin user when I first installed BugNET. I changed it back to Admin, and the upgrade succeeded.

Cheers,
Andrew