Skip to content

[Bug]: Container hub repeatedly refuses startup with unverified proxy ownership #8552

Closed

Description

@nordz0r

Client or integration

Other

Area

Service lifecycle

Summary

In a Kubernetes hub deployment using the community image nordz0r/opencodex:2.100.0, the process failed repeatedly at recoverStartJournalAfterOwnerRecheck (src/cli/start-owner-fence.ts:14) with the following error. Persistent state included ocx.pid containing 1 and runtime-port.json recording PID 1. The exact cause of the inconclusive liveness observation has not been established; stale records and PID namespace reuse are hypotheses, not a proven mechanism.

Proxy ownership is unverified; startup refused. PID record and recovery journal were preserved. Retry when the owner can be verified.

The pod entered CrashLoopBackOff. The trigger that produced the stale state was not established, nor was the liveness observation kind recorded. The expected behavior is safe recovery when absence of the previous owner can be established, without compromising ownership fencing.

Reproduction

  1. Observe a Kubernetes hub pod running the community image nordz0r/opencodex:2.100.0 with a persistent state volume. In the observed incident it repeatedly exited with the error below; the trigger is unknown.
  2. While the pod was stopped, its state directory contained ocx.pid with 1 and runtime-port.json with PID 1, port 10100 and hostname 0.0.0.0. Other ownership and journal files were present.
  3. The operator stopped the workload and quarantined ocx.pid, run/.c10100.lease, codex-home/opencodex-journal.json and .opencodex-owner.json; on restart the same error remained.
  4. After additionally moving runtime-port.json aside and restarting, the pod became ready and healthz returned 200. This recovery observation does not establish which file or liveness branch caused the failure. A minimal docker kill reproduction has not been verified.

Version

2.100.0 (crash observed); fence code identical in 2.100.2 (src/cli/start-owner-fence.ts, src/server/proxy-liveness.ts unchanged between the two tags).

Operating system

Debian (k3s container, linux/amd64); oven/bun image, proxy as container PID 1.

Provider and model

Not provider-specific.

Logs or error output

error: Proxy ownership is unverified; startup refused. PID record and recovery journal were preserved. Retry when the owner can be verified.
      at recoverStartJournalAfterOwnerRecheck (/home/bun/app/src/cli/start-owner-fence.ts:15:15)
      at recoverStartStateUnderOwnershipLease (/home/bun/app/src/cli/start-owner-fence.ts:45:23)
      at async handleStart (/home/bun/app/src/cli/index.ts:446:41)

kubelet then reports CrashLoopBackOff for the pod on every restart.

Screenshots and supporting files

Observed stale state and recovery sequence are described above. Do not remove ownership records unless the previous owner has been independently proven absent; the exact failure mechanism requires further investigation.

Redacted configuration

{"runtimeRole":"hub","hostname":"0.0.0.0","port":10100}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. coderabbitai commented on Nov 11, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #7851 - fix(cli): recheck live ownership before journal recovery [merged]
    #7874 - fix(restart): retire drained parent ownership and preserve bind scope [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. added
    bugSomething isn't working
    serviceService lifecycle (WinSW/launchd/scheduler)
    on Nov 11, 2026
  3. changed the title [-][Bug]: Proxy crashloops after a hard container kill — start-owner-fence can never verify PID 1 in a fresh container[/-] [+][Bug]: Container hub repeatedly refuses startup with unverified proxy ownership[/+] on Nov 11, 2026
  4. lidge-jun commented on Nov 11, 2026

    @lidge-jun
    Owner

    Fixed by #8562 (merged in 2e8f63d). Unreleased until the next preview/stable build.

    Here is what the change does and where its limits are:

    • What now recovers by itself: a record that names the starting process's own PID is treated as stale when the record carries an owner scope matching where this process runs. On Linux that means the same host name plus the same network namespace within one boot, or the same randomly named overlay writable layer. A container restarted inside its pod, which is the k3s case here, recovers on its own. So does the same Docker (overlay2) or Podman container started again.
    • What still refuses, with the same message: a record written by 2.100.x or earlier has no scope, so your first restart after upgrading onto a stale record still refuses. A replacement pod, a pod after a node reboot, and another node also still refuse. In each of these cases the old owner could still be serving the same volume from another network namespace. Confirm nothing else serves that state directory, then move runtime-port.json and ocx.pid aside once. For a Deployment that shares a volume, use strategy: Recreate (or maxSurge: 0).

    The remote-hub guide has a new section, "Restarts after an unclean exit", with the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserviceService lifecycle (WinSW/launchd/scheduler)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions