s3cmd authorize failed with radosgw
HI,I want to use s3cmd to test my radosgw for ceph. So I use vstart.sh to start radosgw ,It automatically create a http server localhost:8000 with accesskey and secretkey. Then I try "s3cmd ls" but get a 403 failed. then I dig in find the authorize digest id different from calculated in ceph. However when I use libs3 (another s3 client), It works fine using the same accesskey and secretkey. my s3cfg file is like below ,could you help me to check Is there anything wrong?
access_key = 0555b35654ad1656d804 bucket_location = US cloudfront_host = cloudfront.amazonaws.com cloudfront_resource = /2010-07-15/distribution default_mime_type = binary/octet-stream delete_removed = False dry_run = False encoding = UTF-8 encrypt = False follow_symlinks = False force = False get_continue = False gpg_command = /usr/bin/gpg gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_passphrase = guess_mime_type = True host_base = localhost:8000 host_bucket = %(bucket)s.localhost human_readable_sizes = False list_md5 = False log_target_prefix = preserve_attrs = True progress_meter = True proxy_host = proxy_port = 0 recursive = False recv_chunk = 4096 reduced_redundancy = False secret_key = h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== send_chunk = 4096 simpledb_host = sdb.amazonaws.com skip_existing = False socket_timeout = 300 urlencoding_mode = normal use_https = False verbosity = WARNING
MY error log:
[root@localhost s3cmd]# ./s3cmd ls -c ~/.s3cfg --signature-v2 -d
DEBUG: ConfigParser: Reading file '/root/.s3cfg'
DEBUG: ConfigParser: access_key->05...17_chars...4
DEBUG: ConfigParser: bucket_location->US
DEBUG: ConfigParser: cloudfront_host->cloudfront.amazonaws.com
DEBUG: ConfigParser: cloudfront_resource->/2010-07-15/distribution
DEBUG: ConfigParser: default_mime_type->binary/octet-stream
DEBUG: ConfigParser: delete_removed->False
DEBUG: ConfigParser: dry_run->False
DEBUG: ConfigParser: encoding->UTF-8
DEBUG: ConfigParser: encrypt->False
DEBUG: ConfigParser: follow_symlinks->False
DEBUG: ConfigParser: force->False
DEBUG: ConfigParser: get_continue->False
DEBUG: ConfigParser: gpg_command->/usr/bin/gpg
DEBUG: ConfigParser: gpg_decrypt->%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
DEBUG: ConfigParser: gpg_encrypt->%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
DEBUG: ConfigParser: gpg_passphrase->...-3_chars...
DEBUG: ConfigParser: guess_mime_type->True
DEBUG: ConfigParser: host_base->localhost:8000
DEBUG: ConfigParser: host_bucket->%(bucket)s.localhost
DEBUG: ConfigParser: human_readable_sizes->False
DEBUG: ConfigParser: list_md5->False
DEBUG: ConfigParser: log_target_prefix->
DEBUG: ConfigParser: preserve_attrs->True
DEBUG: ConfigParser: progress_meter->True
DEBUG: ConfigParser: proxy_host->
DEBUG: ConfigParser: proxy_port->0
DEBUG: ConfigParser: recursive->False
DEBUG: ConfigParser: recv_chunk->4096
DEBUG: ConfigParser: reduced_redundancy->False
DEBUG: ConfigParser: secret_key->h7...54_chars...=
DEBUG: ConfigParser: send_chunk->4096
DEBUG: ConfigParser: simpledb_host->sdb.amazonaws.com
DEBUG: ConfigParser: skip_existing->False
DEBUG: ConfigParser: socket_timeout->300
DEBUG: ConfigParser: urlencoding_mode->normal
DEBUG: ConfigParser: use_https->False
DEBUG: ConfigParser: verbosity->WARNING
DEBUG: Updating Config.Config cache_file ->
DEBUG: Updating Config.Config follow_symlinks -> False
DEBUG: Updating Config.Config signature_v2 -> True
DEBUG: Updating Config.Config verbosity -> 10
DEBUG: Unicodising 'ls' using UTF-8
DEBUG: Command: ls
DEBUG: CreateRequest: resource[uri]=/
DEBUG: Using signature v2
DEBUG: SignHeaders: 'GET\n\n\n\nx-amz-date:Fri, 18 Sep 2015 10:52:10 +0000\n/'
DEBUG: Processing request, please wait...
DEBUG: get_hostname(None): localhost:8000
DEBUG: ConnMan.get(): creating new connection: http://localhost:8000
DEBUG: non-proxied HTTPConnection(localhost:8000)
DEBUG: format_uri(): /
DEBUG: Sending request method_string='GET', uri='/', headers={'Authorization': 'AWS 0555b35654ad1656d804:/wXRw4j/4dA/PtRtZ1wptANg/p0=', 'x-amz-date': 'Fri, 18 Sep 2015 10:52:10 +0000'}, body=(0 bytes)
DEBUG: Response: {'status': 403, 'headers': {'content-length': '78', 'content-type': 'application/xml', 'accept-ranges': 'bytes'}, 'reason': 'Forbidden', 'data': 'AccessDenied
Does radosgw log give any indication of why it's failing? Which version of s3cmd are you using please?
Thanks, Matt
On Fri, Sep 18, 2015 at 5:53 AM, chenji-kael [email protected] wrote:
HI,I want to use s3cmd to test my radosgw for ceph. So I use vstart.sh to start radosgw ,It automatically create a http server localhost:8000 with accesskey and secretkey. Then I try "s3cmd ls" but get a 403 failed. then I dig in find the authorize digest id different from calculated in ceph. However when I use libs3 (another s3 client), It works fine using the same accesskey and secretkey. my s3cfg file is like below ,could you help me to check Is there anything wrong?
access_key = 0555b35654ad1656d804 bucket_location = US cloudfront_host = cloudfront.amazonaws.com cloudfront_resource = /2010-07-15/distribution default_mime_type = binary/octet-stream delete_removed = False dry_run = False encoding = UTF-8 encrypt = False follow_symlinks = False force = False get_continue = False gpg_command = /usr/bin/gpg gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s gpg_passphrase = guess_mime_type = True host_base = localhost:8000 host_bucket = %(bucket)s.localhost human_readable_sizes = False list_md5 = False log_target_prefix = preserve_attrs = True progress_meter = True proxy_host = proxy_port = 0 recursive = False recv_chunk = 4096 reduced_redundancy = False secret_key = h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== send_chunk = 4096 simpledb_host = sdb.amazonaws.com skip_existing = False socket_timeout = 300 urlencoding_mode = normal use_https = False verbosity = WARNING
MY error log: [root@localhost s3cmd]# ./s3cmd ls -c ~/.s3cfg --signature-v2 -d DEBUG: ConfigParser: Reading file '/root/.s3cfg' DEBUG: ConfigParser: access_key->05...17_chars...4 DEBUG: ConfigParser: bucket_location->US DEBUG: ConfigParser: cloudfront_host->cloudfront.amazonaws.com DEBUG: ConfigParser: cloudfront_resource->/2010-07-15/distribution DEBUG: ConfigParser: default_mime_type->binary/octet-stream DEBUG: ConfigParser: delete_removed->False DEBUG: ConfigParser: dry_run->False DEBUG: ConfigParser: encoding->UTF-8 DEBUG: ConfigParser: encrypt->False DEBUG: ConfigParser: follow_symlinks->False DEBUG: ConfigParser: force->False DEBUG: ConfigParser: get_continue->False DEBUG: ConfigParser: gpg_command->/usr/bin/gpg DEBUG: ConfigParser: gpg_decrypt->%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s DEBUG: ConfigParser: gpg_encrypt->%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s DEBUG: ConfigParser: gpg_passphrase->...-3_chars... DEBUG: ConfigParser: guess_mime_type->True DEBUG: ConfigParser: host_base->localhost:8000 DEBUG: ConfigParser: host_bucket->%(bucket)s.localhost DEBUG: ConfigParser: human_readable_sizes->False DEBUG: ConfigParser: list_md5->False DEBUG: ConfigParser: log_target_prefix-> DEBUG: ConfigParser: preserve_attrs->True DEBUG: ConfigParser: progress_meter->True DEBUG: ConfigParser: proxy_host-> DEBUG: ConfigParser: proxy_port->0 DEBUG: ConfigParser: recursive->False DEBUG: ConfigParser: recv_chunk->4096 DEBUG: ConfigParser: reduced_redundancy->False DEBUG: ConfigParser: secret_key->h7...54_chars...= DEBUG: ConfigParser: send_chunk->4096 DEBUG: ConfigParser: simpledb_host->sdb.amazonaws.com DEBUG: ConfigParser: skip_existing->False DEBUG: ConfigParser: socket_timeout->300 DEBUG: ConfigParser: urlencoding_mode->normal DEBUG: ConfigParser: use_https->False DEBUG: ConfigParser: verbosity->WARNING DEBUG: Updating Config.Config cache_file -> DEBUG: Updating Config.Config follow_symlinks -> False DEBUG: Updating Config.Config signature_v2 -> True DEBUG: Updating Config.Config verbosity -> 10 DEBUG: Unicodising 'ls' using UTF-8 DEBUG: Command: ls DEBUG: CreateRequest: resource[uri]=/ DEBUG: Using signature v2 DEBUG: SignHeaders: 'GET\n\n\n\nx-amz-date:Fri, 18 Sep 2015 10:52:10 +0000\n/' DEBUG: Processing request, please wait... DEBUG: get_hostname(None): localhost:8000 DEBUG: ConnMan.get(): creating new connection: http://localhost:8000 DEBUG: non-proxied HTTPConnection(localhost:8000) DEBUG: format_uri(): / DEBUG: Sending request method_string='GET', uri='/', headers={'Authorization': 'AWS 0555b35654ad1656d804:/wXRw4j/4dA/PtRtZ1wptANg/p0=', 'x-amz-date': 'Fri, 18 Sep 2015 10:52:10 +0000'}, body=(0 bytes) DEBUG: Response: {'status': 403, 'headers': {'content-length': '78', 'content-type': 'application/xml', 'accept-ranges': 'bytes'}, 'reason': 'Forbidden', 'data': 'AccessDenied'} DEBUG: ConnMan.put(): connection put back to pool (http://localhost:8000#1 )
— Reply to this email directly or view it on GitHub https://github.com/s3tools/s3cmd/issues/631.
Hi ,I find where the iss is , the secret key include the special character '/' ,after I delete it from the secret key, it goes right
So, nothing to fix.