Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SQL script error upgrading from 4.5.0 to 4.8.0SQL script error upgrading from 4.5.0 to 4.8.0
Previous
 
Next
New Post
1/12/2008 12:58 PM
 

Hi,

I tried doing a test upgrade from 4.5.0 to 4.8.0 on my local machine (using the db backup from the live site) and I got the error below.  It's in the 04.06.00.log file.  Does anyone have an idea of what the problem is here?

Norman

****************************

 

System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ModuleID', table 'clearcanvas.dbo.easycgi_dnn_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.easycgi_dnn_Modules MI
                    INNER JOIN dbo.easycgi_dnn_ModuleDefinitions MDef ON MI.ModuleDefID = Mdef.ModuleDefID
                WHERE (MI.PortalID = m.PortalID) AND (MDef.FriendlyName = 'Authentication'))
            AS AuthModuleID
        FROM dbo.easycgi_dnn_Modules AS m
            INNER JOIN dbo.easycgi_dnn_ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
        WHERE (md.FriendlyName = N'User Accounts')
            AND PortalID IS NOT NULL

    UPDATE dbo.easycgi_dnn_ModuleSettings
        SET ModuleID = a.AuthModuleID,
            SettingName = 'DNN_UseCaptcha'
    FROM dbo.easycgi_dnn_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

 

 
New Post
1/12/2008 1:29 PM
 

Do you have a module called "easycgi"?  It looks like that module was put into the upgrade and it failed due to it passing a NULL value to the ModuleSettings.ModuleId field.  The ModuleSettings table does not allow NULL values for that field for obvious reasons.  


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
1/12/2008 2:09 PM
 

Hi,

Thanks for the reply.  I don't believe I have a module called easycgi.  easycgi is just the table prefix that my hosting provider (Easy CGI) attaches to each table.  My knowledge of SQL is sadly quite basic and I'm not sure exactly what this script is supposed to do.  Would you happen to know what it's trying to do?

Norman

 
New Post
1/12/2008 2:50 PM
 

Now that I look at your SQL more closely, I see what you mean.  Their #AuthModules temp table contains some records that have NULL values for the ModuleId.  While there are not supposed to be NULL values for the ModuleId, you can easily get the script to run error free by ammending it to the following example:

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.easycgi_dnn_Modules MI
                    INNER JOIN dbo.easycgi_dnn_ModuleDefinitions MDef ON MI.ModuleDefID = Mdef.ModuleDefID
                WHERE (MI.PortalID = m.PortalID) AND (MDef.FriendlyName = 'Authentication'))
            AS AuthModuleID
        FROM dbo.easycgi_dnn_Modules AS m
            INNER JOIN dbo.easycgi_dnn_ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
        WHERE (md.FriendlyName = N'User Accounts')
            AND PortalID IS NOT NULL

    UPDATE dbo.easycgi_dnn_ModuleSettings
        SET ModuleID = a.AuthModuleID,
            SettingName = 'DNN_UseCaptcha'
    FROM dbo.easycgi_dnn_ModuleSettings s
        LEFT JOIN #AuthModules a ON a.ModuleID = s.ModuleID
    WHERE SettingName = 'Security_CaptchaLogin'
        AND a.PortalID IS NOT NULL AND a.AuthModuleID IS NOT NULL

    -- Drop temp table
    DROP TABLE #AuthModules

END

However, this does not address the true issue.  You will really need to figure out why there are NULL values for the ModuleId.  The first step to understanding this would be to look at the data in the easycgi_dnn_ModuleSettings, easycgi_dnn_Modules, and easycgi_dnn_ModuleDefinitions tables.  If you do not see any NULL values for ModuleId in any of those tables, then there is a problem with the query you posted.


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
1/12/2008 4:22 PM
 

Hi,

Thanks again for taking the time to help.  I executed the following to see what the true issue is:

SELECT ModuleID
FROM dbo.easycgi_dnn_Modules MI
INNER JOIN dbo.easycgi_dnn_ModuleDefinitions MDef ON MI.ModuleDefID = Mdef.ModuleDefID
WHERE (MDef.FriendlyName = 'Authentication'))

It returns null, which explains my problem.  Question is why.  It seems that it's looking for module definition in the Module Definition table whose friendly name is "Authentication".  It finds it, but then when it tries to find the corresponding Module Definition ID in the Modules table, it doesn't find it, and so the query returns null.  I noticed that the "Authentication" module wasn't present in my old 4.5.0 database; it was called "Windows Authentication" in that version, so it appears that the script added it.  Might this be a bug?

Norman

 

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...SQL script error upgrading from 4.5.0 to 4.8.0SQL script error upgrading from 4.5.0 to 4.8.0


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out