# <stream:error><conflict xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>

- **ID:** `communication/xmpp-stream-error-conflict`
- **领域:** communication
- **类别:** auth_error
- **错误码:** `conflict`
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

XMPP服务器在第二个资源以相同优先级和资源名称绑定时，或用户账户被管理员禁用时，以冲突错误终止流。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| RFC 6120 | active | — | — |
| Ejabberd 23.10 | active | — | — |
| Prosody 0.12 | active | — | — |
| Openfire 4.8 | active | — | — |

## 解决方案

1. ```
   Set a unique resource name for each client connection. In the XMPP client, generate a random resource string (e.g., 'home-12345', 'mobile-abcde') instead of using a fixed name like 'client' or leaving it blank.
   ```
2. ```
   Check if the user account is disabled or banned on the server. On Ejabberd, run 'ejabberdctl check_account user@domain' and 'ejabberdctl ban_account user@domain' to verify status.
   ```

## 无效尝试

- **Disable all other XMPP clients for the same user** — The conflict is caused by resource binding, not the number of clients; even two clients with different resource names can coexist (60% 失败率)
- **Restart the XMPP server to clear the conflict state** — The conflict is a per-session issue; restarting the server does not prevent the client from reconnecting with the same resource name (90% 失败率)
- **Change the server's port from 5222 to 5223 (legacy SSL)** — The port does not affect resource binding logic; the conflict error is stream-level, not transport-level (100% 失败率)
