Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 885134 - Parse error when apache error comes back from a call
Summary: Parse error when apache error comes back from a call
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: 2.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 42
Assignee: Jay Dobies
QA Contact: pulp-qe-list
URL:
Whiteboard:
: 882317 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-07 15:04 UTC by Jay Dobies
Modified: 2013-09-09 15:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-07 14:09:28 UTC


Attachments (Terms of Use)

Description Jay Dobies 2012-12-07 15:04:16 UTC
The binding code handles the Pulp error format and parses it into an object the client can use. This is great, except when the exception didn't come from Pulp. That should be rare, however it commonly occurs if the server failed to start (which in itself commonly occurs if the user didn't run pulp-manage-db).

I kept glossing over this traceback telling people it meant Apache didn't start, but at the end of the day it's pretty ugly that we're not parsing the result. So this bug is to handle situations where the exception didn't come from Pulp.


2012-12-07 10:49:40,249 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 921, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/pulp/admin/extensions/pulp_admin_auth/pulp_cli.py", line 57, in login
    certificate = self.context.server.actions.login(username, password).response_body
  File "/usr/lib/python2.7/site-packages/pulp/bindings/actions.py", line 32, in login
    return self.server.POST(path)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 90, in POST
    return self._request('POST', path, body=body, ensure_encoding=ensure_encoding)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 142, in _request
    self._handle_exceptions(response_code, response_body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 173, in _handle_exceptions
    raise exceptions.PulpServerException(response_body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/exceptions.py", line 28, in __init__
    self.href = response_body.pop('_href', None)
AttributeError: 'str' object has no attribute 'pop'

Comment 1 Jay Dobies 2012-12-07 16:06:41 UTC
Pulp Git Repository: 28e3f29c26c8b885868489832057a49fa6ad25fa

To verify, drop your database and restart apache. That should cause it to fail to start and any CLI commands against it will show the new error.

Alternatively, move the files in /usr/lib/pulp/plugins/types to /tmp and bounce the server. Again, the server will fail to start because the plugins can't load.

Comment 2 Jeff Ortel 2012-12-07 20:04:24 UTC
2.0.6-0.13.beta

Comment 3 Preethi Thomas 2012-12-07 20:55:51 UTC
verified

[root@preethi ~]# rpm -q pulp-server
pulp-server-2.0.6-0.13.beta.noarch
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# mongo
MongoDB shell version: 2.0.2
connecting to: test
> use pulp_database
switched to db pulp_database
> db.dropDatabase()
{ "dropped" : "pulp_database", "ok" : 1 }
> exit
bye
[root@preethi ~]# service httpd restart
Redirecting to /bin/systemctl  restart httpd.service
[root@preethi ~]# pulp-admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Authentication Failed

The session certificate expired on Dec  7 14:11:59 2012 GMT. Use the login
command to begin a new session.

[root@preethi ~]# pulp-admin -u admin -p admin repo list
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

The web server reported an error trying to access the Pulp application. The
likely cause is that the pulp-manage-db script has not been run prior to
starting the server. More information can be found in Apache's error log file on
the server itself.

[root@preethi ~]#

Comment 4 Jay Dobies 2012-12-07 21:52:23 UTC
*** Bug 882317 has been marked as a duplicate of this bug. ***

Comment 5 Preethi Thomas 2013-01-07 14:09:28 UTC
Pulp 2.0 released.


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