Plugin randomly fail to load during cooking

Hi there!

We’re encountering random errors during cooking, we’re hoping we could get some help figuring out what’s the issue.

While packaging our project using RunUAT, it occasionally fails during cooking due to plugin failing to load/module not found. The error snippet is as follows, but I also have attached the logs below.

“LogPluginManager: Error: Plugin ‘MetCameraSystem’ failed to load because module ‘MetCameraSystem’ could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.”

Things we have tried to do:

  • built with -clean param (used to work whenever we have this issue, now no longer)
  • manually deleted all binaries and intermediates of plugin
  • checked module referencing
  • plugin loading phase is default

Additional context:

  • it’s not consistently the same plugin, sometimes it changes
  • no issues prior when we were using 5.2 (only occured after upgrade to 5.6)
  • editor runs fine and cooks fine if done through the editor

The RunUAT script we’re using:

“RunUAT.bat” BuildCookRun -project=“%PROJECT_NAME%” -clean -archive -archivedirectory=“%ARCHIVE_DIR%” -configuration=Development -unrealexe=UnrealEditor.exe -targetplatform=Win64 -build -compile -cook -fastcook -stage -package -pak -prereqs -utf8output -nocompileeditor -AdditionalCookerOptions=“-cookprocesscount=4”

Thanks!

Your BuildCookRun commandline includes -nocompileeditor, which means it is trying to use the UnrealEditor.exe and dlls created from an earlier build step.

If you remove -nocompileeditor from the commandline, RunUAT will compile it. In most cases it will already be built and this will waste a few seconds detecting that nothing needs to be built, but I expect in your failure case it will solve the issue and compile what is necessary.

Does removing -nocompileeditor fix the issue?

If so, then as a follow-up issue, you should investigate why the .dll for the plugin is going missing from the earlier build step. If you can fix that issue, then you can restore the addition of -nocompileeditor to avoid spending those few extra seconds to run the nothing-needs-to-be-built compile.

One likely reason for the failure is that you are building a different project, or a different configuration of your project with some plugins turned off, in between the earlier build step that compiles the editor and the RunUAT step. When the editor is built for a project, it writes receipt files that list the dlls available to the editor, so building for a different project or a different configuration of plugins will make the plugins unused by that other configuration no longer available for dll loading.