nautechsystems/nautilus_trader · error
bundled America/New_York timezone
Error message
bundled America/New_York timezone
What it means
The Databento decoder resolves the America/New_York IANA timezone at first use via chrono-tz's get_timezone and expects it to exist, since it ships in the bundled tz database. A panic here means the timezone database lookup failed — effectively the bundled tzdata is missing or the chrono-tz feature configuration excludes it.
Source
Thrown at crates/adapters/databento/src/decode/expiration.rs:45
use std::sync::LazyLock;
use ahash::AHashMap;
use databento::dbn;
use jiff::{
civil::Time,
tz::{AmbiguousOffset, Offset, TimeZone},
};
use nautilus_core::{
UnixNanos,
datetime::{NANOSECONDS_IN_DAY, get_timezone},
};
use ustr::Ustr;
// Built-in defaults applied when a caller does not supply a `DatabentoDecodeConfig`
static DEFAULT_CONFIG: LazyLock<DatabentoDecodeConfig> =
LazyLock::new(DatabentoDecodeConfig::default);
static NEW_YORK: LazyLock<TimeZone> =
LazyLock::new(|| get_timezone("America/New_York").expect("bundled America/New_York timezone"));
// New York wall-clock time applied to OPRA options by default (16:00, the regular close)
const fn opra_default_time() -> Time {
Time::constant(16, 0, 0, 0)
}
/// Rule for reinterpreting a dataset's date-level (midnight-UTC) option expiration timestamps.
#[derive(Clone, Debug)]
pub struct OptionExpirationRule {
/// Exchange-local timezone the wall-clock times are expressed in.
pub timezone: TimeZone,
/// Wall-clock expiration time applied when no per-underlying override matches.
pub default_time: Time,
/// Per-underlying wall-clock overrides, keyed by underlying symbol.
pub overrides: AHashMap<Ustr, Time>,
}
impl OptionExpirationRule {View on GitHub (pinned to 18893faf8b)
Solutions
- Enable the default features of chrono-tz (full bundled tz database) in Cargo.toml.
- Verify the dependency graph hasn't patched chrono-tz to a minimal build; restore the full tzdata.
- If running in a constrained environment, prefer chrono-tz's bundled database over system tzdata lookup (get_timezone uses the bundle by default).
Example fix
// before
chrono-tz = { version = "0.9", default-features = false } // tzdata may be stripped
// after
chrono-tz = { version = "0.9", default-features = true } // bundled tzdb includes America/New_York Defensive patterns
Strategy: fallback
Validate before calling
// Smoke-test tz availability at startup:
assert!(chrono_tz::get_timezone("America/New_York").is_some(), "bundled tzdb missing America/New_York"); Try / catch
// Fallback check before relying on the decoder default:
let tz = chrono_tz::get_timezone("America/New_York")
.ok_or_else(|| anyhow!("bundled tzdb unavailable; enable chrono-tz default features"))?; Prevention
- Keep chrono-tz default features (full bundled tz database) enabled.
- Check for workspace patches that strip tzdata.
- Smoke-test timezone resolution in CI.
When it happens
Trigger: First access of NEW_YORK (e.g. decoding OPRA option expirations with default DatabentoDecodeConfig) when chrono-tz's built-in tzdata cannot resolve "America/New_York" — typically due to an unusual feature selection or a stripped build of the tz database.
Common situations: Custom feature flags that disable parts of chrono-tz's bundled data; vendoring/patching chrono-tz with a reduced timezone set; unusual no-std/minimal builds.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- Chunk should have at least one element to encode
- API key is valid UTF-8
- 16 lowercase hex bytes are valid TradeId
- bundled Australia/Sydney timezone
- bundled Asia/Tokyo timezone
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/d83973a7b28ad218.
Report an issue: GitHub.