From 17b159beff4b892f07f61f38ce2fe452e55251c1 Mon Sep 17 00:00:00 2001 From: miquno <35491275+miquno@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:17:54 +0100 Subject: [PATCH] Don't let OpenDAL create a missing config folder (#7935) The Fs operator creates its root folder if it doesn't exist, so loading the config created the data folder (or failed with a misleading invalid config.json error when it couldn't). Skip building the operator if the local config folder doesn't exist, so a missing data folder is reported again like before. --- src/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config.rs b/src/config.rs index 1d75d342..a565a93e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -261,6 +261,10 @@ macro_rules! make_config { } async fn from_file() -> Result, Error> { + // The Fs operator would create the folder if it doesn't exist, which we never want + if !CONFIG_FILE_PARENT_DIR.starts_with("s3://") && !std::path::Path::new(&*CONFIG_FILE_PARENT_DIR).is_dir() { + return Ok(None); + } let operator = storage::operator_for_path(&CONFIG_FILE_PARENT_DIR)?; let config_bytes = match operator.read(&CONFIG_FILENAME).await { Ok(bytes) => bytes,