Project

Profile

Help

Issue #321

closed

Traceback is raised if during consumer profile creation required keys are not specified

Added by ipanova@redhat.com about 9 years ago. Updated almost 4 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 POST -k -u admin:admin -d '{}' "https://localhost/pulp/api/v2/consumers/c1/profiles/"
HTTP/1.1 500 Internal Server Error
Date: Thu, 26 Feb 2015 11:32:07 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: 4857
Connection: close
Content-Type: application/json

{"http_request_method": "POST", "exception": ["TypeError: sequence item 1: expected string or Unicode, NoneType found\n"], "error_message": "sequence item 1: expected string or Unicode, NoneType found", "_href": "/pulp/api/v2/consumers/c1/profiles/", "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 475, in POST\n link = serialization.link.child_link_obj(consumer_id, content_type)\n", " File \"/home/ipanova/pulp_development/pulp/server/pulp/server/webservices/serialization/link.py\", line 69, in child_link_obj\n suffix = '/'.join(path_elements)\n"]}

I expect 400 with missing required keys


Related issues

Has duplicate Pulp - Issue #464: Unhandled Exception is raised if during creation of consumer profile required key is missedCLOSED - DUPLICATEActions
Actions #1

Updated by ipanova@redhat.com about 9 years ago

Same with profile update

Actions #2

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com
Actions #3

Updated by bmbouter about 9 years ago

  • Triaged changed from No to Yes
  • Severity set to Medium
Actions #4

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from ASSIGNED to POST
Actions #5

Updated by bmbouter about 9 years ago

  • Has duplicate Issue #464: Unhandled Exception is raised if during creation of consumer profile required key is missed added
Actions #6

Updated by bmbouter about 9 years ago

  • Severity changed from Medium to 2. Medium
Actions #7

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by dkliban@redhat.com almost 9 years ago

  • Platform Release set to 2.7.0
Actions #9

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #10

Updated by igulina@redhat.com almost 9 years ago

  • Status changed from 5 to 6

Verified. Checked on f20 and rhel6 on pulp 2.7.0

Profile creation:

>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.fc20.noarch

curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{}' "https://localhost/pulp/api/v2/consumers/cheburashka/profiles/" 
HTTP/1.1 400 BAD REQUEST
Date: Thu, 18 Jun 2015 08:50:55 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: 405
Connection: close
Content-Type: application/json

{"http_request_method": "POST", "exception": null, "error_message": "Missing values for: ['profile']", "_href": "/pulp/api/v2/consumers/cheburashka/profiles/", "http_status": 400, "error": {"code": "PLP0016", "data": {"property_names": ["profile"], "properties": "['profile']"}, "description": "Missing values for: ['profile']", "sub_errors": []}, "missing_property_names": ["profile"], "traceback": null}

Profile update:

curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X PUT -k -u admin:admin -d '{}' "https://localhost/pulp/api/v2/consumers/cheburashka/profiles/rpm/" 
HTTP/1.1 400 BAD REQUEST
Date: Thu, 18 Jun 2015 09:01:57 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: 408
Connection: close
Content-Type: application/json

{"http_request_method": "PUT", "exception": null, "error_message": "Missing values for: ['profile']", "_href": "/pulp/api/v2/consumers/cheburashka/profiles/rpm/", "http_status": 400, "error": {"code": "PLP0016", "data": {"property_names": ["profile"], "properties": "['profile']"}, "description": "Missing values for: ['profile']", "sub_errors": []}, "missing_property_names": ["profile"], "traceback": null}
Actions #11

Updated by amacdona@redhat.com over 8 years ago

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

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added
Actions #14

Updated by bmbouter almost 4 years ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF