From 48ded6b965a545ee441e5cc1e6ae8df1f9cb44fb Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 8 Jan 2026 20:11:57 -0800 Subject: [PATCH] fix: allow environment variable fallback when filer config is empty Fixed regression where AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables were not being loaded as fallback credentials. The issue was that configLoaded was set to true when filer call succeeded, even if it returned an empty configuration. This blocked the environment variable fallback logic. Now only set configLoaded = true when we actually have loaded identities, allowing env vars to work correctly in mini mode and other scenarios where filer config is empty. --- weed/s3api/auth_credentials.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go index 662f7e10b..978b6c0e4 100644 --- a/weed/s3api/auth_credentials.go +++ b/weed/s3api/auth_credentials.go @@ -184,12 +184,12 @@ func NewIdentityAccessManagementWithStore(option *S3ApiServerOption, explicitSto glog.V(3).Infof("no static config file specified... loading config from credential manager") if err := iam.loadS3ApiConfigurationFromFiler(option); err != nil { glog.Warningf("fail to load config: %v", err) - } else { - // Check if any identities were actually loaded from filer - iam.m.RLock() - configLoaded = len(iam.identities) > 0 - iam.m.RUnlock() } + // Only consider config loaded if we actually have identities + // Don't block environment variable fallback just because filer call succeeded + iam.m.RLock() + configLoaded = len(iam.identities) > 0 + iam.m.RUnlock() } // Only use environment variables as fallback if no configuration was loaded