Pumpkin-MC/Pumpkin · error · AuthError
Unknown Status Code
Error message
Unknown Status Code {0} What it means
PacketError::FailedSend(std::io::Error) wraps the underlying I/O error that occurred while writing an RCON packet to the socket. The variant preserves the original io::Error so callers can inspect the OS-level cause (broken pipe, connection reset, etc.). It means the packet was never fully transmitted.
Solutions
- Inspect the wrapped io::Error kind (BrokenPipe, ConnectionReset, TimedOut) and reconnect if the connection is dead.
- Retry the command on a freshly established RCON connection.
- Check that the RCON server is running and the port/firewall allow the connection.
- Avoid sharing the RCON connection across threads without synchronization to prevent interleaved failed writes.
Example fix
// before
stream.write_all(&packet_bytes).await?; // generic io error, no context
// after
stream.write_all(&packet_bytes).await
.map_err(PacketError::FailedSend)?; Defensive patterns
Strategy: retry
Validate before calling
fn can_send(conn: &RconConnection) -> bool {
!conn.is_closed()
} Try / catch
match rcon_conn.send(&packet).await {
Err(PacketError::FailedSend(io)) if matches!(io.kind(), io::ErrorKind::BrokenPipe | io::ErrorKind::ConnectionReset) => {
warn!("RCON connection lost ({io}); reconnecting");
rcon_conn = RconConnection::connect(addr).await?;
rcon_conn.send(&packet).await?;
}
Err(e) => return Err(e),
Ok(_) => {}
} Prevention
- Check connection health before sending commands.
- Inspect the wrapped io::Error kind to pick retry vs abort.
- Reconnect and resend once on broken-pipe/reset errors.
- Serialize sends through one task/lock to avoid interleaved writes.
When it happens
Trigger: Writing an RCON packet to a socket whose peer has closed (broken pipe / ECONNRESET); any io::Error surfacing during the send path of the RCON client/server.
Common situations: Server restarting or dropping the RCON connection while a command is being sent; firewall/network interruption mid-write; writing to an already-closed TCP stream.
Related errors
AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09).
Data as JSON: /api/errors/3211eaa87356784f.
Report an issue: GitHub.
Appendix: source
Thrown at crates/pumpkin/src/net/authentication.rs:407
Err(AuthError::FailedResponse)
}
}
#[derive(Error, Debug)]
pub enum AuthError {
#[error("Authentication servers are down")]
FailedResponse,
#[error("Failed to verify username")]
UnverifiedUsername,
#[error("You are banned from Authentication servers")]
Banned,
#[error("Texture Error {0}")]
TextureError(TextureError),
#[error("You have disallowed actions from Authentication servers")]
DisallowedAction,
#[error("Failed to parse JSON into Game Profile")]
FailedParse,
#[error("Unknown Status Code {0}")]
UnknownStatusCode(StatusCode),
}
#[derive(Error, Debug)]
pub enum TextureError {
#[error("Invalid URL")]
InvalidURL,
#[error("Invalid URL scheme for player texture: {0}")]
DisallowedUrlScheme(String),
#[error("Invalid URL domain for player texture: {0}")]
DisallowedUrlDomain(String),
#[error("Failed to decode base64 player texture: {0}")]
DecodeError(String),
#[error("Failed to parse JSON from player texture: {0}")]
JSONError(String),
}
#[cfg(test)]View on GitHub (pinned to 8d4639e25a)