Copied to clipboard

Flag this post as spam?

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


  • Luke Maslany 6 posts 74 karma points
    Jul 09, 2019 @ 13:07
    Luke Maslany
    0

    Migration Error - Cannot insert duplicate key row in object 'dbo.cmsMacro'

    I've recently been tasked with the maintenance of two Umbraco instances and I've been working my way through the logs to resolve outstanding issues.

    I should probably note in advance however that despite the logs showing errors the navigation of the sites does not seem to be impeded.

    I'm currently stumped by what appears to be a recurring migration attempt on one of the Umbraco sites.

     2019-07-09 13:34:05,628 [P5172/D3/T75] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Exception (e28d1cd9).
    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.cmsMacro' with unique index 'IX_cmsMacroPropertyAlias'. The duplicate key value is (renderUmbracoForm).
    The statement has been terminated.
    

    I have checked the [cmsMacro] table in the Umbraco database and can see that there is already a row containing the macroAlias 'renderUmbracoForms'. (macroAlias being the sole index key for the index IX_cmsMacroPropertyAlias).

    From my searches so far this appears to be the result of Umbraco attempting to perform/resume a migration.

    One of the suggestions was to ensure that the umbracoConfigurationStatus in the web.config file was not being overwritten by a transform of any kind.

    I have checked this and it does not seem to be the issue for me. Web.config is showing version 7.12.1.

    Querying the [umbracoMigration] table in the Umbraco database for the affected instance shows:

    id  name    version createDate
    1   Umbraco 7.5.4   2016-12-06 09:30:48.247
    2   Umbraco 7.5.7   2017-01-16 12:10:28.237
    3   Umbraco 7.9.2   2018-04-26 10:08:46.280
    4   Umbraco 7.12.1  2018-09-06 10:18:04.840
    

    This seems to align with the version information the web.config file.

    Enabling log debugging however shows alternate version numbers:

    DEBUG Umbraco.Forms.Web.Migrations.MigrationEvents - Versions: this=7.0.3, installed=0.0.0
    

    It was at this point I realised I need a better understanding of how Umbraco tracks its version, whether it has migration tasks outstanding, and where those migration tasks are located.

    Would anyone be able to point me in the right direction?

    Many thanks,

  • Sebastiaan Janssen 4850 posts 14396 karma points MVP admin hq
    Jul 10, 2019 @ 08:13
    Sebastiaan Janssen
    0

    You'll need v 8.1.1 of Forms to be able to upgrade (download here https://our.umbraco.com/packages/developer-tools/umbraco-forms/).

    So hopefully this error goes away when you update Forms!

  • Luke Maslany 6 posts 74 karma points
    Jul 10, 2019 @ 08:22
    Luke Maslany
    0

    Thanks for the link Sebastiaan.

    The version info on that page though suggests that Forms version 8.x requires Umbraco version 8.0+?

    Does that mean we'd need to upgrade our affected Umbraco instance before we can upgrade our Forms version?

    Cheers, Luke M.

  • Sebastiaan Janssen 4850 posts 14396 karma points MVP admin hq
    Jul 10, 2019 @ 08:50
    Sebastiaan Janssen
    0

    Ah sorry, I thought you were migrating to v8!

    Ignore me 🙈

  • Luke Maslany 6 posts 74 karma points
    Jul 10, 2019 @ 08:52
    Luke Maslany
    0

    No problem. :)

    I suspect that we're going to be stuck on 7.x for a while yet. I'm just keen to clear any potential blockers for when we do look to migrate.

  • Sebastiaan Janssen 4850 posts 14396 karma points MVP admin hq
    Jul 10, 2019 @ 08:55
    Sebastiaan Janssen
    0

    Anyway, Forms migrations are different from core migrations. I would definitely go with Form s 7.1.1 instead of the 7.0.3 that you have now. And of course with 7.15.0 out now I would recommend you update to that one as well. :)

  • Luke Maslany 6 posts 74 karma points
    Jul 10, 2019 @ 09:41
    Luke Maslany
    0

    Ah - so does the debugging line mean it is attempting to 'upgrade' Forms from 0.0.0 (which I assume means it isn't installed) to version 7.0.3?

    DEBUG Umbraco.Forms.Web.Migrations.MigrationEvents - Versions: this=7.0.3, installed=0.0.0
    
  • Sebastiaan Janssen 4850 posts 14396 karma points MVP admin hq
    Jul 10, 2019 @ 10:07
    Sebastiaan Janssen
    0

    Probably just a bug in Forms, try the latest version and see if it's fixed :)

Please Sign in or register to post replies

Write your reply to:

Draft