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.
error: memcached not running
# container log:
memcached: error while parsing option; terminatingCommon 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
- Ensure the options form a valid memcached command.
- Use a memory value the runner can allocate.
- Add a health check so the job waits for a listening port.
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.
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.