Bug 872724 - Requesting package profile on consumer without a package profile results in error
Summary: Requesting package profile on consumer without a package profile results in e...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: consumers
Version: Master
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2.1.0
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: katello-v2-pulp 874243
TreeView+ depends on / blocked
 
Reported: 2012-11-02 20:15 UTC by Justin Sherrill
Modified: 2015-03-23 01:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 874243 (view as bug list)
Environment:
Last Closed: 2013-04-08 16:02:42 UTC
Embargoed:


Attachments (Terms of Use)

Description Justin Sherrill 2012-11-02 20:15:24 UTC
Description of problem:

Create a consumer
request a package profile  (GET /pulp/api/v2/consumers/ID/profiles/rpm/)

Gets an ISE (Exception below)



Version-Release number of selected component (if applicable):
pulp-server-0.0.335-1.fc16.noarch

How reproducible:
always



2012-11-02 16:07:09,034 2607:140552821511936: pulp.server.webservices.middleware.exception:ERROR: exception:63 Unhandled Exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/middleware/exception.py", line 44, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/middleware/postponed.py", line 39, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 278, in wsgi
    result = self.handle_with_processors()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 26, in _handle_with_processors
    return process(self.processors)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in process
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/web/application.py", line 557, in processor
    return handler()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in process
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/web/application.py", line 572, in processor
    result = handler()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 25, in process
    return self.handle()
  File "/usr/lib/python2.7/site-packages/web/application.py", line 232, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 413, in _delegate
    return f()
  File "/usr/lib/python2.7/site-packages/web/application.py", line 421, in <lambda>
    f = lambda: self._delegate_sub_application(pat, what)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 446, in _delegate_sub_application
    return app.handle_with_processors()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 26, in _handle_with_processors
    return process(self.processors)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in process
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/web/application.py", line 557, in processor
    return handler()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in process
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/web/application.py", line 572, in processor
    result = handler()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 23, in <lambda>
    return p(lambda : process(processors))
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 25, in process
    return self.handle()
  File "/usr/lib/python2.7/site-packages/web/application.py", line 232, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 395, in _delegate
    return handle_class(f)
  File "/usr/lib/python2.7/site-packages/web/application.py", line 386, in handle_class
    return tocall(*args)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 231, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/consumers.py", line 566, in GET
    serialized = serialization.consumer.profile(profile)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/serialization/consumer.py", line 27, in profile
    serialized = dict(profile)
TypeError: 'NoneType' object is not iterable

Comment 1 Justin Sherrill 2012-11-02 20:18:42 UTC
I think it would make sense to return an empty array or a 404 (if it was not created).  A 500 doesn't seem correct though.

Comment 2 Sayli Karmarkar 2013-01-17 04:06:00 UTC
This is already fixed in the current build. Moving to on_qa.

$ curl -u admin:admin -k https://localhost/pulp/api/v2/consumers/consumer2/profiles/rpm/

{"http_request_method": "GET", "exception": null, "error_message": "Missing resource(s): profile_id={'content_type': u'rpm', 'consumer_id': u'consumer2'}", "_href": "/pulp/api/v2/consumers/consumer2/profiles/rpm/", "http_status": 404, "traceback": null, "resources": {"profile_id": {"content_type": "rpm", "consumer_id": "consumer2"}}}

Comment 3 Jay Dobies 2013-01-17 13:57:06 UTC
There is no current build for 2.1.0 (i.e. a QE testing build). The build today was for the 2.0.7 release, which this isn't aligned to. I don't remember seeing a commit for this in the pulp-2.0 branch, nor should it be there. Are you sure this is ON_QA?

Comment 4 Justin Sherrill 2013-01-17 14:42:51 UTC
FYI i just tested this on pulp-server-2.0.6-1.noarch  and it seems to return a 404 and not a 500.  So i would consider this ON_QA.

Comment 5 Sayli Karmarkar 2013-01-17 16:51:51 UTC
(In reply to comment #3)
> There is no current build for 2.1.0 (i.e. a QE testing build). The build
> today was for the 2.0.7 release, which this isn't aligned to. I don't
> remember seeing a commit for this in the pulp-2.0 branch, nor should it be
> there. Are you sure this is ON_QA?

Ya, it was fixed quite a few days back as a part of other bugfix. I had forgotten to move it to modified at that time. I verified it yesterday with the latest build and moved it to on_qa.

Comment 6 Preethi Thomas 2013-01-17 18:39:32 UTC
verified
[root@pulp-v2-testing ~]# rpm -q pulp-server
pulp-server-2.0.7-0.4.beta.noarch
[root@pulp-v2-testing ~]# 


[root@pulp-v2-testing ~]# curl -u admin:admin -k https://localhost/pulp/api/v2/consumers/consumer2/profiles/rpm/
{"http_request_method": "GET", "exception": null, "error_message": "Missing resource(s): profile_id={'content_type': u'rpm', 'consumer_id': u'consumer2'}", "_href": "/pulp/api/v2/consumers/consumer2/profiles/rpm/", "http_status": 404, "traceback": null, "resources": {"profile_id": {"content_type": "rpm", "consumer_id": "consumer2"}}}[root@pulp-v2-testing ~]#

Comment 7 Preethi Thomas 2013-04-08 16:02:42 UTC
Pulp 2.1 released 


http://www.pulpproject.org/2013/04/05/pulp-2-1-0-released/


Note You need to log in before you can comment on or make changes to this bug.