stalwartlabs/stalwart · error · io::Error(Other)
journald not supported on non-Unix
Error message
journald not supported on non-Unix
What it means
On non-Unix targets the journald tracer's send_payload is a stub that always returns an io::Error of kind Other. Since real payload delivery only exists under #[cfg(unix)], any event sent on a non-Unix build fails with this message.
Source
Thrown at crates/common/src/telemetry/tracers/journald.rs:246
///
/// See [Journal Fields](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html)
/// and [journalctl](https://www.freedesktop.org/software/systemd/man/journalctl.html)
/// for more information.
///
/// Defaults to the file name of the executable of the current process, if any.
pub fn with_syslog_identifier(mut self, identifier: String) -> Self {
self.syslog_identifier = identifier;
self
}
/// Returns the syslog identifier in use.
pub fn syslog_identifier(&self) -> &str {
&self.syslog_identifier
}
#[cfg(not(unix))]
fn send_payload(&self, _opayload: &[u8]) -> io::Result<()> {
Err(io::Error::new(
io::ErrorKind::Other,
"journald not supported on non-Unix",
))
}
#[cfg(unix)]
fn send_payload(&self, payload: &[u8]) -> io::Result<usize> {
self.socket
.send_to(payload, JOURNALD_PATH)
.or_else(|error| {
if Some(libc::EMSGSIZE) == error.raw_os_error() {
self.send_large_payload(payload)
} else {
Err(error)
}
})
}
View on GitHub (pinned to e962003857)
Solutions
- Reconfigure logging to a supported sink on non-Unix platforms.
- Ensure the journald tracer is only enabled in Unix deployments.
- Handle the io::Result error from send_event and fall back to another tracer.
Example fix
// before
tracer.send_event(evt).ok();
// after
if cfg!(not(unix)) { file_tracer.send_event(evt) } else { tracer.send_event(evt) } Defensive patterns
Strategy: fallback
Validate before calling
if cfg!(not(unix)) { use_file_tracer_instead(); } Type guard
fn can_send_to_journald() -> bool { cfg!(unix) } Try / catch
if tracer.send_event(event).is_err() {
fallback_tracer.send_event(event);
} Prevention
- Gate journald logging behind #[cfg(unix)]/platform checks in your own glue code.
- Configure OS-appropriate telemetry sinks per deployment.
- Route event dispatch through an abstraction that picks the sink at runtime.
- Alert on send_event failures so silent log loss is detected.
When it happens
Trigger: Calling send_payload (via send_event when emitting telemetry events) on a non-Unix build — every event dispatch returns this error.
Common situations: A binary compiled for Windows/macOS(non-unix target) still configured to log to journald; platform-gated config not applied at runtime.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
AI-assisted analysis of stalwartlabs/stalwart@e962003857 (2026-09-06).
Data as JSON: /api/errors/206c3aa616290f1b.
Report an issue: GitHub.