{"record":{"id":"eff2d7cca60889c6","repo":"nautechsystems/nautilus_trader","slug":"failed-to-create-catalog-from-path","errorCode":null,"errorMessage":"Failed to create catalog from path","messagePattern":"Failed to create catalog from path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/persistence/src/backend/catalog.rs","lineNumber":233,"sourceCode":"    /// );\n    /// ```\n    #[must_use]\n    pub fn new(\n        base_path: &Path,\n        storage_options: Option<AHashMap<String, String>>,\n        batch_size: Option<usize>,\n        compression: Option<parquet::basic::Compression>,\n        max_row_group_size: Option<usize>,\n    ) -> Self {\n        let path_str = base_path.to_string_lossy().to_string();\n        Self::from_uri(\n            &path_str,\n            storage_options,\n            batch_size,\n            compression,\n            max_row_group_size,\n        )\n        .expect(\"Failed to create catalog from path\")\n    }\n\n    /// Creates a new [`ParquetDataCatalog`] instance from a URI with optional storage options.\n    ///\n    /// Supports various URI schemes including local file paths and multiple cloud storage backends\n    /// supported by the `object_store` crate.\n    ///\n    /// # Supported URI Schemes\n    ///\n    /// - **AWS S3**: `s3://bucket/path`.\n    /// - **Google Cloud Storage**: `gs://bucket/path` or `gcs://bucket/path`.\n    /// - **Azure Blob Storage**: `az://container/path` or `abfs://container@account.dfs.core.windows.net/path`.\n    /// - **HTTP/WebDAV**: `http://` or `https://`.\n    /// - **Local files**: `file://path` or plain paths.\n    ///\n    /// # Parameters\n    ///\n    /// - `uri`: The URI for the data storage location.","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/persistence/src/backend/catalog.rs#L215-L251","documentation":"ParquetDataCatalog::new builds a catalog from a filesystem/URI path and unwraps the underlying construction result. Any failure initializing the catalog (path resolution, object_store backend creation, invalid options) surfaces as this panic instead of a Result.","triggerScenarios":"Calling ParquetDataCatalog::new with a nonexistent or inaccessible path, an unsupported URI scheme, invalid storage_options for the backend, or incompatible batch_size/compression/max_row_group_size values.","commonSituations":"Typo in the data directory, missing cloud credentials/storage options for s3/gcs/azure URIs, running without the write directory existing, wrong compression setting name.","solutions":["Verify the path/URI exists and is accessible before constructing the catalog.","For cloud URIs, supply the correct storage_options (keys, endpoints, region).","Check compression and batch_size values against supported options.","Prefer a constructor returning Result (e.g. from_uri variant) to handle errors gracefully."],"exampleFix":"// before\nlet catalog = ParquetDataCatalog::new(trader_id, instance_id, path, None, None, None, None);\n// after\nif !Path::new(path_str).exists() {\n    eprintln!(\"catalog path missing: {path_str}\");\n    return;\n}\nlet catalog = ParquetDataCatalog::new(trader_id, instance_id, path, None, None, None, None);","handlingStrategy":"validation","validationCode":"if !Path::new(path).exists() {\n    eprintln!(\"catalog path does not exist: {path}\");\n    return;\n}","typeGuard":"fn path_accessible(p: &str) -> bool { Path::new(p).exists() }","tryCatchPattern":"let catalog = std::panic::catch_unwind(|| ParquetDataCatalog::new(/*...*/))\n    .map_err(|_| anyhow::anyhow!(\"failed to create catalog at {path}\"))?;","preventionTips":["Check path/URI existence and permissions before construction","Supply complete storage_options for cloud backends (credentials, region)","Verify compression/batch_size values are supported"],"tags":["rust","persistence","parquet","catalog","initialization"],"backgroundTag":"file-not-found","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}