ERR Can't save in background: fork failed: Background save failed: fork failed
RedisWhat does it mean?
Redis failed to create a child process (fork) for a background RDB snapshot or AOF rewrite. Because persistence cannot run, data cannot be written to disk.
Why does it happen?
The operating system cannot allocate enough memory for the fork; usually overcommit_memory is disabled and the system refuses when Redis tries to reserve roughly a copy of the memory it uses. Insufficient physical/virtual memory or process count limits can also cause it.
How to fix it
Enable memory overcommit on Linux: sysctl vm.overcommit_memory=1 (add it to /etc/sysctl.conf to make it permanent). Add memory to the server or lower Redis memory usage (maxmemory). Provide sufficient swap space. Check process/file descriptor limits (ulimit). If persistence is critical, do not go to production without these settings.
More from this engine
- ERR unknown subcommandERR unknown subcommand or wrong number of arguments
- ERR Client sent AUTH, but no password is setERR AUTH <password> called without any password configured for the default user (Redis 6+) / ERR Client sent AUTH, but no password is set (Redis <6)
- ERR DEBUG command not allowedDEBUG command not allowed
- NOPROTO unsupported protocol versionUnsupported RESP protocol version
- ERR Unknown option or number of arguments for CONFIG SETUnknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter)
- ERR MULTI calls can not be nestedMULTI calls can not be nested
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable