{"record":{"id":"ec76b27f2fcc8ae2","repo":"risingwavelabs/risingwave","slug":"anyhow-e","errorCode":null,"errorMessage":"anyhow!(e)","messagePattern":"anyhow!\\(e\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/optimizer/plan_node/utils.rs","lineNumber":529,"sourceCode":"    };\n    Feature::TimeTravel.check_available()?;\n    let timestamp = match a {\n        AsOf::ProcessTime | AsOf::ProcessTimeBroadcast => {\n            return Err(ErrorCode::NotSupported(\n                \"AS OF PROCTIME is not supported\".to_owned(),\n                \"please use AS OF TIMESTAMP\".to_owned(),\n            )\n            .into());\n        }\n        AsOf::TimestampNum(ts) => *ts,\n        AsOf::TimestampString(ts) => {\n            let date_time = speedate::DateTime::parse_str_rfc3339(ts)\n                .map_err(|_e| anyhow!(\"failed to parse the timestamp\"))?;\n            if date_time.time.tz_offset.is_none() {\n                // If the input does not specify a time zone, use the time zone set by the \"SET TIME ZONE\" command.\n                risingwave_expr::expr_context::TIME_ZONE::try_with(|set_time_zone| {\n                    let tz =\n                        Timestamptz::lookup_time_zone(set_time_zone).map_err(|e| anyhow!(e))?;\n                    match tz.with_ymd_and_hms(\n                        date_time.date.year.into(),\n                        date_time.date.month.into(),\n                        date_time.date.day.into(),\n                        date_time.time.hour.into(),\n                        date_time.time.minute.into(),\n                        date_time.time.second.into(),\n                    ) {\n                        MappedLocalTime::Single(d) => Ok(d.timestamp()),\n                        MappedLocalTime::Ambiguous(_, _) | MappedLocalTime::None => {\n                            Err(anyhow!(format!(\n                                \"failed to parse the timestamp {ts} with the specified time zone {tz}\"\n                            )))\n                        }\n                    }\n                })??\n            } else {\n                date_time.timestamp_tz()","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/optimizer/plan_node/utils.rs#L511-L547","documentation":"In to_batch_query_epoch, when the AS OF timestamp string has no timezone offset, RisingWave resolves the session time zone via TIME_ZONE::try_with and Timestamptz::lookup_time_zone; if the session time zone name is unknown/invalid, the lookup error is wrapped with anyhow! and propagated.","triggerScenarios":"Running `SET TIME ZONE '<bad name>'` (or a session with an invalid TimeZone setting) and then a time travel query with a timezone-less AS OF timestamp string, e.g. AS OF TIMESTAMP '2024-01-01T10:00:00'.","commonSituations":"Session configured with a wrong or unsupported time zone identifier (misspelled IANA zone, fixed offset string the parser rejects); connection pools carrying a stale SET TIME ZONE.","solutions":["Run `SET TIME ZONE` with a valid IANA time zone name (e.g. 'America/New_York') before the time travel query.","Include an explicit offset in the AS OF timestamp (e.g. '...T10:00:00+08:00') so the session time zone is not consulted.","Reset the session time zone to default (`SET TIME ZONE 'UTC'`)."],"exampleFix":"// before\nSET TIME ZONE 'PST'; -- invalid/unknown\nSELECT * FROM t AS OF TIMESTAMP '2024-01-01T10:00:00';\n// after\nSET TIME ZONE 'America/Los_Angeles';\nSELECT * FROM t AS OF TIMESTAMP '2024-01-01T10:00:00';","handlingStrategy":"validation","validationCode":"// verify session tz before timezone-less time travel queries\nlet tz = \"America/Los_Angeles\";\nassert!(tz.parse::<chrono_tz::Tz>().is_ok(), \"unknown time zone: {}\", tz);","typeGuard":"fn is_known_tz(name: &str) -> bool { name.parse::<chrono_tz::Tz>().is_ok() }","tryCatchPattern":"match res {\n    Err(e) if /* tz lookup failure */ e.to_string().to_lowercase().contains(\"time zone\") || e.to_string().contains(\"failed to parse the timestamp\") => eprintln!(\"SET TIME ZONE to a valid IANA zone or add an offset to the timestamp\"),\n    other => other?,\n}","preventionTips":["Use only IANA time zone names in SET TIME ZONE.","Always include an explicit offset in AS OF timestamps.","Avoid letting connection pools carry stale/invalid TimeZone settings."],"tags":["sql","time-travel","timezone"],"backgroundTag":"invalid-argument-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}