From a221274ffce356d776010706deb1005ef1d68ee5 Mon Sep 17 00:00:00 2001 From: Or Friedmann Date: Tue, 31 Mar 2020 17:30:52 +0300 Subject: [PATCH] rgw: fix rgw tries to fetch anonymous user rgw tries to fetch the anonymous user although it does not exist. Fixes: https://tracker.ceph.com/issues/44772 Signed-off-by: Or Friedmann --- src/rgw/services/svc_user_rados.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rgw/services/svc_user_rados.cc b/src/rgw/services/svc_user_rados.cc index d89a02eadc0..04671bb3232 100644 --- a/src/rgw/services/svc_user_rados.cc +++ b/src/rgw/services/svc_user_rados.cc @@ -115,6 +115,10 @@ int RGWSI_User_RADOS::read_user_info(RGWSI_MetaBackend::Context *ctx, map * const pattrs, optional_yield y) { + if(user.id == RGW_USER_ANON_ID) { + ldout(svc.meta_be->ctx(), 20) << "RGWSI_User_RADOS::read_user_info(): anonymous user" << dendl; + return -ENOENT; + } bufferlist bl; RGWUID user_id; @@ -738,7 +742,11 @@ int RGWSI_User_RADOS::list_buckets(RGWSI_MetaBackend::Context *ctx, int ret; buckets->clear(); - + if (user.id == RGW_USER_ANON_ID) { + ldout(cct, 20) << "RGWSI_User_RADOS::list_buckets(): anonymous user" << dendl; + *is_truncated = false; + return 0; + } rgw_raw_obj obj = get_buckets_obj(user); bool truncated = false; -- 2.39.5