Description of problem: RGW returns wrong HTTP status code for expired STS token. Version-Release number of selected component (if applicable): How reproducible: From the customer: RGW is returning http 403 status code instead of returning 401 status code: We've noticed when a STS token is expired the RGW is returning the wrong status code back, currently it looks like it returns a 403 but is should return a 401 status code since the credentials expired. ``` ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.195+0000 7f243be08640 0 req 11324914595151635225 0.000000000s s3:list_bucket ERROR: Token expired ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.195+0000 7f243be08640 1 beast: 0x7f2405c99650: 17.155.209.182 - - [05/Mar/2025:17:44:34.195 +0000] "GET /swe-diaglogs-prod-acos-b1-us-east-1?list-type=2&delimiter=%2F&prefix=checkpoints%2F5b740509d79a31c4a48b045e38554bb5%2Fshared%2F&fetch-owner=false&max-keys=2 HTTP/1.1" 403 206 - "Hadoop 3.3.4, aws-sdk-java/1.12.779 Linux/5.4.144-16.el7pie OpenJDK_64-Bit_Server_VM/17.0.12+7-LTS java/17.0.12 kotlin/1.4.10 vendor/Apple_Inc. cfg/retry-mode/legacy cfg/auth-source#unknown" - latency=0.000000000s ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.229+0000 7f248569b640 0 req 12402845197639486671 0.000000000s s3:get_obj ERROR: Token expired ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.229+0000 7f248569b640 1 beast: 0x7f2405c99650: 17.155.209.182 - - [05/Mar/2025:17:44:34.229 +0000] "HEAD /swe-diaglogs-prod-acos-b1-us-east-1/checkpoints/job-result-store/gulch-qualified-iquej/1b95678a-bd9c-4217-a6e4-63b5c05d0a15/5b740509d79a31c4a48b045e38554bb5.json HTTP/1.1" 403 0 - "Hadoop 3.3.4, aws-sdk-java/1.12.779 Linux/5.4.144-16.el7pie OpenJDK_64-Bit_Server_VM/17.0.12+7-LTS java/17.0.12 kotlin/1.4.10 vendor/Apple_Inc. cfg/retry-mode/legacy cfg/auth-source#unknown" - latency=0.000000000s ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.232+0000 7f24e1f54640 0 req 1415287706486596062 0.001000000s s3:list_bucket ERROR: Token expired ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.232+0000 7f24e1f54640 1 beast: 0x7f2405c99650: 17.155.209.182 - - [05/Mar/2025:17:44:34.231 +0000] "GET /swe-diaglogs-prod-acos-b1-us-east-1?delimiter=%2F&max-keys=2&prefix=checkpoints%2Fjob-result-store%2Fgulch-qualified-iquej%2F1b95678a-bd9c-4217-a6e4-63b5c05d0a15%2F5b740509d79a31c4a48b045e38554bb5.json%2F&fetch-owner=false&list-type=2 HTTP/1.1" 403 206 - "Hadoop 3.3.4, aws-sdk-java/1.12.779 Linux/5.4.144-16.el7pie OpenJDK_64-Bit_Server_VM/17.0.12+7-LTS java/17.0.12 kotlin/1.4.10 vendor/Apple_Inc. cfg/retry-mode/legacy cfg/auth-source#unknown" - latency=0.001000000s ceph-client.rgw.rgw.cephnode0438.jdbvbp.log:2025-03-05T17:44:34.360+0000 7f24d1733640 1 beast: 0x7f2405d9b650: 17.155.210.19 - rtr_66a17ab7f25bf76ec1fa3c67$rtr_66a17ab7f25bf76ec1fa3c67 [05/Mar/2025:17:44:34.359 +0000] "HEAD /root-bucket-0/36318-6555374801-daol-129/0-a1-tsew-su-ycnetal-1-tsae-su-dorp-sot/0/0/0/91 HTTP/1.1" 404 0 - - - latency=0.001000000s ``` I've noticed a previous bug reported as well https://tracker.ceph.com/issues/22223 that might be related. Steps to Reproduce: 1. 2. 3. Actual results: 403 Expected results: 401 Additional info:
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Red Hat Ceph Storage 9.0 Security and Enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2026:1536