question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to Upgrade to Umbraco 8.18.7 Due to "Broken composer dependency" Error

See original GitHub issue

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

8.18.7

Bug summary

When upgrading from Umbraco 8.18.5 to EITHER Umbraco 8.18.6 or Umbraco 8.18.7 (the ones with the recent security patches), I get a “Broken composer dependency” error.

Specifics

After I upgrade the Umbraco NuGet packages, I attempt to run the site but I get a YSOD with the following error shown on screen when I attempt to visit /umbraco/ (probably all other URLs too, but I didn’t try):

Server Error in '/' Application.
Boot failed: Umbraco cannot run. See Umbraco's log file for more details.

-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.

-> System.Exception: Broken composer dependency: MyProject.UmbracoCms.Core.uSync.Publishers.SignalRFix.Composer -> uSync.Publisher.uSyncPublishComposer.
  at Umbraco.Core.Composing.Composers.GatherRequirementsFromAfterAttribute(Type type, ICollection`1 types, IDictionary`2 requirements, Boolean throwOnMissing) in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 334
  at Umbraco.Core.Composing.Composers.GetRequirements(Boolean throwOnMissing) in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 189
  at Umbraco.Core.Composing.Composers.PrepareComposerTypes() in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 108
  at Umbraco.Core.Composing.Composers.Compose() in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 86
  at Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer) in D:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:line 198
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: Umbraco.Core.Exceptions.BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.

-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.

-> System.Exception: Broken composer dependency: MyProject.UmbracoCms.Core.uSync.Publishers.SignalRFix.Composer -> uSync.Publisher.uSyncPublishComposer.
  at Umbraco.Core.Composing.Composers.GatherRequirementsFromAfterAttribute(Type type, ICollection`1 types, IDictionary`2 requirements, Boolean throwOnMissing) in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 334
  at Umbraco.Core.Composing.Composers.GetRequirements(Boolean throwOnMissing) in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 189
  at Umbraco.Core.Composing.Composers.PrepareComposerTypes() in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 108
  at Umbraco.Core.Composing.Composers.Compose() in D:\a\1\s\src\Umbraco.Core\Composing\Composers.cs:line 86
  at Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer) in D:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:line 198

Of note is that I recently upgraded to Umbraco 8.18.15 and I didn’t encounter this issue then, so it seems like it was something introduced pretty recently (maybe even the security patches themselves).

FYI, the class from the top of the error details above looks like this:

using Umbraco.Core;
using Umbraco.Core.Composing;
using uSync.Publisher;
using uSync.Publisher.Publishers;

namespace MyProject.UmbracoCms.Core.uSync.Publishers.SignalRFix
{
    [ComposeAfter(typeof(uSyncPublishComposer))]
    public class Composer : IComposer
    {
        public void Compose(Composition composition)
        {
            composition.RegisterUnique<USyncServerHubConnectionFactory>();

            composition
                .WithCollectionBuilder<SyncStepPublisherCollectionBuilder>()
                .Exclude<SyncRealtimePublisher>();
        }
    }
}

The upgrade actually works if I change that ComposeAfter attribute to [ComposeAfter(typeof(uSyncPublishComposer), true)] (I don’t actually fully understand the implications of this change). I can then revert that change after I run through the Umbraco upgrade process and the site works fine. However, I don’t want to have to do this each time I upgrade Umbraco, so a long term fix would be ideal.

Steps to reproduce

In theory, you should be able to create this issue by following these steps:

  • Install Umbraco 8.18.5.
  • Run through the install process to make sure it’s fully installed.
  • Install uSync 8.10.6 (see screenshot below for more potential uSync packages to install).
  • Create the Composer class like below.
  • Attempt to upgrade Umbraco 8.18.7 (or 8.18.6).
  • You should see the YSOD with the “Broken composer dependency” error.

Here are all the uSync NuGet packages I have installed for reference:

usync-dependencies

Here is the Composer class:

using Umbraco.Core;
using Umbraco.Core.Composing;
using uSync.Publisher;
using uSync.Publisher.Publishers;

namespace MyProject.UmbracoCms.Core.uSync.Publishers.SignalRFix
{
    [ComposeAfter(typeof(uSyncPublishComposer))]
    public class Composer : IComposer
    {
        public void Compose(Composition composition)
        {
            // Probably doesn't matter what's in this method.
        }
    }
}

Expected result / actual result

I would expect that composers would not cause issues during an Umbraco upgrade, but the actual result is that this composer does cause an issue during an Umbraco upgrade (though, strangely, not outside of the upgrade process).

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KevinJumpcommented, Apr 14, 2023

I think @kjac is right IUserComposer has a runtime level restriction on it, so the composers are only added when the level is run.

1reaction
kjaccommented, Apr 14, 2023

Awesome 👍 glad we figured out a solution. It seems curious that the uSync composers aren’t marked with an explicit runtime, since it really does seem like they’re utilizing one. Perhaps Kevin did some other registration magic somewhere. Or maybe IUserComposer is considered only for runtime level in V8, I truly don’t remember 😄

I’ll go ahead and close this issue now. Thanks again for reporting 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

unable to upgrade to umbraco 8187 due to broken ...
In short, I'm on Umbraco 8.18.5 and have various uSync packages installed (linked ticket mentions versions) and was unable to upgrade to Umbraco...
Read more >
Forum
Unable to Upgrade to Umbraco 8.18.7 Due to "Broken composer dependency " Error ... Forms Error from out of the blue: Empty due...
Read more >
uSync
Unable to Upgrade to Umbraco 8.18.7 Due to "Broken composer dependency " ... uSync publisher on linux : Error while processing Push -...
Read more >
Kevin Jump
Unable to Upgrade to Umbraco 8.18.7 Due to "Broken composer dependency " ... Translation Manager broken in backoffice ... Error during pushing to...
Read more >
upgrade umbraco 7 to umbraco 8 autofac is not working
Now I am getting issue with Dependency Container builder e.g.: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found