UAT Error: Value cannot be Null


I am running an Source Build of 4.17.2 and started getting the following UAT Error.

 Project.CopyBuildToStagingDirectory: ********** STAGE COMMAND STARTED **********
00:42:45 Project.CreateStagingManifest: Creating Staging Manifest...
00:42:45 Program.Main: ERROR: AutomationTool terminated with exception: System.ArgumentNullException: Value cannot be null.
00:42:45 Parameter name: value
00:42:45    at System.String.Join(String separator, String[] value)
00:42:45    at DeploymentContext.StageFiles(StagedFileType FileType, DirectoryReference InputDir, String Wildcard, Boolean bRecursive, String[] ExcludeWildcards, StagedDirectoryReference NewPath, Boolean bAllowNone, Boolean bRemap, String NewName, Boolean bAllowNotForLicenseesFiles, Boolean bStripFilesForOtherPlatforms, Boolean bConvertToLower) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\AutomationUtils\DeploymentContext.cs:line 629
00:42:45    at BaseWinPlatform.GetFilesToDeployOrStage(ProjectParams Params, DeploymentContext SC) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Win\WinPlatform.Automation.cs:line 47
00:42:45    at Win64Platform.GetFilesToDeployOrStage(ProjectParams Params, DeploymentContext SC) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Win\WinPlatform.Automation.cs:line 373
00:42:45    at Project.CreateStagingManifest(ProjectParams Params, DeploymentContext SC) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Scripts\CopyBuildToStagingDirectory.Automation.cs:line 291
00:42:45    at Project.CopyBuildToStagingDirectory(ProjectParams Params) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Scripts\CopyBuildToStagingDirectory.Automation.cs:line 1824
00:42:45    at BuildCookRun.DoBuildCookRun(ProjectParams Params) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 240
00:42:45    at BuildCookRun.ExecuteBuild() in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 40
00:42:45    at AutomationTool.BuildCommand.Execute() in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 100
00:42:45    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 563
00:42:45    at AutomationTool.Automation.Process(String[] Arguments) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 533
00:42:45    at AutomationTool.Program.MainProc(Object Param) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Program.cs:line 133
00:42:45    at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param) in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 708
00:42:45    at AutomationTool.Program.Main() in G:\FreeDome\UE4172_FreeDome\Engine\Source\Programs\AutomationTool\Program.cs:line 57
00:42:45 Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

Anyone able to advise as to how to fix this for 4.17.2 as we are restricted to this build for the moment.

Thank you.

This was a very annoying bug fixed in 4.18. You can get a QFE for 4.17 from this thread:

More info about this issue here:

If you read that thread you will notice that i posted twice at the bottom, also linking this bug report.

You will also notice that the issue described in that thread is particular to UBT, not UAT which is where my issue is coming from, i tried to make this clear to avoid that exact mix up.

It looks like that’s actually bug in the format string for an error message about something else.

throw new AutomationException(ExitCode.Error_StageMissingFile, "No files found to deploy for {0} with wildcard {1} and exclusions {2}", InputDir, Wildcard, String.Join(", ", ExcludeWildcards));

My guess is that ExcludeWildcards is null. You can try changing it to:

throw new AutomationException(ExitCode.Error_StageMissingFile, "No files found to deploy for {0} with wildcard {1} and exclusions {2}", InputDir, Wildcard, (ExcludeWildcards == null)? "" : String.Join(", ", ExcludeWildcards));

Of course, that will still leave you with that error to fix. Hopefully there will be enough context from the error to point you in the right direction.

Sorry for the mix up.

Hi Ben. I made a rocket build out of promoted branch and I’m facing the same Value cannot be null issue. But please note that it only happens for a custom installed build. The source build (promoted branch) has absolutely no issues.

Here is the output from VS:

1>EXEC : error : System.ArgumentNullException: Value cannot be null. 1> Parameter name: source 1> at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate) 1> at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessary(BuildConfiguration BuildConfiguration, UEBuildTarget Target, CppCompileEnvironment GlobalCompileEnvironment, List1 UObjectModules, FileReference ModuleInfoFileName, ECompilationResult& UHTResult)
1> at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile)`

The fix from the 4.18 branch hasn’t made it back to master yet. It should do early next week.

Any clarification as to why no issues for source build but installed build brings up this problem?

The line throwing the exception contains code that is specifically handling a case for the installed build:

				// Always build UnrealHeaderTool if header regeneration is required, unless we're running within an installed ecosystem or hot-reloading
				if ((UnrealBuildTool.IsEngineInstalled() == false || Target.EnabledPlugins.Any(x => x.Descriptor.bCanBeUsedWithUnrealHeaderTool && !x.File.IsUnderDirectory(UnrealBuildTool.EngineDirectory))) &&
					BuildConfiguration.bDoNotBuildUHT == false &&
					BuildConfiguration.bHotReloadFromIDE == false &&
					!(bHaveHeaderTool && !UnrealBuildTool.IsGatheringBuild && UnrealBuildTool.IsAssemblingBuild))	// If running in "assembler only" mode, we assume UHT is already up to date for much faster iteration!

So is there a commit link where we can apply the fix for our build?

It was fixed in 1306fe0071e435a4e161da80bab5d7e94feaf4b1

Thank you Ben. I just cherry picked it to my build.