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...Please Help: Cannot Delete Portal!Please Help: Cannot Delete Portal!
Previous
 
Next
New Post
9/24/2008 4:34 PM
 

Hi

I have an old portal I would like to delete but I can't delete it as I get the following error:

Error: Portals is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_Tabs_Tabs". The conflict occurred in database "C:\DNNROOT\APP_DATA\DATABASE.MDF", table "dbo.Tabs", column 'ParentId'. The statement has been terminated. ---> System.Data.SqlClient.SqlException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "FK_Tabs_Tabs". The conflict occurred in database "C:\DNNROOT\APP_DATA\DATABASE.MDF", table "dbo.Tabs", column 'ParentId'. 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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues) at DotNetNuke.Data.SqlDataProvider.DeletePortalInfo(Int32 PortalId) at DotNetNuke.Entities.Portals.PortalController.DeletePortalInfo(Int32 PortalId) at DotNetNuke.Entities.Portals.PortalController.DeletePortal(PortalInfo portal, String serverPath) at DotNetNuke.Modules.Admin.Portals.Portals.grdPortals_DeleteCommand(Object source, DataGridCommandEventArgs e) --- End of inner exception stack trace ---

 

If I try and edit the site settings I get:

Error: Site Settings is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Portals.PortalSettings.GetSiteSettings(Int32 PortalId) at DotNetNuke.Modules.Admin.PortalManagement.SiteSettings.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

 

It looks like something has broken in the db but I have no idea how to address it and I think it may be causing other issues.  Any ideas/help much appreciated!

 

Thanks,

 

roadie.

 
New Post
9/24/2008 5:00 PM
 

There is a foreign key on Tabs.ParentID, which needs to refer to an existing entry in tab table or be Null. This should not prevent a portal from being deleted, but you may temporary delete it, delete the portal and readd. Please log this issue into the public issue tracker at support.dotnetnuke.com. thank you.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
9/25/2008 3:57 AM
 

Thanks for your response.  I'm not familiar with the kind of thing you're talking about and hence I don't really understand what you're telling me to do.  Can I ask you to expand a little please?

Thanks,

roadie.

 
New Post
12/16/2008 5:42 PM
 

Hi

I still have this problem.  Any more detail would be much appreciated!

Thanks in advance,

roadie.

 
New Post
12/18/2008 9:42 AM
 

Sebastian Leupold wrote

There is a foreign key on Tabs.ParentID, which needs to refer to an existing entry in tab table or be Null. This should not prevent a portal from being deleted, but you may temporary delete it, delete the portal and readd. Please log this issue into the public issue tracker at support.dotnetnuke.com. thank you.

 

We have used a SQL query (below) on our DNN database and also analysed the data in a different way to double-check and, excluding NULLS, there are no rows in Tabs where the column ParentID has a number that does not occur in TabID in a row in the same table - i.e. there do not appear to be any orphaned rows breaking FK_Tabs_Tabs.
SELECT DISTINCT ParentID FROM Tabs WHERE ParentID NOT IN (SELECT TabID FROM Tabs)

The Portal we cannot delete is visible in the Portals table with a PortalID of 0.  I did notice that the relevant row in Portals has the HomeDirectory as Portals/0 but there is no such folder on the file system - the first one in the list on the file system is _default.

Help appreciated!

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Please Help: Cannot Delete Portal!Please Help: Cannot Delete Portal!


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