Unreal 5.5 Unreal Game Sync (UGS) Perforce: sync p4 client -o [CLIENT] failed!

Hello,

after updating unreal 5.5 our project, we cannot build our Engine Binaries via UGS.
We run the command to build the project and ship the binaries to perforce
BuildGraph -Script=[Directory]\Main/Engine/Build/Graph/Examples/BuildEditorAndTools.xml -Target="Submit To Perforce For UGS" -set:EditorTarget=[Game]Editor -set:UProjectPath=[Directory]\Main\Project\[Game].uproject -set:ArchiveStream=/[Game]Binaries/Dev-Binaries -p4 -submit
stuff in [ _ ] is just name obfuscation.

Our p4 client is created by TeamCity.

the full error stack is as follows:
AutomationException: p4 client -o TC_p4_BinariesBuilder_Main_52e11ea0ac10706d failed! at AutomationTool.P4Connection.GetClientInfoInternal(String ClientName) in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Utils.cs:line 3604 at AutomationTool.P4Connection.GetClientInfo(String ClientName, Boolean Quiet) in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Utils.cs:line 3522 at AutomationTool.P4Environment.DetectClient(P4Connection Connection, String UserName, String HostName, String AutomationToolDll) in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Environment.cs:line 355 at AutomationTool.P4Environment..ctor(CommandEnvironment CmdEnv) in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Environment.cs:line 165 at AutomationTool.CommandUtils.InitP4Environment() in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\P4Utils.cs:line 1016 at AutomationTool.Automation.ProcessAsync(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet 1 ScriptModuleAssemblies) in [Directory]\Main\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 160

Any ideas why that happens? when I try the perforce command p4 client -o from command line it works just fine.

I’m not sure if you managed to fix the issue, but in my case, the issue seemed to be that the P4PASSWD environment variable was not being set by TeamCity, so the P4Connection could not authenticate. I manually added it as a build parameter and it fixed it. I’m sure there’s a better way to do it, but for now at least it works.