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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...SQL insert errors on all of my sitesSQL insert errors on all of my sites
Previous
 
Next
New Post
7/16/2014 7:55 PM
 

I have a bunch of sites running with a hosting company, recently I had 2 sites restored due to corruption of their databases. Today I had a support call from a client saying that they cannot add a page to their site as it throws an error. I tested this and go the same thing. I then checked all the other sites I have running on that same system with the same problem, if I try to insert a page or a module onto a page it throws an SQL exception. Site version range from old 5.6.3 through to 6.2. 

Given that this is a problem with all of my sites I assume its a database server issue? Does anyone understand what may be wrong?

Here is an example:

Error: is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Cannot insert the value NULL into column 'TabOrder', table 'XXXXXXXXXXXXXXX.dbo.Tabs'; column does not allow nulls. INSERT fails. The statement has been terminated. ---> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'TabOrder', table 'XXXXXXXXXXXXXXX.dbo.Tabs'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection. (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.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 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues) at DotNetNuke.Data.SqlDataProvider.AddTab(Int32 ContentItemId, Int32 PortalId, Guid UniqueId, Guid VersionGuid, Guid DefaultLanguageGuid, Guid LocalizedVersionGuid, String TabName, Boolean IsVisible, Boolean DisableLink, Int32 ParentId, String IconFile, String IconFileLarge, String Title, String Description, String KeyWords, String Url, String SkinSrc, String ContainerSrc, String TabPath, DateTime StartDate, DateTime EndDate, Int32 RefreshInterval, String PageHeadText, Boolean IsSecure, Boolean PermanentRedirect, Single SiteMapPriority, Int32 CreatedByUserID, String CultureCode) at DotNetNuke.Entities.Tabs.TabController.AddTabInternal(TabInfo objTab, Boolean includeAllTabsModules) at DotNetNuke.Entities.Tabs.TabController.AddTabAfter(TabInfo objTab, Int32 afterTabId) at DotNetNuke.Modules.Admin.Tabs.ManageTabs.SaveTabData(String strAction) at DotNetNuke.Modules.Admin.Tabs.ManageTabs.cmdUpdate_Click(Object Sender, EventArgs e) --- End of inner exception stack trace ---

 
New Post
7/16/2014 9:06 PM
 
My guess would be that the restored database and the code are at different versions.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
7/16/2014 9:52 PM
 
Thanks Richard, I'm not sure this would be it, most of the sites are as they were installed and no upgrades were run so the database version should be the same as the code base. I've tried copying one of the databases to another server but I get the same errors trying to add a page or insert a module. It's over about 8 websites all at once.
 
New Post
7/16/2014 10:18 PM
 
Well that error does not really suggest a database server issue. Your site is clearly connecting to SQL and trying to make an update (recording the new page) or you would not see this error.

I cannot see any way this can not be a version mismatch.

I know that the latest (7.2) database structure forbids NULLS in the TabOrder column. I can only assume that some prior versions used to allow nulls. Suppose it was changed at version X. For this error to happen, the only way I can see is to have Pre-X code (it believes that column allows nulls) hitting a Post-X database (which rejects the null).

You can interrogate the database to see what version it thinks it is. You need to select * from dbo.Version and look for the highest numbers in there. You can look at the properties of DotNetNuke.dll to see what version the code thinks it is.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
7/16/2014 11:54 PM
 

OK so tried that and got this result on one of the sites:

Highest version in the database is 5.6.3
DotNetNuke.dll version is 5.6.3.45

Am still investigating this but any further info/help would be fantastic as it involves around 8 sites on different versions of DNN.

Further to this can update an existing record. I get an insert error if I try to add a user to the portal so creating records wont work.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...SQL insert errors on all of my sitesSQL insert errors on all of my sites


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