I looked into the event log and got this strange duplicate primary key violation error. I had always been able to log into this portal before and I can login to all my other portals on the same installation with this same superuser. I partially solved on my production server by adding a new user and making it superuser via database but this doesn't work on my local copy because recaptcha isn't working and I can't register new users..
Is there a way to deactivate recaptcha via database without having to login to the website, since I can't do that. On my Local installation while I was playing around with the aspnetUsers table and the users table I changed something that was apparently harmless but now I can't login to ANY of my portals as host :(
I must have done something wrong. Given I can't register because recaptcha is down and I can't login as host because something must have gone very wrong when I deleted one apparently useless row in the Users table, Is there a workaround I can use in order to avoid having to restore the origina DB and go through the whole process of eliminating the portals I don't need once again?
Here is the Primary key error I got when I tried to login.
Now I can't see what the error is unless it can be done by looking directly in the database. I still have access there.
RawUrl:/Home/tabid/1644/ctl/Login/Default.aspx?returnurl=%2fHome%2ftabid%2f1644%2fDefault.aspx
Referrer:http://www.mydomain.com/Home/tabid/1644/ctl/Login/Default.aspx?returnurl=%2fHome%2ftabid%2f1644%2fDefault.aspx
UserAgent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
ExceptionHash:ztEeFTcu6GX5YT5iGkcZ1A==
Message:Violation of UNIQUE KEY constraint 'IX_Users'. Cannot insert duplicate key in object 'dbo.Users'. The duplicate key value is (email@mydomain.com). Cannot insert duplicate key row in object 'dbo.aspnet_Users' with unique index 'aspnet_Users_Index'. The duplicate key value is (a8da8e48-49ee-441d-bf3d-df2a2ce72582, email@mydomain.com). The statement has been terminated. The statement has been terminated.
StackTrace:
InnerMessage:Violation of UNIQUE KEY constraint 'IX_Users'. Cannot insert duplicate key in object 'dbo.Users'. The duplicate key value is (email@mydomain.com). Cannot insert duplicate key row in object 'dbo.aspnet_Users' with unique index 'aspnet_Users_Index'. The duplicate key value is (a8da8e48-49ee-441d-bf3d-df2a2ce72582, email@mydomain.com). The statement has been terminated. The statement has been terminated.
InnerStackTrace:
at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection. (SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at PetaPoco.Database.Execute(String sql, Object[] args)
at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteNonQuery(String connectionString, CommandType type, Int32 timeout, String sql, Object[] args)
at DotNetNuke.Data.SqlDataProvider.ExecuteNonQuery(String procedureName, Object[] commandParameters)
at DotNetNuke.Data.DataProvider.ChangeUsername(Int32 userId, String newUsername)
at DotNetNuke.Security.Membership.AspNetMembershipProvider.ChangeUsername(Int32 userId, String newUsername)
at DotNetNuke.Modules.Admin.Authentication.Login.OnLoginClick(Object sender, EventArgs e)
at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)