#Internal gateway restart fails with "service disabled" in Docker-native environments

1 messages · Page 1 of 1 (latest)

umbral ore
#

Context: I am running OpenClaw version 2026.4.15 inside a Docker container named openclaw-gateway on a WSL2 host. To manage known MCP server memory leaks (Issue #60656), I have an internal cron job in jobs.json set to restart the gateway nightly.
The Issue: The internal task fails to execute the restart, even though the gateway is active. Job Triggered: gateway-mcp-restart ran at 03:15:17 IST. Command: openclaw gateway restart. Failure Log: The CLI returned: Gateway service disabled. Start with: openclaw gateway install.
Observation: Because the gateway is the container's primary entrypoint, there is no systemd service manager inside the container to handle the CLI's restart request. When this restart fails, my host memory usage balloons to 71% and the Docker Desktop Backend spikes to 55% CPU.
Questions:In version 2026.4.15, is openclaw gateway restart intended to work within a Docker container that lacks a service manager? Is there a "soft restart" CLI flag that can recycle the gateway and its MCP child processes without requiring systemctl? If the internal cron is fundamentally incompatible with a Docker-entrypoint setup, is moving the restart task to the host-level crontab (using docker restart) the recommended production path for 24/7 autonomous agents?

pallid dockBOT
magic saffronBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

pallid dockBOT
undone quiverBOT
#

Let me verify this against the docs and source so I don't guess.

#

I found something important: current source does have an unmanaged-process SIGUSR1 restart path, but I want to check whether that actually existed in 2026.4.15 or landed later.

#

Short version: yes, for a Docker-entrypoint gateway, I’d move the restart outside the gateway.

  • The docs still describe openclaw gateway restart as a background service restart, while openclaw gateway is the foreground process. So a plain container with no systemd/launchd is not the primary target for that command.
    https://docs.openclaw.ai/help/faq
    https://docs.openclaw.ai/cli/gateway

  • I do see a newer source-level fallback for unmanaged gateways that sends SIGUSR1 to the running listener, but there is no separate --soft-restart flag for “recycle MCP children only”. So, no documented soft-restart CLI for your case.

  • For Docker deployments, the docs already lean on container/orchestrator lifecycle. The image exposes health checks, and the expectation is that Docker/Compose/K8s restarts or replaces unhealthy containers.
    https://docs.openclaw.ai/install/docker

My recommendation for a 24/7 setup:

  1. Do not rely on internal cron + openclaw gateway restart inside a plain Docker entrypoint container.
  2. Schedule docker restart openclaw-gateway from the host (or Compose/systemd/K8s equivalent).
  3. Keep a Docker restart policy + healthcheck as a safety net.
#

If you want, I can help write the exact WSL2 host cron entry or a Docker healthcheck/watchdog setup.

If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution, so Answer Overflow can index it.

umbral ore
#

yes.. can you help me

undone quiverBOT
#

Yep. I’d set this up as an external container restart, not an internal openclaw gateway restart.

Recommended setup

1) Test the restart path once manually

From the WSL host:

docker restart openclaw-gateway
docker ps --filter name=openclaw-gateway
docker inspect -f '{{.State.StartedAt}}' openclaw-gateway
curl -fsS http://127.0.0.1:18789/healthz

If that works, you’ve got the right recovery path.

2) Use host cron in WSL

#

If your WSL distro stays running, add a cron entry:

crontab -e

Example, daily at 03:15:

15 3 * * * /usr/bin/docker restart openclaw-gateway >> /tmp/openclaw-restart.log 2>&1

If Docker is on a different path, check with:

command -v docker
#

3) Better option on WSL2: Windows Task Scheduler

This is usually more reliable than WSL cron, because WSL distros can go idle.

  • Program: wsl.exe
  • Arguments: -d <YourDistroName> -- docker restart openclaw-gateway

If you want, I can help you turn that into an exact Task Scheduler entry.

Keep these too

In Compose:

restart: unless-stopped

The image already has a healthcheck, which is good for crashes, but for a known leak a scheduled docker restart is the cleaner fix.

#

What I’d change now

  • Remove/disable the internal cron job that runs openclaw gateway restart
  • Replace it with host-level docker restart openclaw-gateway

If you paste your docker-compose.yml or say whether you want WSL cron or Windows Task Scheduler, I’ll write the exact config for you.