# ERR 未知命令 'FORK'

- **ID:** `redis/err-unknown-command-fork`
- **领域:** redis
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

客户端发送了一个 Redis 命令表中不存在的命令，通常是由于拼写错误或使用了其他数据库（如 PostgreSQL 的 FORK）的命令。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Redis 7.2.0 | active | — | — |
| Redis 6.2.14 | active | — | — |
| redis-py 5.0.1 | active | — | — |

## 解决方案

1. ```
   Check the application code for the exact command string and replace it with the correct Redis command. For example, change `FORK` to `BGSAVE` if the intent was to fork a background save.
   ```
2. ```
   Use Redis' `COMMAND INFO` to verify the command exists: `redis-cli COMMAND INFO FORK` returns empty if unknown.
   ```
3. ```
   If the command is from a third-party library, update the library to use Redis-compatible commands. Example in Python: `r.execute_command('BGSAVE')` instead of `r.execute_command('FORK')`.
   ```

## 无效尝试

- **** — The command name is still not recognized as a built-in Redis command. (90% 失败率)
- **** — Redis command set is fixed and not configurable. (99% 失败率)
