# BuildCookRun staging fails with Zen oplog HTTP NotFound after a successful cook

- **Status:** Current workaround.
- **Engine:** ue6-main `61e2877e`, Linux x86_64, Epic clang 23.1.5 (v27 SDK).
- **Context:** Standalone UE6. Observed while packaging the Coop Zero BPVerse actor probe.
- **Prerequisites:** Prebuilt Linux editor and staging tools, a cookable project with the engine defaults `bUseIoStore=True` and `bUseZenStore=True`, and a cooker command line that sets `-LocalDataCachePath` to a project-local path.

## Symptom

The cook exits 0. Staging exits 1 when AutomationTool reads the cook's oplog. The Coop Zero log reports the following failure three times.

```text
Failed to read oplog from Zen at [::1]:8558 for CoopZero.ea645356.Linux: HTTP NotFound. Ensure that cooking was successful.
```

## Smallest example / reproduction

With `P` and `UE` set to the Coop Zero project and engine roots, use the workspace's build wrapper for this command. The failed run restarted the default local Zen service during staging.

```bash
"$UE/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun \
  -project="$P/CoopZero.uproject" -platform=Linux -clientconfig=Development \
  -build -cook -stage -pak -archive -archivedirectory="$P/Out" \
  -map=/Game/Maps/Slice -unattended -nop4 -utf8output -nocompile -skipbuildeditor \
  -ubtargs="-MaxParallelActions=8" \
  "-AdditionalCookerOptions=-nullrhi -ddc=(ProjectPak,EnginePak,Local) -LocalDataCachePath=$P/DerivedDataCache -ini:Engine:[DevOptions.Shaders]:NumUnusedShaderCompilingThreads=24"
```

## Solution

If a previous cook created a Zen project store, move the generated `Saved/Cooked/Linux` directory aside. Append `-SkipZenStore` inside `-AdditionalCookerOptions` and rerun the full command. Keep IoStore enabled to package the filesystem cook into containers. The existing Linux binaries can be reused.

## Why it works

The cooker launched Zen with `$P/DerivedDataCache/Zen` and wrote the `CoopZero.ea645356/Linux` oplog there. Staging invoked UnrealPak with `-StartZenServerForStage`. It selected the default user Zen directory on the same localhost port and could not find that oplog. `CookCommandlet.cpp` handles `-SkipZenStore` by disabling Zen as the cook output store. `CopyBuildToStagingDirectory.Automation.cs` can read the resulting `packagestore.manifest` from disk when `ue.projectstore` is absent.

## Verified

- **Evidence level:** Runs in packaged build.
- **How:** With `-SkipZenStore`, `BuildCookRun` logged `BUILD SUCCESSFUL` and `BuildCookRun time: 38.50 s`. The cooked output contained `CoopZero/Metadata/packagestore.manifest`. Running `timeout 120 Out/Linux/CoopZero.sh -nullrhi -nosound -unattended -stdout -abslog="$P/Saved/run.log"` logged `LogCoopZero: Display: VERSE_INTERACT_OK` once.
- **Date / by:** 2026-11-25, Coop Zero Step 01c.

## Limits and assumptions

This workaround was verified for a fresh local Linux cook and IoStore archive on this engine revision. The run exercised the startup callback. Incremental cook behavior and player-driven interaction need separate checks.
