HKUDS/nanobot · error · ValueError
unknown timezone
Error message
unknown timezone {value!r} What it means
In AgentsConfig.validate_timezone, the configured timezone string is not a name known to zoneinfo (ZoneInfoNotFoundError). The validator rejects the bad value at config load; the input at fault is the timezone field (e.g. a misspelled IANA zone like 'Amercia/New_York').
Solutions
- Use a valid IANA zone name such as 'America/New_York' or 'UTC'
- Set timezoneMode to "auto" to detect the system timezone
- Install system tzdata (or the Python tzdata package) if valid zones still fail
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/config/schema.py:191 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26).
Data as JSON: /api/errors/123c7dcde3a293fa.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/config/schema.py:191
data = dict(cast(dict[str, object], value))
timezone_mode = data.get("timezoneMode", data.get("timezone_mode"))
if timezone_mode is None:
timezone_mode = "manual" if "timezone" in data else "auto"
data["timezoneMode"] = timezone_mode
if timezone_mode == "auto":
data["timezone"] = detect_system_timezone()
return data
@field_validator("timezone")
@classmethod
def validate_timezone(cls, value: str) -> str:
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
try:
ZoneInfo(value)
except ZoneInfoNotFoundError:
raise ValueError(f"unknown timezone {value!r}") from None
return value
class AgentsConfig(Base):
"""Agent configuration."""
defaults: AgentDefaults = Field(default_factory=AgentDefaults)
class ProviderConfig(Base):
"""LLM provider configuration."""
# User-facing name for dynamic custom providers.
display_name: str | None = Field(
default=None,
exclude_if=lambda value: value is None,
)
api_key: str | None = Field(default=None, repr=False)View on GitHub (pinned to 42f37dc4c0)