Loading...
Loading...
Compare original and translation side by side
@ably/clinpm install -g @ably/cliably --helpably <command> --help@ably/clinpm install -g @ably/cliably --helpably <command> --helpMessages not arriving
├── Is anyone on the channel? → list channels with a prefix filter
├── Was anything published? → check channel history (2 min only without persistence)
├── Can I see messages live? → subscribe to the channel
├── Test round-trip → subscribe in background, publish from main terminal
└── Check channel lifecycle → subscribe to channel lifecycle logs, or inspect the channel in the dashboard
Presence not working
├── Who is actually present? → subscribe to presence on the channel
├── Simulate a client joining → enter presence with custom client-id and data
├── Check presence member count → get channel occupancy
│ (stale members? ungraceful disconnects take ~15s to be removed)
└── Watch all presence events → subscribe to logs filtered by channel.presence, or inspect the channel in the dashboard
Connection problems
├── Can I connect at all? → test connection (try ws and xhr separately)
├── Is Ably up? → check service status
├── Watch connection lifecycle → subscribe to connection lifecycle logs
└── Connection count vs plan limit → check app stats in live mode
Auth errors
├── Is the API key valid? → test connection with the specific key
├── What capabilities does key have? → list auth keys
├── Using tokens (JWT or Ably)? → issue a test token via CLI to verify the key can create valid tokens
│ (CLI token issuance tests the key, not your app's authUrl/authCallback)
├── Token expired (40142)? → check TTL and renewal config (authUrl/authCallback)
└── Look up the error code → ask the support agent or fetch help.ably.io/error/{code}
Channel state / lifecycle issues
├── Watch channel events → subscribe to channel lifecycle logs
├── Watch all app meta events → subscribe to all logs
├── Check channel occupancy → get or subscribe to occupancy
└── Check channel rules/config → list channel rules (persistence, TLS, push, etc.)
Push notifications not working
├── Watch push delivery logs → subscribe to push logs (meta channel)
├── Check push log history → get push log history
├── Is push enabled on namespace? → list channel rules, check push-enabled
└── Check integration rules → list integrations, check source type and channel filter
Integration rules not firing
├── List all integrations → list integrations to see rules, source types, status
├── Check source type matches → source can be channel.message, channel.presence,
│ channel.lifecycle, or presence.message
├── Check channel filter → filter pattern must match the channel name
├── Is the rule enabled? → check integration status (enabled/disabled)
└── Check for delivery errors → check log history — the log metachannel captures
errors sending on integrations
Queue issues
├── Are queues configured? → list queues
├── Is the integration routing to it?→ list integrations, check AMQP rule target
└── Check message flow → subscribe to the source channel to verify messages exist
Chat room issues (@ably/chat)
├── Are messages flowing? → subscribe to room messages
│ (if CLI sees messages but app doesn't → room.attach() likely missing)
├── Check room presence → subscribe to room presence
├── Check occupancy → get room occupancy
├── Check underlying channel events → inspect the room's channels in the dashboard, or subscribe to channel lifecycle logs and look for the room's channel names
└── Send a test message → send a message to the room from CLI
Spaces issues (@ably/spaces)
├── Who is in the space? → subscribe to space members
├── Watch cursors → subscribe to space cursors
├── Watch locations → subscribe to space locations
└── Check locks → get all locks in the spaceMessages not arriving
├── Is anyone on the channel? → list channels with a prefix filter
├── Was anything published? → check channel history (2 min only without persistence)
├── Can I see messages live? → subscribe to the channel
├── Test round-trip → subscribe in background, publish from main terminal
└── Check channel lifecycle → subscribe to channel lifecycle logs, or inspect the channel in the dashboard
Presence not working
├── Who is actually present? → subscribe to presence on the channel
├── Simulate a client joining → enter presence with custom client-id and data
├── Check presence member count → get channel occupancy
│ (stale members? ungraceful disconnects take ~15s to be removed)
└── Watch all presence events → subscribe to logs filtered by channel.presence, or inspect the channel in the dashboard
Connection problems
├── Can I connect at all? → test connection (try ws and xhr separately)
├── Is Ably up? → check service status
├── Watch connection lifecycle → subscribe to connection lifecycle logs
└── Connection count vs plan limit → check app stats in live mode
Auth errors
├── Is the API key valid? → test connection with the specific key
├── What capabilities does key have? → list auth keys
├── Using tokens (JWT or Ably)? → issue a test token via CLI to verify the key can create valid tokens
│ (CLI token issuance tests the key, not your app's authUrl/authCallback)
├── Token expired (40142)? → check TTL and renewal config (authUrl/authCallback)
└── Look up the error code → ask the support agent or fetch help.ably.io/error/{code}
Channel state / lifecycle issues
├── Watch channel events → subscribe to channel lifecycle logs
├── Watch all app meta events → subscribe to all logs
├── Check channel occupancy → get or subscribe to occupancy
└── Check channel rules/config → list channel rules (persistence, TLS, push, etc.)
Push notifications not working
├── Watch push delivery logs → subscribe to push logs (meta channel)
├── Check push log history → get push log history
├── Is push enabled on namespace? → list channel rules, check push-enabled
└── Check integration rules → list integrations, check source type and channel filter
Integration rules not firing
├── List all integrations → list integrations to see rules, source types, status
├── Check source type matches → source can be channel.message, channel.presence,
│ channel.lifecycle, or presence.message
├── Check channel filter → filter pattern must match the channel name
├── Is the rule enabled? → check integration status (enabled/disabled)
└── Check for delivery errors → check log history — the log metachannel captures
errors sending on integrations
Queue issues
├── Are queues configured? → list queues
├── Is the integration routing to it?→ list integrations, check AMQP rule target
└── Check message flow → subscribe to the source channel to verify messages exist
Chat room issues (@ably/chat)
├── Are messages flowing? → subscribe to room messages
│ (if CLI sees messages but app doesn't → room.attach() likely missing)
├── Check room presence → subscribe to room presence
├── Check occupancy → get room occupancy
├── Check underlying channel events → inspect the room's channels in the dashboard, or subscribe to channel lifecycle logs and look for the room's channel names
└── Send a test message → send a message to the room from CLI
Spaces issues (@ably/spaces)
├── Who is in the space? → subscribe to space members
├── Watch cursors → subscribe to space cursors
├── Watch locations → subscribe to space locations
└── Check locks → get all locks in the spacepersisted: truepresencesubscribepublish:["chat:*"]chat:chat:room-1chatauthUrlauthCallback[meta]*ably logs[meta]log[meta]channel.lifecycle*[meta]*[*]*[*]*ably logsably channels inspect <channel>[meta]inspect:*ably accounts login --endpoint <host>help.ably.io/error/{code}ably support ask "error {code}"persisted: truepresencesubscribepublish:["chat:*"]chat:chat:room-1chatauthUrlauthCallback[meta]*ably logs[meta]log[meta]channel.lifecycle*[meta]*[*]*[*]*ably logsably channels inspect <channel>[meta]inspect:*ably accounts login --endpoint <host>help.ably.io/error/{code}ably support ask "error {code}"ABLY_API_KEYexport ABLY_API_KEY=...ABLY_TOKENably loginably apps listably apps switchably auth keys listably loginABLY_API_KEYexport ABLY_API_KEY=...ABLY_TOKENably loginably apps listably apps switchably auth keys listably loginchannel.lifecyclechannel.occupancychannel.presenceconnection.lifecyclepush.publishchannel.lifecyclechannel.occupancychannel.presenceconnection.lifecyclepush.publish{"role": "server"}{"role": "server"}ably support ask "your question"--continueably statusably support ask "your question"--continueably statussubscribepresence enterstats --liveoccupancy subscribe--duration Nsubscribepresence enterstats --liveoccupancy subscribe--duration N| State | Meaning | Diagnostic |
|---|---|---|
| Attempting connection | Normal on startup; if stuck, check network/auth |
| Active WebSocket | Healthy |
| Temporary loss, SDK retries | Transient is normal; recurring = network issues → watch connection lifecycle logs |
| Offline >2 min, less frequent retries | Test connection to check connectivity |
| Permanent failure, SDK won't retry | Almost always auth — test with the specific API key |
| Explicitly closed by code | Search for |
| 状态 | 含义 | 诊断建议 |
|---|---|---|
| 正在尝试连接 | 启动时为正常状态;如果卡住,检查网络/认证 |
| WebSocket连接活跃 | 状态健康 |
| 临时断开,SDK会重试 | 短暂断开正常;频繁断开=网络问题 → 查看连接生命周期日志 |
| 离线超过2分钟,重试频率降低 | 测试连接以检查网络连通性 |
| 永久连接失败,SDK不会重试 | 几乎都是认证问题 → 使用指定API密钥测试连接 |
| 被代码显式关闭 | 查找代码中的 |
| State | Meaning | Diagnostic |
|---|---|---|
| Channel object created, not yet attached | Normal before first subscribe/publish |
| Requesting attach from server | If stuck, check connection state and auth capabilities |
| Active — messages flowing | Healthy |
| Requesting detach | Normal during cleanup |
| Not attached, no messages flowing | Check if |
| Attach failed, will retry | Usually follows connection suspension — check connection state first |
| Permanent channel failure | Often capability denied (40160) or invalid channel name |
| 状态 | 含义 | 诊断建议 |
|---|---|---|
| 通道对象已创建,尚未连接 | 首次订阅/发布前为正常状态 |
| 正在向服务器请求连接 | 如果卡住,检查连接状态和认证权限 |
| 已连接,消息正常传输 | 状态健康 |
| 正在请求断开连接 | 清理时为正常状态 |
| 未连接,消息无法传输 | 检查是否有意调用了 |
| 连接失败,将重试 | 通常跟随连接暂停 → 先检查连接状态 |
| 通道永久连接失败 | 通常是权限不足(40160)或通道名称无效 |
| Environment | Symptom | Root Cause | Diagnostic |
|---|---|---|---|
| Next.js SSR | Connection fails during render | No WebSocket in server-side render | Guard with |
| Serverless (Lambda, Edge) | Stale/frozen connections | Connection frozen between invocations | Use |
| React StrictMode | Duplicate messages, presence flicker | Double-render duplicates subscriptions | Check occupancy — much higher than expected = duplicates |
| CSP headers | WebSocket blocked | Ably domains not in | Test connection — ws fails, xhr works = CSP |
| Corporate proxy | WebSocket fails silently | Proxy blocking upgrade | Test connection — ws fails, xhr works = proxy |
| Mobile background | Messages missed after resume | OS kills WebSocket | Check channel history for messages sent during gap |
| 环境 | 症状 | 根本原因 | 诊断建议 |
|---|---|---|---|
| Next.js SSR | 渲染期间连接失败 | 服务端渲染中不支持WebSocket | 使用 |
| 无服务器架构(Lambda、Edge) | 连接过期/冻结 | 调用之间连接被冻结 | 服务端使用 |
| React StrictMode | 重复消息、状态闪烁 | 双重渲染导致订阅重复 | 查看通道占用情况——远高于预期值=存在重复订阅 |
| CSP头 | WebSocket被阻止 | Ably域名未加入 | 测试连接——ws失败,xhr成功=存在CSP限制 |
| 企业代理 | WebSocket静默失败 | 代理阻止升级请求 | 测试连接——ws失败,xhr成功=代理问题 |
| 移动端后台 | 恢复后错过消息 | 系统关闭了WebSocket | 查看通道历史记录,获取间隙期间发送的消息 |