{"record":{"id":"d83973a7b28ad218","repo":"nautechsystems/nautilus_trader","slug":"bundled-america-new-york-timezone","errorCode":null,"errorMessage":"bundled America/New_York timezone","messagePattern":"bundled America/New_York timezone","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/decode/expiration.rs","lineNumber":45,"sourceCode":"use std::sync::LazyLock;\n\nuse ahash::AHashMap;\nuse databento::dbn;\nuse jiff::{\n    civil::Time,\n    tz::{AmbiguousOffset, Offset, TimeZone},\n};\nuse nautilus_core::{\n    UnixNanos,\n    datetime::{NANOSECONDS_IN_DAY, get_timezone},\n};\nuse ustr::Ustr;\n\n// Built-in defaults applied when a caller does not supply a `DatabentoDecodeConfig`\nstatic DEFAULT_CONFIG: LazyLock<DatabentoDecodeConfig> =\n    LazyLock::new(DatabentoDecodeConfig::default);\nstatic NEW_YORK: LazyLock<TimeZone> =\n    LazyLock::new(|| get_timezone(\"America/New_York\").expect(\"bundled America/New_York timezone\"));\n\n// New York wall-clock time applied to OPRA options by default (16:00, the regular close)\nconst fn opra_default_time() -> Time {\n    Time::constant(16, 0, 0, 0)\n}\n\n/// Rule for reinterpreting a dataset's date-level (midnight-UTC) option expiration timestamps.\n#[derive(Clone, Debug)]\npub struct OptionExpirationRule {\n    /// Exchange-local timezone the wall-clock times are expressed in.\n    pub timezone: TimeZone,\n    /// Wall-clock expiration time applied when no per-underlying override matches.\n    pub default_time: Time,\n    /// Per-underlying wall-clock overrides, keyed by underlying symbol.\n    pub overrides: AHashMap<Ustr, Time>,\n}\n\nimpl OptionExpirationRule {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/decode/expiration.rs#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)."],"exampleFix":"// before\nchrono-tz = { version = \"0.9\", default-features = false } // tzdata may be stripped\n// after\nchrono-tz = { version = \"0.9\", default-features = true } // bundled tzdb includes America/New_York","handlingStrategy":"fallback","validationCode":"// Smoke-test tz availability at startup:\nassert!(chrono_tz::get_timezone(\"America/New_York\").is_some(), \"bundled tzdb missing America/New_York\");","typeGuard":null,"tryCatchPattern":"// Fallback check before relying on the decoder default:\nlet tz = chrono_tz::get_timezone(\"America/New_York\")\n    .ok_or_else(|| anyhow!(\"bundled tzdb unavailable; enable chrono-tz default features\"))?;","preventionTips":["Keep chrono-tz default features (full bundled tz database) enabled.","Check for workspace patches that strip tzdata.","Smoke-test timezone resolution in CI."],"tags":["rust","timezone","panic","databento","chrono-tz"],"backgroundTag":"missing-dependency","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}