Project

General

Profile

Actions

Bug #16828

closed

radosgw swift interface put object response 500 error?

Added by colin lau almost 8 years ago. Updated over 7 years ago.

Status:
Can't reproduce
Priority:
High
Assignee:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

hello,
I startup a radosgw (Civetweb embedded), i want use swift interface to put/get oject;

my radosgw's ceph config:

[global]
fsid = 584ba99d-0665-4465-b693-6c78ae25576f
mon_initial_members = n6-0**-0**, n6-0**-0**, n6-0**-0**
mon_host = 10.6.**.**, 10.5.**.**, 10.4.**.**
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
filestore_xattr_use_omap = true
osd pool default size = 1  # Write an object 3 times.
osd pool default min size = 1 # Allow writing one copy in a degraded state.
osd pool default pg num = 2000
osd pool default pgp num = 2000
keyring = /etc/ceph/ceph.client.admin.keyring
#debug ms = 1 
#debug rgw = 20

[client.radosgw.gateway]
host = in**-**
keyring = /etc/ceph/ceph.client.radosgw.keyring
rgw_frontends = "civetweb port=9980" 
rgw socket path = "" 
log file = /var/log/radosgw/client.bootstrap-rgw.log

radosgw.keyring

ceph# vi ceph.client.radosgw.keyring
  1 [client.radosgw.gateway]
  2   key = AQDY5pFXyvELDRAAvl6HCERMwpwfHIKaA23rlw==

start radosgw:

/etc/init.d/radosgw start

secondly, i create a swift user:

radosgw-admin user create --uid="dockeruser" --display-name="Docker User" 
radosgw-admin subuser create --uid=dockeruser --subuser=dockeruser:swift --access=full
radosgw-admin key create --subuser=dockeruser:swift --key-type=swift --gen-secret

{
    "user_id": "dockeruser",
    "display_name": "Docker User",
    "email": "",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [
        {
            "id": "dockeruser:swift",
            "permissions": "full-control" 
        }
    ],
    "keys": [
        {
            "user": "dockeruser",
            "access_key": "9LJMM0BAMI7XU1ZAB0BG",
            "secret_key": "8uF7OLlLsqCaCsfE08sOKiCb9gIrYEQICoH475Xw" 
        }
    ],
    "swift_keys": [
        {
            "user": "dockeruser:swift",
            "secret_key": "oY894WlkjlyUAxHacYNMAyR8dpR3ZzlRoBJbt3xW" 
        }
    ],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

and then use swiftclient to communicate:


swiftclient$ python shell.py -A http://10.4.**.**:9980/auth/1.0 -U dockeruser:swift -K 'oY894WlkjlyUAxHacYNMAyR8dpR3ZzlRoBJbt3xW' stat
                    Account: v1
                 Containers: 5
                    Objects: 0
                      Bytes: 0
                X-Timestamp: 1469590199.89180
X-Account-Bytes-Used-Actual: 0
                 X-Trans-Id: tx0000000000000000012e8-0057982ab7-b215dd-default
               Content-Type: text/plain; charset=utf-8
              Accept-Ranges: bytes

# create a bucket(container):
swiftclient$ python shell.py -A http://10.4.**.**:9980/auth/1.0 -U dockeruser:swift -K 'oY894WlkjlyUAxHacYNMAyR8dpR3ZzlRoBJbt3xW' post test1

# list container( everything works well)
swiftclient$ python shell.py -A http://10.4.**.**:9980/auth/1.0 -U dockeruser:swift -K 'oY894WlkjlyUAxHacYNMAyR8dpR3ZzlRoBJbt3xW' list
colin
my-new-bucket
registry
registry22
test1

but when i put object, i got error:


  File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

radosgw's log:


24736 2016-07-27 10:43:13.745637 7f7ffa7fc700  1 ====== starting new request req=
      0x7f7ffa7f68a0 =====
24737 2016-07-27 10:43:13.800791 7f7ffa7fc700  0 WARNING: set_req_state_err err_n
      o=95 resorting to 500
24738 2016-07-27 10:43:13.800851 7f7ffa7fc700  1 ====== req done req=0x7f7ffa7f68
      a0 op status=-95 http_status=500 ======
24739 2016-07-27 10:43:13.800879 7f7ffa7fc700  1 civetweb: 0x7f7fa00008c0: 10.6.2
      6.137 - - [27/Jul/2016:10:43:13 +0800] "PUT /swift/v1/registry22/colin_key
      HTTP/1.1" 500 0 - Python-urllib/3.4

put_object's scrips:

req = Request('http://10.4.**.**:9980/swift/v1/registry22/colin_key', 
            method = 'PUT')
timestr = datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')

req.add_header('Host', '10.4.**.**')
req.add_header('Date', timestr)
#req.add_header('x-amz-acl', 'public-read-write')
req.add_header('X-Auth-Token', key)

values = {'user':'colin', 'data': 'colin_value'}
data = urllib.parse.urlencode(values)
binary_data = data.encode('utf-8')

with urllib.request.urlopen(req, binary_data) as f:
    print(f.status)
    print(f.read().decode('utf-8'))

i use the python scripts to list container, it works well:

swiftclient$ ./list_containers.py 
200
colin
my-new-bucket
registry
registry22
test1

list_containers.py:

key = 'AUTH_rgwtk10000000646f636b6572757365723a73776966745eeb32c1f8ad71e4018f9857
4829d919ddbe49b3c2e5d3bc30ea38d48633cd8a492ba0ca'

req = Request('http://10.4.**.**:9980/swift/v1', 
            method = 'GET')
timestr = datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')

req.add_header('Host', '10.4.**.**')
req.add_header('Date', timestr)
#req.add_header('x-amz-acl', 'public-read-write')
req.add_header('X-Auth-Token', key)

with urllib.request.urlopen(req) as f:
    print(f.status)
    print(f.read().decode('utf-8'))

I don't know how to solve it, please help me;

thanks a lot;

Actions #1

Updated by Yehuda Sadeh over 7 years ago

It sounds like mixed osds and radosgw versions. Can you turn on 'debug ms = 1' on the radosgw, and see where that 95 error (ENOTSUPP) error is coming from? Also, make sure that the osds are running the same version as rgw.

Actions #2

Updated by Matt Benjamin over 7 years ago

  • Status changed from New to Need More Info
Actions #3

Updated by Yehuda Sadeh over 7 years ago

  • Status changed from Need More Info to Can't reproduce
Actions

Also available in: Atom PDF