LOCKED OUT! I can't login to 2 separate DNN sites due to the following error when I click the Login link on the Home page.
A critical error has occurred.
Object reference not set to an instance of an object.
I just upgraded both sites from 4.5.3 to 4.8.4. (I have multiple other sites that I have upgraded to 4.8.4 without issues but none of those were running 4.5.3)
Both sites had the same error when processing the changes for 4.6.0. The error in the LOG file is as follows:
*************************************************************************************
System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ModuleID', table 'Enterprise_Web_NYF01.dbo.ModuleSettings'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL)
at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions)
/* Update UseCaptcha Settings to use the Authentication Module instead of User Accounts */
/****************************************************************************************/
BEGIN
CREATE TABLE #AuthModules
(
ModuleID int,
PortalID int,
AuthModuleID int
)
-- Insert into our temp table
INSERT INTO #AuthModules (ModuleID, PortalID, AuthModuleID )
SELECT
m.ModuleID,
m.PortalID,
(SELECT ModuleID
FROM dbo.Modules MI
INNER JOIN dbo.ModuleDefinitions MDef ON MI.ModuleDefID = Mdef.ModuleDefID
WHERE (MI.PortalID = m.PortalID) AND (MDef.FriendlyName = 'Authentication'))
AS AuthModuleID
FROM dbo.Modules AS m
INNER JOIN dbo.ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
WHERE (md.FriendlyName = N'User Accounts')
AND PortalID IS NOT NULL
UPDATE dbo.ModuleSettings
SET ModuleID = a.AuthModuleID,
SettingName = 'DNN_UseCaptcha'
FROM dbo.ModuleSettings s
LEFT JOIN #AuthModules a ON a.ModuleID = s.ModuleID
WHERE SettingName = 'Security_CaptchaLogin'
AND a.PortalID IS NOT NULL
-- Drop temp table
DROP TABLE #AuthModules
END
************************************************************************************
Any ideas?