Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ricky Beard 61 posts 116 karma points
    Oct 21, 2010 @ 18:33
    Ricky Beard
    0

    MySql Problem

    I am trying to deploy an Umbraco site running on MySql using these steps:

    1. Backup local DB
    2. Restore DB to production server

    Everything looks correct in the Umbraco admin. However, I get the following error when trying to publish/republish any content:

    [MySqlException (0x80004005): Cannot add or update a child row: a foreign key constraint fails (`518334_solomon/CMSPROPERTYDATA`, CONSTRAINT `cmspropertydata_ibfk_1` FOREIGN KEY (`CONTENTNODEID`) REFERENCES `umbraconode` (`ID`))]
       MySql.Data.MySqlClient.MySqlStream.OpenPacket() +238
       MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) +60
       MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() +49
       MySql.Data.MySqlClient.MySqlDataReader.NextResult() +484
       MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +839
       MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +43
       MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters) +122
       MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(String connectionString, String commandText, MySqlParameter[] parms) +80
       umbraco.DataLayer.SqlHelpers.MySql.MySqlHelper.ExecuteNonQuery(String commandText, MySqlParameter[] parameters) +57
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +140
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +221
       umbraco.cms.businesslogic.property.Property.MakeNew(PropertyType pt, Content c, Guid versionId) +491
       umbraco.cms.businesslogic.Content.addProperty(PropertyType pt, Guid versionId) +78
       umbraco.cms.businesslogic.Content.createNewVersion() +454
       umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) +418
       umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +306
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +96
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
       System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

    I cannot find any problems/duplicates in the data. The DB is the exact same as my working local copy.

  • devtage 12 posts 32 karma points
    Apr 22, 2011 @ 03:00
    devtage
    0

    I am having exactly the same problem. Same as above, no change in the DB everything is the same.

    Please help!!!!

     

    Thanjks.

  • devtage 12 posts 32 karma points
    Apr 22, 2011 @ 22:18
    devtage
    0

    Hi Ricky,

    I was able to fix this issue after spending clode to 3 days, hopefully my fix works for you:

     

    I was actually doing a reverse of you activity: recreating my crashed local box with content and data from Producton.

    Here is where things got interesting: My LocalDB is Windows while Production DB is Linux. In trying to maintain the compatibility i set the mysql option lower_case_table_names = 2 (to maintain case sensitivity). With this setting i kept having the FOREIGN KEY ERROR.

    I changed to lower_case_table_names = 1, restarted my MYSQL engine, recreated the whole Schema (database) and pronto! My LocalDB worked perfect!

    Not sure if you havng different platform for your production and local DB as i do, that would be the first place i would check.

     

    GB Oladeji.

Please Sign in or register to post replies

Write your reply to:

Draft