Packaging Fails: Duplicate DefaultEngine.ini File and Missing Shader Map

We’ve been packaging builds successfully on our project for quite some time. Our most recent builds have started failing with the following error:

Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Staging manifest already contains \Saved\TempWin64\DefaultEngine.ini (or a file that differs in case only)

I have checked the directory, there is no such duplicate. In an act of desperation, I modified the automation tool to simply ignore that exception. This allows the packaging to complete, but upon running the generated executable I get the following error:

LowLevelFatalError [File:\Engine\Source\Runtime\Engine\Private\Materials\MaterialShared.cpp] [Line: 1622]
Failed to find shader map for default material WorldGridMaterial!  Please make sure cooking was successful.

After researching this online I saw that other users have solved this problem by enabling static lighting. We do not have static lighting and would prefer not to take the performance hit associated with enabling it, but nevertheless I gave it a go. The game launches into the first scene (a simple loader) and then gives me a black screen, so I turned static lighting back on.

Finally, I turned off the option to use a Pak file, and the game works perfectly. We would prefer to be able to use a Pak file, however.

We are on a very very tight schedule, and would like to avoid potentially destabilizing options such as reimporting the project. We have built the engine from source. Any advice at all is appreciated.

Edit: I forgot to add that we already tried deleting our saved/intermediate folders to no avail

I would probably start by debugging the staging code and finding out where that duplicate staged file reference was coming from. Seems pretty odd, but at least it’s probably best to start debugging there and hope that it unveils something fundamental that’s wrong that causes all of your subsequent problems. You say it all worked fine then broke at some point? Can you pinpoint the time that it stopped working and regress the changes around it to find what caused the error to start happening?

Graeme

Here is the relevant code inside of CreatePakResponseFileFromStagingManifest for my explanation below.

Right before the exception, CreatePakResponseFileFromStagingManifest inside of CopyBuildToStagingDirectory.Automation.cs converts BOTH of the paths <ProjectDirectory>\\Engine\\Config\\DefaultEngine.ini and <ProjectDirectory>\\<ProjectName>\\Config\\DefaultEngine.ini to <ProjectDirectory>\\<ProjectName>\\Saved\\Temp\\Win64\\DefaultEngine.ini

Since this code sets the Src to the same value, but with different Dest values, it triggers the AutomationException.

I’m not sure why this would be happening now, as this project has always been structured this way.

Hi Poppy Works, for the config issue. You stated that you have: \Engine\Config\DefaultEngine.ini

But there should not be a defaultengine.ini file in that folder. The engine config file that should be in there is BaseEngine.ini.

/TD