-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Problem
_get_default_ignore_datasets_file() in config.py hardcodes the cache directory via platformdirs.user_cache_path("climate_ref") and immediately tries to mkdir it. This fails with Errno 30 (read-only filesystem) in environments where the platformdirs cache path is not writable (e.g. containers, read-only mounts).
The function couples two concerns:
- Where the file is stored (cache directory)
- Fetching the file (downloading from GitHub)
Proposed Solution
Decouple the storage location from the fetch logic:
- The default download location should still be
platformdirs.user_cache_path("climate_ref"), but it should be overridable (e.g. via an environment variable or config field for the cache directory) - The fetch logic should handle a read-only or non-existent cache directory gracefully rather than failing during config loading
- If the cache directory is not writable, fall back to a bundled/embedded copy or skip the download without crashing
Context
The error surfaces as a key_validation_error during config loading because the mkdir call happens inside a default factory for the ignore_datasets_file field on Config, which runs during cattrs structuring.
key_validation_error containing unknown error (Errno 30) Read-only file system: '/ref/cache'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels