Project

General

Profile

Actions

Bug #13644

closed

get_quota_info returns json in headers

Added by Derek Yarnell over 8 years ago. Updated about 8 years ago.

Status:
Resolved
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

A call for /admin/user?quota&uid=testuser&quota-type=user which looks to come from get_quota_info0 returns its information in the Content-type header and not in the body of the message as is specified in the documentation1.

[0] - https://github.com/ceph/ceph/blob/83e10f7e2df0a71bd59e6ef2aa06b52b186fddaa/src/rgw/rgw_rest_user.cc#L697
[1] - http://docs.ceph.com/docs/master/radosgw/adminops/#quotas

INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS
connection (1): ceph.umiacs.umd.edu
DEBUG:requests.packages.urllib3.connectionpool:"GET
/admin/user?quota&format=json&uid=foo1209&quota-type=user HTTP/1.1" 200 0
INFO:rgwadmin.rgw:[('date', 'Thu, 29 Oct 2015 18:28:45 GMT'),
('{"enabled"', 'true,"max_size_kb":12345,"max_objects":-1}Content-type:
application/json'), ('content-length', '0'), ('server', 'Apache/2.4.6
(Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5')]
2015-10-28 23:02:46.445367 7f444cff1700  1 civetweb: 0x7f445c026d00: 127.0.0.1 - - [28/Oct/2015:23:02:46 -0400] "GET /admin/user HTTP/1.1" -1 0 - python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:02.063755 7f447ace2700  2 RGWDataChangesLog::ChangesRenewThread: start
2015-10-28 23:03:17.139339 7f443cfd1700 20 RGWEnv::set(): HTTP_HOST: localhost:7480
2015-10-28 23:03:17.139357 7f443cfd1700 20 RGWEnv::set(): HTTP_ACCEPT_ENCODING: gzip, deflate
2015-10-28 23:03:17.139358 7f443cfd1700 20 RGWEnv::set(): HTTP_ACCEPT: */*
2015-10-28 23:03:17.139364 7f443cfd1700 20 RGWEnv::set(): HTTP_USER_AGENT: python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:17.139375 7f443cfd1700 20 RGWEnv::set(): HTTP_DATE: Thu, 29 Oct 2015 03:03:17 GMT
2015-10-28 23:03:17.139377 7f443cfd1700 20 RGWEnv::set(): HTTP_AUTHORIZATION: AWS RTJ1TL13CH613JRU2PJD:ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139381 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_FOR: 128.8.132.4
2015-10-28 23:03:17.139383 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_HOST: ceph.umiacs.umd.edu
2015-10-28 23:03:17.139385 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_SERVER: cephproxy00.umiacs.umd.edu
2015-10-28 23:03:17.139387 7f443cfd1700 20 RGWEnv::set(): HTTP_CONNECTION: Keep-Alive
2015-10-28 23:03:17.139392 7f443cfd1700 20 RGWEnv::set(): REQUEST_METHOD: GET
2015-10-28 23:03:17.139394 7f443cfd1700 20 RGWEnv::set(): REQUEST_URI: /admin/user
2015-10-28 23:03:17.139397 7f443cfd1700 20 RGWEnv::set(): QUERY_STRING: quota&uid=derek&quota-type=user
2015-10-28 23:03:17.139401 7f443cfd1700 20 RGWEnv::set(): REMOTE_USER:
2015-10-28 23:03:17.139403 7f443cfd1700 20 RGWEnv::set(): SCRIPT_URI: /admin/user
2015-10-28 23:03:17.139408 7f443cfd1700 20 RGWEnv::set(): SERVER_PORT: 7480
2015-10-28 23:03:17.139409 7f443cfd1700 20 HTTP_ACCEPT=*/*
2015-10-28 23:03:17.139410 7f443cfd1700 20 HTTP_ACCEPT_ENCODING=gzip, deflate
2015-10-28 23:03:17.139411 7f443cfd1700 20 HTTP_AUTHORIZATION=AWS RTJ1TL13CH613JRU2PJD:ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139412 7f443cfd1700 20 HTTP_CONNECTION=Keep-Alive
2015-10-28 23:03:17.139412 7f443cfd1700 20 HTTP_DATE=Thu, 29 Oct 2015 03:03:17 GMT
2015-10-28 23:03:17.139413 7f443cfd1700 20 HTTP_HOST=localhost:7480
2015-10-28 23:03:17.139413 7f443cfd1700 20 HTTP_USER_AGENT=python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:17.139414 7f443cfd1700 20 HTTP_X_FORWARDED_FOR=128.8.132.4
2015-10-28 23:03:17.139415 7f443cfd1700 20 HTTP_X_FORWARDED_HOST=ceph.umiacs.umd.edu
2015-10-28 23:03:17.139416 7f443cfd1700 20 HTTP_X_FORWARDED_SERVER=cephproxy00.umiacs.umd.edu
2015-10-28 23:03:17.139416 7f443cfd1700 20 QUERY_STRING=quota&uid=derek&quota-type=user
2015-10-28 23:03:17.139417 7f443cfd1700 20 REMOTE_USER=
2015-10-28 23:03:17.139417 7f443cfd1700 20 REQUEST_METHOD=GET
2015-10-28 23:03:17.139418 7f443cfd1700 20 REQUEST_URI=/admin/user
2015-10-28 23:03:17.139419 7f443cfd1700 20 SCRIPT_URI=/admin/user
2015-10-28 23:03:17.139419 7f443cfd1700 20 SERVER_PORT=7480
2015-10-28 23:03:17.139422 7f443cfd1700 20 RGWEnv::set(): HTTP_HOST: localhost:7480
2015-10-28 23:03:17.139423 7f443cfd1700 20 RGWEnv::set(): HTTP_ACCEPT_ENCODING: gzip, deflate
2015-10-28 23:03:17.139424 7f443cfd1700 20 RGWEnv::set(): HTTP_ACCEPT: */*
2015-10-28 23:03:17.139425 7f443cfd1700 20 RGWEnv::set(): HTTP_USER_AGENT: python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:17.139426 7f443cfd1700 20 RGWEnv::set(): HTTP_DATE: Thu, 29 Oct 2015 03:03:17 GMT
2015-10-28 23:03:17.139428 7f443cfd1700 20 RGWEnv::set(): HTTP_AUTHORIZATION: AWS RTJ1TL13CH613JRU2PJD:ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139429 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_FOR: 128.8.132.4
2015-10-28 23:03:17.139430 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_HOST: ceph.umiacs.umd.edu
2015-10-28 23:03:17.139431 7f443cfd1700 20 RGWEnv::set(): HTTP_X_FORWARDED_SERVER: cephproxy00.umiacs.umd.edu
2015-10-28 23:03:17.139432 7f443cfd1700 20 RGWEnv::set(): HTTP_CONNECTION: Keep-Alive
2015-10-28 23:03:17.139433 7f443cfd1700 20 RGWEnv::set(): REQUEST_METHOD: GET
2015-10-28 23:03:17.139434 7f443cfd1700 20 RGWEnv::set(): REQUEST_URI: /admin/user
2015-10-28 23:03:17.139435 7f443cfd1700 20 RGWEnv::set(): QUERY_STRING: quota&uid=derek&quota-type=user
2015-10-28 23:03:17.139436 7f443cfd1700 20 RGWEnv::set(): REMOTE_USER:
2015-10-28 23:03:17.139437 7f443cfd1700 20 RGWEnv::set(): SCRIPT_URI: /admin/user
2015-10-28 23:03:17.139438 7f443cfd1700 20 RGWEnv::set(): SERVER_PORT: 7480
2015-10-28 23:03:17.139439 7f443cfd1700 20 HTTP_ACCEPT=*/*
2015-10-28 23:03:17.139439 7f443cfd1700 20 HTTP_ACCEPT_ENCODING=gzip, deflate
2015-10-28 23:03:17.139440 7f443cfd1700 20 HTTP_AUTHORIZATION=AWS RTJ1TL13CH613JRU2PJD:ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139441 7f443cfd1700 20 HTTP_CONNECTION=Keep-Alive
2015-10-28 23:03:17.139441 7f443cfd1700 20 HTTP_DATE=Thu, 29 Oct 2015 03:03:17 GMT
2015-10-28 23:03:17.139442 7f443cfd1700 20 HTTP_HOST=localhost:7480
2015-10-28 23:03:17.139443 7f443cfd1700 20 HTTP_USER_AGENT=python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:17.139444 7f443cfd1700 20 HTTP_X_FORWARDED_FOR=128.8.132.4
2015-10-28 23:03:17.139444 7f443cfd1700 20 HTTP_X_FORWARDED_HOST=ceph.umiacs.umd.edu
2015-10-28 23:03:17.139445 7f443cfd1700 20 HTTP_X_FORWARDED_SERVER=cephproxy00.umiacs.umd.edu
2015-10-28 23:03:17.139446 7f443cfd1700 20 QUERY_STRING=quota&uid=derek&quota-type=user
2015-10-28 23:03:17.139446 7f443cfd1700 20 REMOTE_USER=
2015-10-28 23:03:17.139447 7f443cfd1700 20 REQUEST_METHOD=GET
2015-10-28 23:03:17.139447 7f443cfd1700 20 REQUEST_URI=/admin/user
2015-10-28 23:03:17.139448 7f443cfd1700 20 SCRIPT_URI=/admin/user
2015-10-28 23:03:17.139449 7f443cfd1700 20 SERVER_PORT=7480
2015-10-28 23:03:17.139450 7f443cfd1700  1 ====== starting new request req=0x7f4468047d00 =====
2015-10-28 23:03:17.139462 7f443cfd1700  2 req 0:0.000013::GET /admin/user::initializing
2015-10-28 23:03:17.139466 7f443cfd1700 10 host=localhost:7480 rgw_dns_name=ceph.umiacs.umd.edu
2015-10-28 23:03:17.139495 7f443cfd1700  2 req 0:0.000045::GET /admin/user::getting op
2015-10-28 23:03:17.139498 7f443cfd1700  2 req 0:0.000049::GET /admin/user:get_quota_info:authorizing
2015-10-28 23:03:17.139532 7f443cfd1700 10 get_canon_resource(): dest=/admin/user
2015-10-28 23:03:17.139533 7f443cfd1700 10 auth_hdr:
GET

Thu, 29 Oct 2015 03:03:17 GMT
/admin/user
2015-10-28 23:03:17.139597 7f443cfd1700 15 calculated digest=ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139599 7f443cfd1700 15 auth_sign=ZtDQkxc+Nqo04zVsNND0yx32lds=
2015-10-28 23:03:17.139599 7f443cfd1700 15 compare=0
2015-10-28 23:03:17.139602 7f443cfd1700  2 req 0:0.000153::GET /admin/user:get_quota_info:reading permissions
2015-10-28 23:03:17.139604 7f443cfd1700  2 req 0:0.000155::GET /admin/user:get_quota_info:init op
2015-10-28 23:03:17.139606 7f443cfd1700  2 req 0:0.000157::GET /admin/user:get_quota_info:verifying op mask
2015-10-28 23:03:17.139608 7f443cfd1700 20 required_mask= 0 user.op_mask=7
2015-10-28 23:03:17.139609 7f443cfd1700  2 req 0:0.000160::GET /admin/user:get_quota_info:verifying op permissions
2015-10-28 23:03:17.139611 7f443cfd1700  2 req 0:0.000162::GET /admin/user:get_quota_info:verifying op params
2015-10-28 23:03:17.139612 7f443cfd1700  2 req 0:0.000163::GET /admin/user:get_quota_info:executing
2015-10-28 23:03:17.139637 7f443cfd1700 20 get_obj_state: rctx=0x7f446805dd90 obj=.users.uid:derek state=0x7f446803c5c8 s->prefetch_data=0
2015-10-28 23:03:17.139644 7f443cfd1700 10 cache get: name=.users.uid+derek : hit
2015-10-28 23:03:17.139649 7f443cfd1700 20 get_obj_state: s->obj_tag was set empty
2015-10-28 23:03:17.139653 7f443cfd1700 10 cache get: name=.users.uid+derek : hit
2015-10-28 23:03:17.139726 7f443cfd1700  2 req 0:0.000277::GET /admin/user:get_quota_info:http status=200
2015-10-28 23:03:17.139743 7f443cfd1700  1 ====== req done req=0x7f4468047d00 http_status=200 ======
2015-10-28 23:03:17.139805 7f443cfd1700  1 civetweb: 0x7f4468023310: 127.0.0.1 - - [28/Oct/2015:23:03:17 -0400] "GET /admin/user HTTP/1.1" -1 0 - python-requests/2.7.0 CPython/2.7.5 Linux/3.10.0-229.14.1.el7.x86_64
2015-10-28 23:03:24.063871 7f447ace2700  2 RGWDataChangesLog::ChangesRenewThread: start
Actions #1

Updated by Yehuda Sadeh over 8 years ago

  • Assignee set to Yehuda Sadeh
  • Priority changed from Normal to High
Actions #2

Updated by Victor Denisov about 8 years ago

Presumably fix for this issue is in commit: 64fceed2202c94edf28b8315fe14c9affa8c0116

diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc
index cfc274b..3f0e7d9 100644
--- a/src/rgw/rgw_rest_user.cc
+++ b/src/rgw/rgw_rest_user.cc
@ -692,6 +692,7 @ void RGWOp_Quota_Info::execute()
if (http_ret < 0)
return;

+ flusher.start(0);
if (show_all) {
UserQuotas quotas(info);
encode_json("quota", quotas, s->formatter);

Actions #3

Updated by Yehuda Sadeh about 8 years ago

This fix is in hammer since 0.94.3. Do you still have an issue there?

Actions #4

Updated by Yehuda Sadeh about 8 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF