From 124a1a54111e4a506f82f20e4a5b453c24066e60 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 4 Sep 2026 12:27:27 +0000 Subject: [PATCH] fix(unmount): don't require broker/bucket creds to unmount runUnmount only scans FUSEY_CACHE_DIR/*/daemon.pid to find the daemon PID and sends SIGTERM; it never touches S3 or the broker. The object-store requirement was baked into the shared mustLoadConfig() helper, so failed with "either FUSEY_BROKER_URL or FUSEY_BUCKET is required" even when a daemon was running. Split the check out of mustLoadConfig() into requireStore(cfg) and call it only in the paths that need object storage: runMount, runDaemon, runCompact. Co-authored-by: openhands --- cmd/fusey/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/fusey/main.go b/cmd/fusey/main.go index 34f4c39..7487669 100644 --- a/cmd/fusey/main.go +++ b/cmd/fusey/main.go @@ -106,6 +106,7 @@ func main() { // the daemon failed; the parent exits non-zero and refers the user to the log. func runMount(mountpoint string) { cfg := mustLoadConfig() + requireStore(cfg) daemonID := newDaemonID() daemonDir := filepath.Join(cfg.CacheDir, daemonID) @@ -174,6 +175,7 @@ func runMount(mountpoint string) { // index, removes the PID file, and exits. func runDaemon(daemonID, mountpoint string) { cfg := mustLoadConfig() + requireStore(cfg) daemonDir := filepath.Join(cfg.CacheDir, daemonID) if err := os.MkdirAll(daemonDir, 0755); err != nil { @@ -318,6 +320,7 @@ func runUnmount(mountpoint string) { // updated index, and exits. Intended to be called from a Kubernetes CronJob. func runCompact() { cfg := mustLoadConfig() + requireStore(cfg) ctx := context.Background() objStore, cs := mustBuildStore(ctx, cfg) @@ -340,10 +343,17 @@ func mustLoadConfig() *config.Config { if err != nil { log.Fatalf("config: %v", err) } + return cfg +} + +// requireStore fatal-exits when neither FUSEY_BROKER_URL nor FUSEY_BUCKET is +// set. Only the mount, daemon, and compact paths need an object store; unmount +// operates purely on local PID files under FUSEY_CACHE_DIR and must not require +// store credentials. +func requireStore(cfg *config.Config) { if cfg.BrokerURL == "" && cfg.Bucket == "" { log.Fatal("either FUSEY_BROKER_URL or FUSEY_BUCKET is required") } - return cfg } // mustBuildStore constructs the appropriate ObjectStore based on config.