Hide Forgot
Sometime after the sprint 28 demo the content APIs stopped working. A 500 HTTP status is returned but there is no mention in the logs. I'll attach the PIC commands I ran. Notice how the /v2/content/rpm/ response body shows that the units are in /v2/content/rpm/units/, but that's what causes the 500. In [5]: pic.GET('/v2/content/') Out[5]: (200, [{u'content_type': u'exe', u'href': u'/pulp/api/v2/content/exe/'}, {u'content_type': u'rpm', u'href': u'/pulp/api/v2/content/rpm/'}, {u'content_type': u'puppet_manifest', u'href': u'/pulp/api/v2/content/puppet_manifest/'}, {u'content_type': u'puppet_template', u'href': u'/pulp/api/v2/content/puppet_template/'}, {u'content_type': u'puppet_module', u'href': u'/pulp/api/v2/content/puppet_module/'}]) In [6]: pic.GET('/v2/content/rpm/') Out[6]: (200, {u'_id': u'rpm', u'actions': {u'href': u'/pulp/api/v2/content/rpm/actions/'}, u'child_types': [], u'content_units': {u'href': u'/pulp/api/v2/content/rpm/units/'}, u'description': u'RPM', u'display_name': u'RPM', u'id': u'rpm', u'search_indexes': [[u'name', u'epoch', u'version', u'release', u'architecture']], u'unique_indexes': [[u'name', u'version']]}) In [7]: pic.GET('/v2/content/rpm/units/') --------------------------------------------------------------------------- RequestError Traceback (most recent call last) /pulp-gc-demo/scripts/<ipython console> in <module>() /pulp-gc-demo/scripts/pic.pyc in GET(path, **params) 93 def GET(path, **params): 94 path = '?'.join((path, _query_params(params))) ---> 95 return _request('GET', path) 96 97 /pulp-gc-demo/scripts/pic.pyc in _request(method, path, body) 80 if response.status > 299: 81 raise RequestError('Server response: %d\n%s' % ---> 82 (response.status, response_body)) 83 return (response.status, response_body) 84 RequestError: Server response: 500 internal server error
I need the server-side pulp log and or httpd ssl_error_log to see what's going on in this bug.
From the original comment: "A 500 HTTP status is returned but there is no mention in the logs." I assume you actually tested these APIs in the first place, can't you just use those tests?
My setup has bit-rotted over the course of this last sprint. If the 500 is returned by Apache, there should be an entry in the /var/log/httpd/ssl_error_log. If it's returned by Pulp, there should be an entry in /var/log/pulp/pulp.conf. Please double check. If there's nothing, I won't be able to move on the bug for a day or so.
[Mon Nov 07 15:20:50 2011] [error] [client ::1] Traceback (most recent call last): [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/usr/lib/python2.7/site-packages/web/application.py", line 241, in process [Mon Nov 07 15:20:50 2011] [error] [client ::1] return self.handle() [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/usr/lib/python2.7/site-packages/web/application.py", line 232, in handle [Mon Nov 07 15:20:50 2011] [error] [client ::1] return self._delegate(fn, self.fvars, args) [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/usr/lib/python2.7/site-packages/web/application.py", line 395, in _delegate [Mon Nov 07 15:20:50 2011] [error] [client ::1] return handle_class(f) [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/usr/lib/python2.7/site-packages/web/application.py", line 386, in handle_class [Mon Nov 07 15:20:50 2011] [error] [client ::1] return tocall(*args) [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/home/jdob/code/pulp/src/pulp/server/webservices/controllers/decorators.py", line 127, in _auth_decorator [Mon Nov 07 15:20:50 2011] [error] [client ::1] value = method(self, *args, **kwargs) [Mon Nov 07 15:20:50 2011] [error] [client ::1] File "/home/jdob/code/pulp/src/pulp/server/webservices/controllers/gc_contents.py", line 153, in GET [Mon Nov 07 15:20:50 2011] [error] [client ::1] resource.update(serialization.link.child_link_obj(unit['id'])) [Mon Nov 07 15:20:50 2011] [error] [client ::1] KeyError: 'id' [Mon Nov 07 15:20:50 2011] [error] [client ::1] From mongo (there are a bunch, I've snipped out most of them for brevity): > db.units_rpm.find() { "_id" : "b4b8544e-a70c-41d9-868b-a874efcecb62", "Group" : "Development/Languages", "name" : "ruby-gofer", "License" : "GPLv2", "URL" : "https://fedorahosted.org/gofer/", "_ns" : "units_rpm", "Signature" : "(none)", "filename" : "/pulp-gc-demo/rpms/ruby-gofer-0.38-1.git.0.6750e44.fc15.noarch.rpm", "version" : "0.38", "_content_type_id" : "rpm", "Release" : "1.git.0.6750e44.fc15", "Size" : "26197" }
changed child link generation to use _id instead of id.
Fixed in build 0.247.
fails_qa ipython In [7]: pulp.common.pic.GET('/v2/content/') Out[7]: (200, [{u'_href': u'/pulp/api/v2/content/drpm/', u'content_type': u'drpm'}, {u'_href': u'/pulp/api/v2/content/rpm/', u'content_type': u'rpm'}, {u'_href': u'/pulp/api/v2/content/erratum/', u'content_type': u'erratum'}, {u'_href': u'/pulp/api/v2/content/srpm/', u'content_type': u'srpm'}]) In [8]: pulp.common.pic.GET('/v2/content/rpm') --------------------------------------------------------------------------- RequestError Traceback (most recent call last) /root/<ipython console> in <module>() /usr/lib/python2.6/site-packages/pulp/common/pic.pyc in GET(path, **params) 107 def GET(path, **params): 108 path = '?'.join((path, _query_params(params))) --> 109 return _request('GET', path) 110 111 /usr/lib/python2.6/site-packages/pulp/common/pic.pyc in _request(method, path, body) 94 if response.status > 299: 95 raise RequestError('Server response: %d\n%s' % ---> 96 (response.status, response_body)) 97 return (response.status, response_body) 98 RequestError: Server response: 404 not found In [9]: pulp.common.pic.GET('/v2/content/rpm/units') --------------------------------------------------------------------------- RequestError Traceback (most recent call last) /root/<ipython console> in <module>() /usr/lib/python2.6/site-packages/pulp/common/pic.pyc in GET(path, **params) 107 def GET(path, **params): 108 path = '?'.join((path, _query_params(params))) --> 109 return _request('GET', path) 110 111 /usr/lib/python2.6/site-packages/pulp/common/pic.pyc in _request(method, path, body) 94 if response.status > 299: 95 raise RequestError('Server response: %d\n%s' % ---> 96 (response.status, response_body)) 97 return (response.status, response_body) 98 RequestError: Server response: 404 not found
[root@preethi-el6-pulp ~]# rpm -q pulp-common pulp-common-0.0.283-1.el6.noarch [root@preethi-el6-pulp ~]# rpm -q pulp pulp-0.0.283-1.el6.noarch In [5]: pulp.common.pic.connect() In [6]: pulp.common.pic.GET('/v2/content/') Out[6]: (200, [{u'_href': u'/pulp/api/v2/content/drpm/', u'content_type': u'drpm'}, {u'_href': u'/pulp/api/v2/content/rpm/', u'content_type': u'rpm'}, {u'_href': u'/pulp/api/v2/content/erratum/', u'content_type': u'erratum'}, {u'_href': u'/pulp/api/v2/content/srpm/', u'content_type': u'srpm'}]) In [7]: pulp.common.pic.GET('/v2/content/rpm/') Out[7]: (200, {u'_id': {u'$oid': u'4f8c1d5e196f454d60000001'}, u'actions': {u'_href': u'/pulp/api/v2/content/rpm/actions/'}, u'content_units': {u'_href': u'/pulp/api/v2/content/rpm/units/'}, u'description': u'RPM', u'display_name': u'RPM', u'id': u'rpm', u'referenced_types': [], u'search_indexes': [u'name', u'epoch', u'version', u'release', u'arch', u'filename', u'checksum', u'checksumtype'], u'unit_key': [u'name', u'epoch', u'version', u'release', u'arch', u'filename', u'checksumtype', u'checksum']}) In [8]:
Pulp v1.1 Release