Project

Profile

Help

Issue #823

closed

Using invalid limit query parameter during consumer history retrieval leads to 500

Added by ipanova@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/c1/history/?limit=not-int"
HTTP/1.1 500 Internal Server Error
Date: Mon, 30 Mar 2015 15:25:10 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 4618
Connection: close
Content-Type: application/json

{"http_request_method": "GET", "exception": ["ValueError: invalid literal for int() with base 10: 'not-int'\n"], "error_message": "invalid literal for int() with base 10: 'not-int'", "_href": "/pulp/api/v2/consumers/c1/history/", "http_status": 500, "traceback": [" File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/exception.py\", line 46, in call\n return self.app(environ, start_response)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/middleware/postponed.py\", line 55, in call\n return self.app(environ, start_response)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 279, in wsgi\n result = self.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 422, in _delegate\n return f()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 430, in <lambda>\n f = lambda: self._delegate_sub_application(pat, what)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 455, in _delegate_sub_application\n return app.handle_with_processors()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 18, in _handle_with_processors\n return process(self.processors)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n return handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in process\n return p(lambda: process(processors))\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n result = handler()\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 15, in <lambda>\n return p(lambda: process(processors))\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/application.py\", line 17, in process\n return self.handle()\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n return self._delegate(fn, self.fvars, args)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 405, in _delegate\n return handle_class(f)\n", " File \"/usr/lib/python2.7/site-packages/web/application.py\", line 396, in handle_class\n return tocall(*args)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 241, in _auth_decorator\n return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/decorators.py\", line 195, in _verify_auth\n value = method(self, *args, **kwargs)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/controllers/consumers.py\", line 410, in GET\n limit = int(limit[0])\n"]}[ipanova@ina pulp]$

expected:

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/c1/history/?limit=not-int"
HTTP/1.1 400 BAD REQUEST
Date: Mon, 30 Mar 2015 15:25:33 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 390
Connection: close
Content-Type: application/json

{"http_request_method": "GET", "exception": null, "error_message": "Invalid properties: ['limit']", "property_names": ["limit"], "_href": "/pulp/api/v2/consumers/c1/history/?limit=not-int", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["limit"], "properties": "['limit']"}, "description": "Invalid properties: ['limit']", "sub_errors": []}, "traceback": null}[ipanova@ina pulp]$

Actions #1

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from NEW to POST
  • Assignee set to ipanova@redhat.com
Actions #2

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from POST to MODIFIED
Actions #3

Updated by dkliban@redhat.com almost 9 years ago

  • Platform Release set to 2.7.0
Actions #4

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #5

Updated by igulina@redhat.com almost 9 years ago

  • Status changed from 5 to 6
>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el7.noarch

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/maruska/history/?limit=2" 

HTTP/1.1 200 OK
Date: Tue, 30 Jun 2015 04:38:24 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 552
Content-Type: application/json

[{"originator": "admin", "timestamp": "2015-06-30T04:28:28Z", "consumer_id": "maruska", "details": {"group_id": "maruska_banda"}, "_ns": "consumer_history", "_id": {"$oid": "55921aece512ed184258f2f7"}, "type": "added_to_group", "id": "55921aece512ed184258f2f7"}, {"originator": "SYSTEM", "timestamp": "2015-06-30T04:26:44Z", "consumer_id": "maruska", "details": {"repo_id": "zoo_repo", "distributor_id": "yum_distributor"}, "_ns": "consumer_history", "_id": {"$oid": "55921a84e512ed184258f2f3"}, "type": "repo_bound", "id": "55921a84e512ed184258f2f3"}]

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/maruska/history/?limit=bukashka" 
HTTP/1.1 400 BAD REQUEST
Date: Tue, 30 Jun 2015 04:39:02 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 396
Connection: close
Content-Type: application/json

{"http_request_method": "GET", "exception": null, "error_message": "Invalid properties: ['limit']", "property_names": ["limit"], "_href": "/pulp/api/v2/consumers/maruska/history/?limit=bukashka", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["limit"], "properties": "['limit']"}, "description": "Invalid properties: ['limit']", "sub_errors": []}, "traceback": null}
Actions #6

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #8

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Added by Mike DePaulo over 2 years ago

Revision fef930ab | View on GitHub

Fix building the collection failing on MacOS

due to an install command error.

fixes: #823

Added by Mike DePaulo over 2 years ago

Revision fef930ab | View on GitHub

Fix building the collection failing on MacOS

due to an install command error.

fixes: #823

Also available in: Atom PDF