Skip to content
Latchkey

Memcached "error: memcached not running" in CI

The memcached process is not up, so a helper or health check reports "error: memcached not running." In CI this means the service container exited during startup, usually because of an invalid option or a memory setting the container could not honor.

What this error means

A test setup step or health check prints "error: memcached not running" and the service logs show memcached exiting right after start.

memcached
error: memcached not running
# container log:
memcached: error while parsing option; terminating

Common causes

Invalid startup options

A malformed -m, -I, or other flag makes memcached print a usage error and exit, so the port never opens.

The command overrode the entrypoint incorrectly

Passing options: that do not begin with the binary, or a bad memory value, causes the container to fail its start.

How to fix it

Fix the startup command and verify it runs

  1. Ensure the options form a valid memcached command.
  2. Use a memory value the runner can allocate.
  3. Add a health check so the job waits for a listening port.
.github/workflows/ci.yml
services:
  memcached:
    image: memcached:1.6
    options: memcached -m 64
    ports: ['11211:11211']

Read the service log on failure

Check the memcached container log for the parse or startup error, then correct the offending option.

Terminal
nc -z localhost 11211 || echo "memcached did not start; check service log"

How to prevent it

  • Validate memcached options before committing the workflow.
  • Add a health check so a failed start is caught early.
  • Keep the memory (-m) value within the runner limits.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →