Project

General

Profile

Bug #38758

rgw: put lifecycle configuration fails if Prefix is not set (2)

Added by Konstantin Shalygin 6 months ago. Updated 6 months ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/15/2019
Due date:
% Done:

0%

Source:
Community (user)
Tags:
rgw s3 lifecycle prefix
Backport:
Regression:
Yes
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

Per Amazon S3 api docs: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html 'Prefix' is an optional field. RGW 12.2.11 fails on putBucketLifecycleConfiguration when 'Prefix' is not defined.

            LifecycleConfiguration={
                "Rules": [
                    {
                        "Expiration": {
                            "Days": 2
                        },
                        "Status": "Enabled" 
                    }
                ]
            }

Answer to client:

Code: 400
Error: An error occurred (MalformedXML) when calling the PutBucketLifecycleConfiguration operation: Unknown

RGW Log:

2019-03-15 15:38:56.449185 7fb784b95700 20 rgw::auth::s3::LocalEngine granted access
2019-03-15 15:38:56.449189 7fb784b95700 20 rgw::auth::s3::AWSAuthStrategy granted access
2019-03-15 15:38:56.449193 7fb784b95700  2 req 445463:0.002979:s3:PUT /k0ste2:put_lifecycle:normalizing buckets and tenants
2019-03-15 15:38:56.449196 7fb784b95700 10 s->object=<NULL> s->bucket=k0ste2
2019-03-15 15:38:56.449201 7fb784b95700  2 req 445463:0.002986:s3:PUT /k0ste2:put_lifecycle:init permissions
2019-03-15 15:38:56.449236 7fb784b95700 15 decode_policy Read AccessControlPolicy<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>k0ste</ID><DisplayName>Konstantin Shalygin</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>k0ste</ID><DisplayName>Konstantin Shalygin</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>
2019-03-15 15:38:56.449291 7fb784b95700  2 req 445463:0.003078:s3:PUT /k0ste2:put_lifecycle:recalculating target
2019-03-15 15:38:56.449316 7fb784b95700  2 req 445463:0.003103:s3:PUT /k0ste2:put_lifecycle:reading permissions
2019-03-15 15:38:56.449322 7fb784b95700  2 req 445463:0.003108:s3:PUT /k0ste2:put_lifecycle:init op
2019-03-15 15:38:56.449324 7fb784b95700  2 req 445463:0.003111:s3:PUT /k0ste2:put_lifecycle:verifying op mask
2019-03-15 15:38:56.449327 7fb784b95700 20 required_mask= 2 user.op_mask=7
2019-03-15 15:38:56.449328 7fb784b95700  2 req 445463:0.003115:s3:PUT /k0ste2:put_lifecycle:verifying op permissions
2019-03-15 15:38:56.449332 7fb784b95700 20 -- Getting permissions begin with perm_mask=56
2019-03-15 15:38:56.449334 7fb784b95700  5 Searching permissions for identity=rgw::auth::SysReqApplier -> rgw::auth::LocalApplier(acct_user=k0ste, acct_name=Konstantin Shalygin, subuser=, perm_mask=15, is_admin=0) mask=56
2019-03-15 15:38:56.449337 7fb784b95700  5 Searching permissions for uid=k0ste
2019-03-15 15:38:56.449338 7fb784b95700  5 Found permission: 15
2019-03-15 15:38:56.449339 7fb784b95700  5 Searching permissions for group=1 mask=56
2019-03-15 15:38:56.449340 7fb784b95700  5 Permissions for group not found
2019-03-15 15:38:56.449342 7fb784b95700  5 Searching permissions for group=2 mask=56
2019-03-15 15:38:56.449343 7fb784b95700  5 Permissions for group not found
2019-03-15 15:38:56.449343 7fb784b95700  5 -- Getting permissions done for identity=rgw::auth::SysReqApplier -> rgw::auth::LocalApplier(acct_user=k0ste, acct_name=Konstantin Shalygin, subuser=, perm_mask=15, is_admin=0), owner=k0ste, perm=8
2019-03-15 15:38:56.449346 7fb784b95700 10  identity=rgw::auth::SysReqApplier -> rgw::auth::LocalApplier(acct_user=k0ste, acct_name=Konstantin Shalygin, subuser=, perm_mask=15, is_admin=0) requested perm (type)=8, policy perm=8, user_perm_mask=8, acl perm=8
2019-03-15 15:38:56.449348 7fb784b95700  2 req 445463:0.003134:s3:PUT /k0ste2:put_lifecycle:verifying op params
2019-03-15 15:38:56.449349 7fb784b95700  2 req 445463:0.003136:s3:PUT /k0ste2:put_lifecycle:pre-executing
2019-03-15 15:38:56.449351 7fb784b95700  2 req 445463:0.003138:s3:PUT /k0ste2:put_lifecycle:executing
2019-03-15 15:38:56.449374 7fb784b95700 15 read len=213 data=<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><Expiration><Days>2</Days></Expiration><Status>Enabled</Status></Rule></LifecycleConfiguration>

2019-03-15 15:38:56.449476 7fb784b95700  2 req 445463:0.003261:s3:PUT /k0ste2:put_lifecycle:completing
2019-03-15 15:38:56.449568 7fb784b95700  2 req 445463:0.003355:s3:PUT /k0ste2:put_lifecycle:op status=-2029
2019-03-15 15:38:56.449575 7fb784b95700  2 req 445463:0.003362:s3:PUT /k0ste2:put_lifecycle:http status=400

rgw_1.log View - php log (12.3 KB) Konstantin Shalygin, 03/15/2019 09:19 AM

rgw_2.log View - python log (9.92 KB) Konstantin Shalygin, 03/15/2019 09:19 AM

rgw_lifecycle_prefix_reproducer.php View - php reproducer (1.03 KB) Konstantin Shalygin, 03/15/2019 09:19 AM

rgw_lifecycle_prefix_reproducer.py View - python reproducer (951 Bytes) Konstantin Shalygin, 03/15/2019 09:19 AM


Related issues

Duplicates rgw - Bug #37879: rgw: fix prefix handling in LCFilter Pending Backport 01/11/2019

History

#1 Updated by Konstantin Shalygin 6 months ago

(2) because Issue #19587

#2 Updated by Matt Benjamin 6 months ago

  • Status changed from New to Need Review

Hi Konstantin,

A fix for this and related issues is here: https://github.com/ceph/ceph/pull/26518

It should merge to master shortly.

Matt

#3 Updated by Konstantin Shalygin 6 months ago

Hi Matt,

Good to hear that!

#4 Updated by Casey Bodley 6 months ago

  • Duplicates Bug #37879: rgw: fix prefix handling in LCFilter added

#5 Updated by Casey Bodley 6 months ago

  • Status changed from Need Review to Duplicate

Also available in: Atom PDF