Skip to content

Self-update not detected when the watcher reaches the local daemon over TCP (socket proxy): Drydock stops its own container and never recreates it #1663

Open

Description

@tarzan77cz

Drydock version

1.8.0-rc.15 → 1.8.0-rc.16. The code below is the same in both tags.

What happened?

A Drydock agent (--agent) auto-updated itself through the dockercompose action. It pulled the new image, stopped its own container and exited. Nothing recreated it, so the container stayed Exited (0) and the controller reported Agent … disconnected: SSE connection lost. The same thing happened on two consecutive releases (rc.14 → rc.15 and rc.15 → rc.16).

The log never shows Self-update detected — notifying UI before proceeding. The update takes the normal stop/recreate path instead of the helper-container handoff:

INFO Accepted update trigger dockercompose.stacks (container=d373bca1…) {"component":"trigger"}
INFO Processing compose file: /share/Container/infra/docker-compose.yml
INFO Refresh compose service drydock-agent from /share/Container/infra/docker-compose.yml using Docker Engine API
INFO Pull image codeswhat/drydock:1.8.0-rc.16
INFO Image codeswhat/drydock:1.8.0-rc.16 pulled with success
INFO Pinned pulled image codeswhat/drydock:1.8.0-rc.16 (local sha256:…) to codeswhat/drydock:1.8.0-rc.16@sha256:…
INFO Pruning previous tags
INFO Image … architecture "amd64" is compatible with Docker daemon "x86_64"
INFO Stop container drydock-agent with id d373bca1…
INFO Deregister component {"component":"watcher.docker.stacks"}
INFO Deregister component {"component":"trigger.dockercompose.stacks"}
… (process exits)

What did you expect?

Drydock should recognise its own container and use the self-update helper. CHANGELOG (fc34ffb) says: "Self-update now works when Drydock reaches the Docker daemon over a TCP host, not only through a bind-mounted /var/run/docker.sock". self-update-availability.ts also reports self-update as available in TCP mode.

If Drydock cannot prove its identity, it should refuse the update as indeterminate, as it does elsewhere. It should not stop itself.

Root cause (v1.8.0-rc.16)

app/triggers/providers/docker/Docker.ts:

// L146
function isDirectLocalDockerWatcher(registryId, watcher) {
  ...
  if (normalizeNonEmptyString(candidate.agent)) { return false; }
  if (normalizeNonEmptyString(candidate.configuration?.host)) { return false; }
  return !!candidate.dockerApi;
}

// classifySelfUpdate(), L1977
if (!isDirectLocalDockerWatcher(candidateRegistryId, candidateWatcher)) {
  return this.selfUpdateOrchestrator.classifySelfUpdate(container, undefined, 'peer');
}

Every watcher with a host is treated as a remote daemon, so the container is classified peer without any identity check. SelfUpdateOrchestrator.isSelfUpdate() then returns false. UpdateLifecycleExecutor falls through to performContainerUpdate, which stops the running Drydock process before the new container is created.

A socket proxy in front of the local daemon is a common hardened setup, and it breaks the assumption that a TCP host is always remote. Docker.self-identity-safety.test.ts ("allows the normal stop/recreate path for a proven peer Drydock container") encodes this assumption, but nothing in this path actually proves the container is a peer.

Steps to reproduce

  1. Run Drydock (standalone or --agent) with no /var/run/docker.sock mount. Give it a watcher pointing at a socket proxy on the same host, for example DD_WATCHER_STACKS_HOST=docker-socket-proxy, DD_WATCHER_STACKS_PORT=2375.
  2. Put the Drydock container itself under a dockercompose action with dd.action.include and dd.action.auto.
  3. Let a newer Drydock tag be detected. The container is stopped and never recreated.

Relevant configuration

drydock-agent:
  image: codeswhat/drydock:1.8.0-rc.15
  container_name: drydock-agent
  command: --agent
  restart: unless-stopped
  labels:
    - "dd.action.include=dockercompose.stacks"
    - "dd.action.auto=dockercompose.stacks:minor-no-digest"
    - "dd.tag.family=loose"
  volumes:
    - /share/Container:/share/Container
    - /share/Container:/data/stacks
  environment:
    - DD_WATCHER_STACKS_HOST=docker-socket-proxy
    - DD_WATCHER_STACKS_PORT=2375
    - DD_ACTION_DOCKERCOMPOSE_STACKS_AUTO=oninclude
    - DD_ACTION_DOCKERCOMPOSE_STACKS_THRESHOLD=minor-no-digest

Suggested fix

  • When the watcher has a TCP host, still try to prove identity. For example, compare the daemon ID from /info with the local runtime, or resolve the own container by ID or hostname through that watcher's API. Use peer only when identity is actually disproven.
  • If identity cannot be proven, classify the container as indeterminate and refuse the update. That is safe. The current behaviour is not: it takes the destructive path that ends with Drydock stopping itself.

Workaround

Exclude Drydock's own container from the action (dd.action.exclude=dockercompose.stacks:all) and update it manually.

Installation method

Docker Compose (QNAP Container Station), linuxserver/socket-proxy in front of the local daemon.

Activity

  1. scttbnsn commented on Nov 21, 2026

    @scttbnsn
    Contributor

    Thanks for the detailed write-up, and your root cause is right. A watcher with a host gets treated as remote, so with a socket proxy in front of the local daemon Drydock classifies its own container as a peer and takes the normal stop/recreate path, which stops itself.

    I'm changing that so a TCP watcher still has to prove identity: Drydock looks up its own container through that watcher's API, and if it can't tell either way the update is refused as indeterminate instead of stopping anything. Until that ships, your workaround (dd.action.exclude=dockercompose.stacks:all on the Drydock container) is the right one.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions