Copied to clipboard

Flag this post as spam?

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

  • stiansol 11 posts 20 karma points
    Jun 05, 2009 @ 12:47

    Violation of PRIMARY KEY constraint 'PK_umbracoAppTree'. Cannot insert duplicate key in object 'dbo.

    I have a 3.0.6 which I try to upgrade to latest
    I've followed the upgrade instructions found at

    But I keep getting an error:
    Violation of PRIMARY KEY constraint 'PKumbracoAppTree'. Cannot insert duplicate key in object 'dbo.umbracoAppTree'.
    The statement has been terminated.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK
    umbracoAppTree'. Cannot insert duplicate key in object 'dbo.umbracoAppTree'.
    The statement has been terminated.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PKumbracoAppTree'. Cannot insert duplicate key in object 'dbo.umbracoAppTree'.
    The statement has been terminated.]
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +248
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1357
    System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +2956783
    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +479
    System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +203
    Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) +89
    Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +105
    umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) +43
    umbraco.DataLayer.SqlHelper1.ExecuteNonQuery(String commandText, IParameter[] parameters) +88<br /> <br /> [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]<br /> umbraco.DataLayer.SqlHelper1.ExecuteNonQuery(String commandText, IParameter[] parameters) +202
    umbraco.DataLayer.Utility.Installer.DefaultInstallerUtility`1.ExecuteStatements(String statements) +272
    umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerInstaller.Install() +235
    Click(Object sender, EventArgs e) +44
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +131
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +39
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3215

    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

    One thing also to note, is that I received the error message
    [code]Invalid column name 'defaultToLiveEditing'
    [/code] first. Read about the recommendation for this issue here:

    But it seems my database is out of sync? What is the best way to get it in-sync again?
    Anyone know what this is caused by?

  • Douglas Robar 3570 posts 4670 karma points MVP 6x admin c-trib
    Jun 05, 2009 @ 15:35
    Douglas Robar

    In your web.config, remove any value in the line.

    Then go to your site and the web-based umbraco installer will run. This will get you past the 'defaultToLiveEditing' problem, and may well get you beyond the rest of the issues as well.

    If you continue to have problems, let us know what files you've copied, updated, etc.


  • stiansol 11 posts 20 karma points
    Jun 05, 2009 @ 15:56

    I've removed the value in the line.
    Also I removed the column in the database (which I earlier added) defaultToLiveEditing on the umbracoUser table.

    Doing this doesn't give me a good feeling, but it is in a testing environment luckily... ](*,)

    So what can be the next step?
    Thanks so far for your help.
    The one who manages to help us with this, I will give a free license of Gaia Ajax (worth $195) :-$


  • Arnim Anhut 137 posts 148 karma points
    Jun 22, 2009 @ 16:11
    Arnim Anhut

    I'm faced with the same 'PK_umbracoAppTree' issue updateing from 3.0.6 to</p> <p>Any clue what could help?</p> <p>Greets, Arnim.</p>

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jul 22, 2009 @ 23:28
    Thomas Höhler

    I had the same problem with an old installation I upgraded without RTF. So finally it helped that I changed the umbracoConfigurationStatus to (the actual version). Then I took the sql script out of the umbraco source code (umbraco.datalayer.sqlhelpers.sqlserver.sql.version_3_upgrade.sql) and run it via SQL Server manager. Afterwards I had to save one template to get the masterpages and replace old </?aspnet_form> tags with </form>. Then I had to republish the complete site.

    hth, Thomas

  • Richard 146 posts 168 karma points
    Mar 01, 2011 @ 15:50

    Just a note, as I have just had the same problem on upgrading an Umbraco v3.0.5 site to To overcome the problems I removed the version number from the web.config, as Douglas suggested, and to overcome the PK_umbracoAppTree error, remove from the database table umbracoAppTree the two rows, one with appAlias 'developer' and treeAlias 'packager', the other with appAlias 'developer' and treeAlias 'packagerPackages'. The install SQL script does a insert of these two records:

    INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'packager', 0, 1, 1, N'Packages', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadPackager') 
    INSERT INTO [umbracoAppTree] ([appAlias], [treeAlias], [treeSilent], [treeInitialize], [treeSortOrder], [treeTitle], [treeIconClosed], [treeIconOpen], [treeHandlerAssembly], [treeHandlerType]) VALUES (N'developer', N'packagerPackages', 0, 0, 1, N'Packager Packages', N'.sprTreeFolder', N'.sprTreeFolder_o', N'umbraco', N'loadPackages')
Please Sign in or register to post replies

Write your reply to: