{"record":{"id":"9ea5241ce0d9fc74","repo":"neondatabase/neon","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"libs/remote_storage/src/local_fs.rs","lineNumber":455,"sourceCode":"            cancel.cancelled().await;\n            Err(DownloadError::Cancelled)\n        };\n\n        tokio::select! {\n            res = op => res,\n            res = timeout => res,\n            res = cancelled => res,\n        }\n    }\n\n    async fn list_versions(\n        &self,\n        _prefix: Option<&RemotePath>,\n        _mode: ListingMode,\n        _max_keys: Option<NonZeroU32>,\n        _cancel: &CancellationToken,\n    ) -> Result<crate::VersionListing, DownloadError> {\n        unimplemented!()\n    }\n\n    async fn head_object(\n        &self,\n        key: &RemotePath,\n        _cancel: &CancellationToken,\n    ) -> Result<ListingObject, DownloadError> {\n        let target_file_path = key.with_base(&self.storage_root);\n        let metadata = file_metadata(&target_file_path).await?;\n        Ok(ListingObject {\n            key: key.clone(),\n            last_modified: metadata.modified()?,\n            size: metadata.len(),\n        })\n    }\n\n    async fn upload(\n        &self,","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/libs/remote_storage/src/local_fs.rs#L437-L473","documentation":"LocalFileSystem, the local-directory backend of the remote_storage crate, does not implement versioned object listing. Its list_versions() body is the unimplemented!() macro, so calling it panics at runtime ('not implemented') instead of returning a DownloadError. Version-aware listing is only provided by object stores with real versioning semantics, e.g. the S3 backend.","triggerScenarios":"Calling list_versions() (directly or via GenericRemoteStorage) on a storage handle constructed for LocalFileSystem, e.g. a pageserver or compute configured with a local remote_storage backend when some code path requests ListingMode with versions. Any code that enumerates object versions (versioned GC, old-version cleanup) hits the panic immediately.","commonSituations":"Development or test environments that use local_fs remote storage while running a feature that was only exercised against S3 (works in staging with S3, panics locally); CI jobs that toggle the storage backend; deploying with a local prefix instead of an S3 bucket.","solutions":["Do not enable code paths that need versioned listing against a local backend; switch the storage configuration to an S3-compatible backend if version listing is required","Return a proper DownloadError from LocalFileSystem::list_versions instead of unimplemented!() so callers can degrade gracefully","If you own the feature, implement list_versions for LocalFileSystem (scan suffixed/versioned files) or gate the feature on backend capabilities"],"exampleFix":"// before (libs/remote_storage/src/local_fs.rs)\n    async fn list_versions(...) -> Result<crate::VersionListing, DownloadError> {\n        unimplemented!()\n    }\n// after\n    async fn list_versions(...) -> Result<crate::VersionListing, DownloadError> {\n        Err(DownloadError::BadInput(anyhow::anyhow!(\n            \"list_versions is not supported by the local filesystem backend\",\n        )))\n    }","handlingStrategy":"validation","validationCode":"// Before touching versioned listing, check backend capability\nlet supports_versions = !matches!(remote_storage_kind, RemoteStorageKind::LocalFs(_));\nif !supports_versions {\n    return Ok(Default::default()); // skip versioned GC / listing\n}\nlet listing = storage.list_versions(prefix, mode, max_keys, cancel).await?;","typeGuard":"fn supports_list_versions(kind: &RemoteStorageKind) -> bool {\n    !matches!(kind, RemoteStorageKind::LocalFs(_))\n}","tryCatchPattern":"// It is a panic, not a Result: only catch_unwind can contain it if truly unavoidable\nlet res = std::panic::catch_unwind(AssertUnwindSafe(|| {\n    storage.list_versions(prefix, mode, max_keys, cancel)\n}));\nif res.is_err() { /* fall back to unversioned listing */ }","preventionTips":["Never enable version-dependent features against a local_fs backend; assert backend kind at startup","Run integration tests for any feature that lists objects with the same backend type as production","Treat unimplemented!()/todo!() in trait impls as panics when reviewing: replace with typed errors before shipping"],"tags":["rust","remote-storage","local-fs","panic","unimplemented","object-versioning"],"backgroundTag":"unsupported-operation","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}