This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 872724 - Requesting package profile on consumer without a package profile results in error
Requesting package profile on consumer without a package profile results in e...
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: consumers (Show other bugs)
Master
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 2.1.0
Assigned To: Sayli Karmarkar
Preethi Thomas
: Triaged
Depends On:
Blocks: katello-v2-pulp 874243
  Show dependency treegraph
 
Reported: 2012-11-02 16:15 EDT by Justin Sherrill
Modified: 2015-03-22 21:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 874243 (view as bug list)
Environment:
Last Closed: 2013-04-08 12:02:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Justin Sherrill 2012-11-02 16:15:24 EDT
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 16:18:42 EDT
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-16 23:06:00 EST
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 08:57:06 EST
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 09:42:51 EST
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 11:51:51 EST
(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 13:39:32 EST
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 12:02:42 EDT
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.