# org.apache.kafka.common.errors.UnknownServerException：服务器遇到意外错误。

- **ID:** `kafka/unknown-server-exception`
- **领域:** kafka
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 75%

## 根因

内部代理错误发生，通常是由于消息损坏或磁盘 I/O 故障，代理无法分类。

## 解决方案

1. ```
   Check broker logs for detailed stack trace: `grep -i 'UnknownServerException' /var/log/kafka/server.log`. Then run `fsck` on the data directory or replace the disk if bad sectors are detected.
   ```
2. ```
   If corruption is isolated to a topic partition, use `kafka-reassign-partitions.sh` to move replicas to a healthy broker and delete the corrupt data directory.
   ```

## 无效尝试

- **** — Restarting the broker without checking logs or disk health only delays the error; the underlying corruption persists and will recur. (80% 失败率)
- **** — Increasing replication factor doesn't fix the corrupt data on the affected broker; it just adds replicas that may also encounter the issue. (90% 失败率)
