nautechsystems/nautilus_trader · error

bundled Europe/London timezone

Error message

bundled Europe/London timezone

What it means

The London session's `LazyLock` resolves `Europe/London` and panics if the timezone cannot be loaded. Since the identifier is a hard-coded IANA name expected to exist in the bundled database, failure signals a missing or broken timezone data source. It triggers on first use of any London FX session helper.

Source

Thrown at crates/trading/src/sessions.rs:42

//! - London Session    0800-1600 (Europe / London)
//! - New York Session  0800-1700 (America / New York)

use std::sync::LazyLock;

use jiff::{
    Span, Timestamp, Zoned,
    civil::{Time, Weekday},
    tz::TimeZone,
};
use nautilus_core::datetime::get_timezone;
use strum::{Display, EnumIter, EnumString, FromRepr};

static SYDNEY_TIMEZONE: LazyLock<TimeZone> =
    LazyLock::new(|| get_timezone("Australia/Sydney").expect("bundled Australia/Sydney timezone"));
static TOKYO_TIMEZONE: LazyLock<TimeZone> =
    LazyLock::new(|| get_timezone("Asia/Tokyo").expect("bundled Asia/Tokyo timezone"));
static LONDON_TIMEZONE: LazyLock<TimeZone> =
    LazyLock::new(|| get_timezone("Europe/London").expect("bundled Europe/London timezone"));
static NEW_YORK_TIMEZONE: LazyLock<TimeZone> =
    LazyLock::new(|| get_timezone("America/New_York").expect("bundled America/New_York timezone"));

/// Represents a major Forex market session based on trading hours.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, FromRepr, EnumIter, EnumString, Display)]
#[strum(ascii_case_insensitive)]
#[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
#[cfg_attr(
    feature = "python",
    pyo3::pyclass(
        eq,
        eq_int,
        module = "nautilus_trader.trading",
        from_py_object,
        rename_all = "SCREAMING_SNAKE_CASE"
    )
)]
#[cfg_attr(

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Ensure the bundled timezone database feature is enabled so the name resolves without the OS.
  2. Install tzdata in the deployment environment if the system database is used.
  3. Verify zoneinfo integrity (`zdump -v Europe/London`) when relying on the OS.
  4. Rebuild the project to regenerate embedded tz tables after dependency upgrades.

Example fix

// before
let tz = get_timezone("Europe/London").ok()?; // silently drops error elsewhere

// after (application-side guard before using session helpers)
let tz = get_timezone("Europe/London")
    .unwrap_or_else(|e| panic!(
Defensive patterns

Strategy: fallback

Validate before calling

fn tzdata_available() -> bool {
    std::path::Path::new("/usr/share/zoneinfo/Europe/London").exists()
}

Try / catch

// Panics cannot be caught in Rust; validate at startup
if !tzdata_available() {
    panic!("Europe/London unresolvable: tzdata missing");
}

Prevention

When it happens

Trigger: First evaluation of `LONDON_TIMEZONE` (London session start/end helpers) where `get_timezone("Europe/London")` returns `Err`.

Common situations: Containers/alpine images without tzdata; custom builds dropping the bundled tz feature; corrupted or partial `/usr/share/zoneinfo` when system lookup is used.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/960d686d5afb4d3d. Report an issue: GitHub.