{"record":{"id":"4bf1687178f65ce7","repo":"pathwaycom/pathway","slug":"unexpected-value-of-pathway-snapshot-access-enviro","errorCode":null,"errorMessage":"unexpected value of PATHWAY_SNAPSHOT_ACCESS environment variable - when PATHWAY_REPLAY_STORAGE is set, PATHWAY_SNAPSHOT_ACCESS needs to be set to either 'record' or 'replay'","messagePattern":"unexpected value of PATHWAY_SNAPSHOT_ACCESS environment variable - when PATHWAY_REPLAY_STORAGE is set, PATHWAY_SNAPSHOT_ACCESS needs to be set to either 'record' or 'replay'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/pathway/internals/config.py","lineNumber":100,"sourceCode":"        \"PATHWAY_SUPPRESS_OTHER_WORKER_ERRORS\"\n    )\n    metrics_reader_interval_secs: int | None = _env_field(\n        \"PATHWAY_METRICS_READER_INTERVAL_SECONDS\",\n        default=None,\n        default_if_empty=True,\n        _type=int,\n    )\n\n    @property\n    def replay_config(\n        self,\n    ) -> persistence.Config | None:\n        if self.replay_storage:\n            if self.snapshot_access not in (\n                api.SnapshotAccess.RECORD,\n                api.SnapshotAccess.REPLAY,\n            ):\n                raise ValueError(\n                    \"unexpected value of PATHWAY_SNAPSHOT_ACCESS environment variable \"\n                    + \"- when PATHWAY_REPLAY_STORAGE is set, PATHWAY_SNAPSHOT_ACCESS \"\n                    + \"needs to be set to either 'record' or 'replay'\"\n                )\n            data_storage = persistence.Backend.filesystem(self.replay_storage)\n            persistence_config = persistence.Config(\n                data_storage,\n                persistence_mode=self.persistence_mode,\n                snapshot_access=self.snapshot_access,\n                continue_after_replay=self.continue_after_replay,\n            )\n            return persistence_config\n        else:\n            return None\n\n\n_pathway_config: ContextVar[PathwayConfig] = ContextVar(\n    \"pathway_config\", default=PathwayConfig()","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/config.py#L82-L118","documentation":"Pathway's persistence configuration derives a replay/persistence config only when PATHWAY_SNAPSHOT_ACCESS is exactly 'record' or 'replay'. If PATHWAY_REPLAY_STORAGE is set but the access mode is unset/empty or something else, replay_config raises this ValueError because it cannot decide whether the run should snapshot its state or replay from it.","triggerScenarios":"Setting PATHWAY_REPLAY_STORAGE=/tmp/persistence while PATHWAY_SNAPSHOT_ACCESS is empty, unset, or misspelled values like 'Record', 'rec', 'write', or 'run'.","commonSituations":"Enabling persistence in Docker/K8s by adding only the storage env var; case/typo mistakes; pipelines that previously used the older persistence API upgraded to a version requiring the explicit access mode.","solutions":["Set PATHWAY_SNAPSHOT_ACCESS=record for the run that should write snapshots, or PATHWAY_SNAPSHOT_ACCESS=replay for a run that should restore from them.","Verify both variables together in your deploy scripts: replay storage without an access mode is always invalid.","If you did not intend persistence, unset PATHWAY_REPLAY_STORAGE."],"exampleFix":"# before\nexport PATHWAY_REPLAY_STORAGE=/tmp/snapshots\n# PATHWAY_SNAPSHOT_ACCESS not set\n\n# after\nexport PATHWAY_REPLAY_STORAGE=/tmp/snapshots\nexport PATHWAY_SNAPSHOT_ACCESS=record","handlingStrategy":"validation","validationCode":"import os\nif os.environ.get('PATHWAY_REPLAY_STORAGE'):\n    access = os.environ.get('PATHWAY_SNAPSHOT_ACCESS', '').lower()\n    assert access in ('record', 'replay'), 'set PATHWAY_SNAPSHOT_ACCESS=record|replay'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat PATHWAY_REPLAY_STORAGE and PATHWAY_SNAPSHOT_ACCESS as a pair; set or unset both.","Add a startup env check in deployment scripts before launching the pipeline."],"tags":["pathway","persistence","environment-variables","configuration"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}