Missing module dependency

Hey!

When testing the 5.6 branch, I came across a weird error, where the OnlineSubsystemSteam module failed to load because its plugin dependency SteamShared wasn’t loaded.

My uproject has a mandatory dependency on a uplugin, which in turn depends OnlineSubsystemSteam, which correctly marks SteamShared as a plugin dependency.

After debugging, it turns out that the plugin was marked disabled because EOSShared.uplugin indicated SteamShared as “Enabled”: false, by this commit: https://github.com/EpicGames/UnrealEngine/commit/77521afaaadb7c0171e13843428be4e402c2bcbb

Now I would have expected that the plugin dependency lookup to sort this inconsitency, and to enable the plugin, but it doesn’t, and that is caused by the loop in FPluginManager::ConfigureEnabledPluginForTarget.

The code here https://github.com/EpicGames/UnrealEngine/blob/803688920e030c9a86c3659ac986030fba963833/Engine/Source/Runtime/Projects/Private/PluginManager.cpp\#L2379 goes like this:

This causes the dependency to be missing, and the error on startup.

As a fix, I’ve commented out the test of bIsNewlySeen to force reconsidering the dependency and it works fine:

// UE_5_6_DIFF - re-add the plugin even if already seen, as it could have been added disabled by another plugin if (!EnabledPlugins.Contains(NextReference.Name)/* && bIsNewlySeen*/) // ~UE_5_6_DIFF { NewPluginQueue.Add(&NextReference); }

Would be great to see this fixed upstream.

Thanks,

Lambert

Steps to Reproduce

  • Create a new project
  • Create a plugin named “Backend” (for instance)
  • Add the plugin as a dependency to the project
  • Add OnlineSubsystemSteam as a dependency to the plugin

{ "Name": "OnlineSubsystemSteam", "Enabled": true, "SupportedTargetPlatforms": [ "Win64" ], "PlatformAllowList": [ "Win64" ] },* Start the editor with -game on the project, and you’ll get this popup

[Image Removed]

Hey, thanks for reaching out and thank you for providing detailed information. Do you have this in your .ini file?

# this forces OnlineSubsystemSteam to be loaded before EOS so that we have the steam DLL loaded and initialized for EOS to use [OnlineSubsystem] bLoadNativeOSSBeforeDefault=true

Hey Seb!

Thanks for the quick answer. I do not have it set, and setting it does not help.

Can you share your .ini?

Not easily, but made a small repro project on the official 5.6 release, just build the solution and try to open Unreal Editor, you’ll get the error :slight_smile:

Thank you for the project. I can reproduce the issue. I don’t think this is a bug in the engine code, but an issue somewhere with plugin dependencies. I’m honestly scratching my head pinpointing the exact root cause, but I do have some workarounds you can use to avoid having a code change in the engine for this. In the project you sent me, in EasyPlugin.uplugin you could set EOSShared to false, or remove the entry in the Plugins array - assuming you have other plugins enabled that enable EOSShared. That will prevent the issue from happening, SteamShared and OnlinSubsystemSteam will initialize correctly. I’m confused why having it enabled in this .uplugin causes an issue.

"Plugins": [ { "Name": "Backende", "Enabled": true }, { "Name": "EOSShared", "Enabled": false } ] }Alternatively, add SteamShared to EasyPlugin.uplugin and mark it as enabled.

"Plugins": [ { "Name": "Backende", "Enabled": true }, { "Name": "SteamShared", "Enabled": true }, { "Name": "EOSShared", "Enabled": true } ] }I’m still trying to figure out what the “right” fix is here. If you have an idea where the dependency issue is, please let me know. If this ends up being an engine bug, we’ll get it fixed. If it’s a config issue around plugin dependency I’ll at least write a KB article to make this info more visible.

Thanks for the answer, and for the workarounds. I don’t mind the engine change, in fact, I already submitted the fix I proposed in the OP (commenting out the bIsNewlySeen).

I do believe that the engine is at fault here, and a possible better fix would be to change the if that sets bIsNewlySeen to true, and only set it to true if the values of the FPluginReferenceDescriptor we have truly match the previous one (especially the bEnabled bool).