Zen Server as Cooked output Path override not working

Hi there,

I am trying to use the recommended guidance in this section of Zen as Cooked Output Store https://dev.epicgames.com/documentation/en\-us/unreal\-engine/using\-zen\-storage\-server\-as\-cooked\-output\-store\-for\-unreal\-engine\#locationofcookeddatawhenusingzenascookedoutputstore

I am trying to change the location of the local Zen Data store on our build agents from the C Drive to the D drive. However when I add the specified override to the environment variables list, I do not see the specified location being populated. The default location of %LOCALAPPDATA%\UnrealEngine\Common\Zen\Data is still being used.

Am I missing something or doing something wrong potentially?

We have enabled Zen Storage Server as Cooked Output store. We also have a dedicated Zen Server as a Shared DDC. The C Drive is being filled up and the D drives have the capacity to hold everything that is Zen related locally.

[Image Removed]

Thanks!

Jaroslaw

Hi there,

I am updating this question as I found a way to force the Zen Server to write to the D drive. I have manually edited the zenserver.runcontext file located in C:\Users\<user>\AppData\Local\UnrealEngine\Common\Zen\Install

I modify the following lines:

CommandlineArguments - specifically --data-dir to point at the required D Drive folder

DataPath - update it to point at the required D drive folder

You can see in the screenshot below, that as soon as I amended the zenserver.runcontext file, it started populating the correct location with data once the build agent started a cook.

[Image Removed]

Is there a way to change the Commandline Argument and DataPath being set in zenserver.runcontext without actually modifying the file itself?

I have reproduced this on my local development machine and on a build agent in our team city. I was not able to change the location on both of these machines using the override specified in https://dev.epicgames.com/documentation/en-us/unreal-engine/using-zen-storage-server-as-cooked-output-store-for-unreal-engine#locationofcookeddatawhenusingzenascookedoutputstore

Thanks!

Jaroslaw

Hi there,

Just updating this with further information as I had to do this on another build agent that was running out of C Drive space. I tried only editing the zenserver.runcontext file with the D Drive location, however I found that the change was not sticking. I had not set the override variables mentioned here https://dev.epicgames.com/documentation/en-us/unreal-engine/using-zen-storage-server-as-cooked-output-store-for-unreal-engine#locationofcookeddatawhenusingzenascookedoutputstore

Only once I set these and restarted the machine, then updated zenserver.runcontext, did the change stick and the D drive location started to be populated.

I know that on the first build agent and on my local machine, I set the override variables, built the editor and restarted the machines. The local DDC location did not update. Only after updating the zenserver.runcontext file, did it finally switch.

Hopefully some insights can be provided on how to more effectively change the location?

Thanks!

Jaroslaw

Hi Jaroslaw,

There’s multiple layers to how zenserver’s data directory is chosen. It involves environment variables (the ones you included in your original post), a registry setting, and commandline arguments (as noted in the document in your 2nd reply). For the environment variables, we use this internally on our build system to direct the zen data location to somewhere appropriate for our build machines. One pitfall with environment variables is the way the inherit from launching process to subprocess and stick for the lifetime of the process. Sometimes the safest way to ensure the environment variables are updated is to restart the machine. I can’t say why they didn’t work for you and you had to modify the runcontext file (this is undesirable and unsupported, so I’d suggest we figure out why the env vars didn’t work instead of relying on this). The places to look in code for where this env var is processed are:

ZenServerInterface.cpp - DetermineDataPath

ZenServerInterface.cpp - DetermineLocalDataCachePath

Both places emit a message like this one to the log to let you know if an environment variable has been found and used:

UE_LOG(LogZenServiceInstance, Log, TEXT(“Found environment variable %s=%s”), *DataPathEnvOverride, *DataPathEnvOverrideValue);

For these to be effective, you must be using our Zen.AutoLaunch configuration section from BaseEngine.ini that specifies:

LocalDataCachePathEnvOverride=UE-LocalDataCachePath

Hi Zousar,

Thanks for the explanation. I will check our logs and what the setting is in BaseEngine.ini and update on what I find.

Currently the way I have changed it, is working and holding for all our build agents.

Kind regards,

Jaroslaw

Hi there,

I would like to report that we have encountered a new error related to the Zen server, see the error below:

17:33:23   LogIoStore: Display: ==================== IoStore Utils ====================
17:33:26   LogIoStore: Display: Using command line for crypto configuration
17:33:27   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:29   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:30   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:33   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:34   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:36   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:37   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:40   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:41   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:43   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:44   LogZenServiceInstance: Warning: Failed attach as sponsor process to executable 'C:/Users/team.city/AppData/Local/UnrealEngine/Common/Zen/Install/zenserver.exe' on port 8558, too many sponsored processes attached already or zenserver is unresponsive
17:33:44   LogZenServiceInstance: Warning: Unable to reach Unreal Zen Storage Server HTTP service at [::1]:8558. Status: 0. Response:
17:33:44   LogZenServiceInstance: Warning: Local ZenServer AutoLaunch initialization timed out waiting for service to become healthy
17:33:44   LogIoStore: Error: Failed to launch ZenServer.
17:33:44   LogPakFile: Display: UnrealPak executed in 20.960124 seconds
17:33:44   Took 23.32s to run UnrealPak.exe, ExitCode=1

This causes the build in progress to fail even though cooking was successful.

May you have any idea why this is happening?

As far as I can tell, there is only one instance of the Zen Server running.

Kind regards,

Jaroslaw

For the data path could you check the registry key HKEY_CURRENT_USER/Software/EpicGames/Zen and see if that is set?

Which version of Unreal are you using?

It also seems like there are multiple build agents running on the same machine?

I need some more details on your setup as the “too many sponsored processes attached already or zenserver is unresponsive” log is somewhat confusing.