egametang/ET · error · Exception
GetChannelConn conn not found KChannel! {channelId}
Error message
GetChannelConn conn not found KChannel! {channelId} What it means
KService.GetChannelConn looks up a KChannel by id and throws when none is found. The channel was either never created, already removed (disposed/errored), or the id is stale.
Source
Thrown at Packages/cn.etetet.core/Scripts/Core/Share/Network/KService.cs:117
}
base.Dispose();
foreach (long channelId in this.localConnChannels.Keys.ToArray())
{
this.Remove(channelId);
}
this.Transport.Dispose();
this.Transport = null;
}
public override (uint, uint) GetChannelConn(long channelId)
{
KChannel kChannel = this.Get(channelId);
if (kChannel == null)
{
throw new Exception($"GetChannelConn conn not found KChannel! {channelId}");
}
return (kChannel.LocalConn, kChannel.RemoteConn);
}
public override void ChangeAddress(long channelId, IPEndPoint newIPEndPoint)
{
KChannel kChannel = this.Get(channelId);
if (kChannel == null)
{
return;
}
kChannel.RemoteAddress = newIPEndPoint;
}
private void Recv()
{
if (this.Transport == null)
{View on GitHub (pinned to 5cab01f7a8)
Solutions
- Get the channel and null-check before querying conn ids (use Get which returns null).
- Clear id references when a channel is removed/disposed.
- Tolerate a missing channel at the call site instead of throwing.
Example fix
// before (uint l, uint r) = kService.GetChannelConn(channelId); // after var ch = kService.Get(channelId); if (ch == null) return; (uint l, uint r) = (ch.LocalConn, ch.RemoteConn);
Defensive patterns
Strategy: validation
Validate before calling
var ch = kService.Get(channelId);
if (ch == null) { Log.Warning($"channel {channelId} gone"); return; }
(uint l, uint r) = (ch.LocalConn, ch.RemoteConn); Type guard
public bool HasChannel(long id) => Get(id) != null;
Try / catch
null
Prevention
- Invalidate stored channel ids when channels are removed.
- Null-check via Get before querying conn ids.
- Make GetChannelConn return a default/bool-out variant instead of throwing.
When it happens
Trigger: Querying a channel id after it was removed on disconnect/error, using an id from a previous service lifecycle, or a routing table pointing at a dead channel.
Common situations: Stale connection references held by a session manager, query racing with OnError cleanup, or wrong id passed.
Related errors
- bind error: {ipEndPoint}
- kchannel connected but kcp is zero!
- default conn throw Exception! {channelId}
- bufferList length < count, {Length} {count}
- bufferList length < coutn, buffer length: {buffer.Length} {o
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/84b486ba5d323a61.
Report an issue: GitHub.