{"record":{"id":"cbbd8585d251b9b3","repo":"pathwaycom/pathway","slug":"unexpected-value-for-name-r-environment-variable","errorCode":null,"errorMessage":"Unexpected value for {name!r} environment variable: {value!r}","messagePattern":"Unexpected value for (.+?) environment variable: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/config.py","lineNumber":35,"sourceCode":"        value = os.environ.get(name, default)\n        if default_if_empty and value == \"\":\n            value = default\n        if value is not None:\n            return _type(value)\n        return value\n\n    return field(default_factory=factory)\n\n\ndef _env_bool_field(name: str, *, default: str = \"false\"):\n    def factory():\n        value = os.environ.get(name, default).lower()\n        if value in (\"1\", \"true\", \"yes\"):\n            return True\n        elif value in (\"0\", \"false\", \"no\"):\n            return False\n        else:\n            raise ValueError(\n                f\"Unexpected value for {name!r} environment variable: {value!r}\"\n            )\n\n    return field(default_factory=factory)\n\n\ndef _snapshot_access() -> api.SnapshotAccess | None:\n    match os.environ.get(\"PATHWAY_SNAPSHOT_ACCESS\", \"\").lower():\n        case \"record\":\n            return api.SnapshotAccess.RECORD\n        case \"replay\":\n            return api.SnapshotAccess.REPLAY\n        case _:\n            return None\n\n\ndef _persistence_mode() -> api.PersistenceMode:\n    match os.environ.get(","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/config.py#L17-L53","documentation":"Pathway's runtime configuration parses boolean fields from environment variables, accepting only 1/true/yes (case-insensitive) as true and 0/false/no as false. Any other value for a boolean PATHWAY_* env var (e.g. PATHWAY_MONITORING_XML) makes the config dataclass factory raise a ValueError at config-construction time.","triggerScenarios":"Setting PATHWAY_MONITORING_XML=on, PATHWAY_PERSISTENCE=enable, or PATHWAY_CONTINUOUS_LOGGING=TRUE-ish variants like 'TrUe' are fine, but values like 'on', 'enabled', 'yes please', or an empty string for vars whose default kicks in only when unset all fail.","commonSituations":"Docker/Kubernetes env files using ON/OFF conventions; typos like 'fasle'; CI injecting empty strings (NAME=\"\") which override the default and then fail parsing.","solutions":["Set the variable to one of the accepted literals: 1/true/yes or 0/false/no (lowercased before comparison, so case does not matter).","Unset the variable entirely if you want the default, especially avoid empty-string values: use `unset VAR` or remove the line from the env file (docker-compose: comment it out rather than leaving VAR=).","Audit all PATHWAY_* booleans in your deployment env (env | grep ^PATHWAY_) and normalize them."],"exampleFix":"# before (docker-compose.yml)\nenvironment:\n  PATHWAY_MONITORING_XML: \"on\"\n\n# after\nenvironment:\n  PATHWAY_MONITORING_XML: \"true\"","handlingStrategy":"validation","validationCode":"import os\n_TRUE, _FALSE = {'1','true','yes'}, {'0','false','no'}\nfor name in ['PATHWAY_MONITORING_XML', 'PATHWAY_CONTINUOUS_LOGGING']:\n    v = os.environ.get(name)\n    if v is not None:\n        assert v.lower() in _TRUE | _FALSE, f'{name}={v!r} not a recognized boolean'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only 1/true/yes and 0/false/no for PATHWAY_* booleans.","Never set PATHWAY_* vars to empty strings in compose files; remove the line instead."],"tags":["pathway","configuration","environment-variables","deployment"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}