Project

Profile

Help

Issue #821

closed

pulp-admin misses 404 response handling

Added by igulina@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

reproduced in 2 ways:

1) pulp 2.6.1 on f20, when host in admin.conf is trusted but with no pulp, e.g. host=en.wikipedia.org, run any pulp-admin command, get an error:
An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

less ~/.pulp/admin.log

2015-03-30 12:33:13,486 - 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 974, 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/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 330, in run
self.display_repositories(
*kwargs)
File "/usr/lib/python2.7/site-packages/pulp/client/commands/repo/cudl.py", line 358, in display_repositories
repo_list = self.get_repositories(query_params, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp_rpm/extensions/admin/repo_list.py", line 24, in get_repositories
all_repos = self._all_repos(query_params, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp_rpm/extensions/admin/repo_list.py", line 66, in _all_repos
self.all_repos_cache = self.context.server.repo.repositories(query_params).response_body
File "/usr/lib/python2.7/site-packages/pulp/bindings/repository.py", line 34, in repositories
return self.server.GET (path, query_parameters)
File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 92, in GET
return self._request('GET', path, queries)
File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 150, in _request
self._handle_exceptions(response_code, response_body)
File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 191, in _handle_exceptions
raise code_class_mappings[response_code](response_body)
File "/usr/lib/python2.7/site-packages/pulp/bindings/exceptions.py", line 16, in init
self.href = response_body.pop('_href', None)
AttributeError: 'str' object has no attribute 'pop'

less ./.pulp/server-calls.log:

2015-03-30 12:33:13,486 - INFO - GET request to /pulp/api/v2/repositories/ with parameters None
2015-03-30 12:33:13,486 - INFO - Response status : 404

2015-03-30 12:33:13,486 - INFO - Response body :
"<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n\t\t<title>Wikimedia page not found: https://en.wikipedia.org/pulp/api/v2/repositories/&lt;/title&gt;\n\t\t\t&lt;link rel=\"shortcut icon\" href=\"/favicon.ico\">\n\t\t\t<style type=\"text/css\">\n\t\t\t\t* {\n\t\t\t\t\tfont-family: 'Gill Sans MT', 'Gill Sans', sans-serif;\n\t\t\t\t}\n\t\t\t\ta:link, a:visited {\n\t\t\t\t\tcolor: #005b90;\n\t\t\t\t}\n\t\t\t\ta:hover, a:active {\n\t\t\t\t\tcolor: #900000;\n\t\t\t\t}\n\t\t\t\tbody {\n\t\t\t\t\tbackground-image: url('//upload.wikimedia.org/wikipedia/commons/9/96/Errorbg.png');\n\t\t\t\t\tbackground-repeat: repeat-x;\n\t\t\t\t\tbackground-color: white;\n\t\t\t\t\tcolor: #484848;\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t\t\th1 {\n\t\t\t\t\tcolor: black;\n\t\t\t\t\tmargin: 0px;\n\t\t\t\t}\n\t\t\t\th2 {\n\t\t\t\t\tcolor: #484848;\n\t\t\t\t\tpadding: 0px;\n\t\t\t\t\tmargin: 0px;\n\t\t\t\t}\n\t\t\t\tp {\n\t\t\t\t\tmargin-top: 10px;\n\t\t\t\t\tmargin-bottom: 0px;\n\t\t\t\t\tpadding-bottom: 0.5em;\n\t\t\t\t}\n\t\t\t\t#center {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 50%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 1px;\n\t\t\t\t\toverflow: visible;\n\t\t\t\t}\n\t\t\t\t#main {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tleft: 50%;\n\t\t\t\t\twidth: 720px;\n\t\t\t\t\tmargin-left: -360px;\n\t\t\t\t\theight: 340px;\n\t\t\t\t\ttop: -170px\n\t\t\t\t}\n\t\t\t\t#logo {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tfloat: left;\n\t\t\t\t\tbackground-image: url('//upload.wikimedia.org/wikipedia/commons/thumb/8/81/Wikimedia-logo.svg/300px-Wikimedia-logo.svg.png');\n\t\t\t\t\tbackground-position: top center;\n\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\theight: 340px;\n\t\t\t\t\twidth: 300px;\n\t\t\t\t}\n\t\t\t\t#divider {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tfloat: left;\n\t\t\t\t\tbackground-image: url('//upload.wikimedia.org/wikipedia/commons/9/97/Errorline.png');\n\t\t\t\t\tbackground-position: center center;\n\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\theight: 340px;\n\t\t\t\t\twidth: 1px;\n\t\t\t\t\tmargin-left: 10px;\n\t\t\t\t\tmargin-right: 10px;\n\t\t\t\t}\n\t\t\t\t#message {\n\t\t\t\t\tpadding-left: 10px;\n\t\t\t\t\tfloat: left;\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\theight: 340px;\n\t\t\t\t\twidth: 370px;\n\t\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div id=\"center\">\n\t\t\t<div id=\"main\">\n\t\t\t\t<div id=\"logo\"></div>\n\t\t\t\t<div id=\"divider\"></div>\n\t\t\t\t<div id=\"message\">\n\t\t\t\t\t<h1>Error</h1>\n\t\t\t\t\t<h2>404 \u2013 File not found</h2>\n\t\t\t\t\t<p style=\"font-style: italic;\">https://en.wikipedia.org/pulp/api/v2/repositories/&lt;/p&gt;\n\t\t\t\t\t&lt;p&gt;We could not find the above page on our servers.</p>\n\t\t\t\t\t<p><b>Did you mean to type <a href=https://en.wikipedia.org/wiki/pulp/api/v2/repositories/\>https://en.wikipedia.org/wiki/pulp/api/v2/repositories/&lt;/a&gt;?&lt;/b&gt;\n\t\t\t You will be automatically redirected there in five seconds.</p>\n\t\t\t\t\t<p>Alternatively, you can visit the <a href=\"/\">Main Page</a> or read <a href=\"//en.wikipedia.org/wiki/HTTP_404\" title=\"Wikipedia: HTTP 404\">more information</a> about this type of error.</p>\n\t\t\t\t\t<p style=\"font-size: smaller;\">A project of the <a href=\"//wikimediafoundation.org/wiki/Home\" title=\"WikimediaFoundation\">Wikimedia Foundation</a></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</body>\n</html>"

2) pulp 2.6.1 on rhel7, pulp-server was removed:

rpm -qa pulp*

pulp-rpm-handlers-2.6.1-0.2.beta.el7.noarch
pulp-rpm-consumer-extensions-2.6.1-0.2.beta.el7.noarch
pulp-rpm-admin-extensions-2.6.1-0.2.beta.el7.noarch
pulp-consumer-client-2.6.1-0.2.beta.el7.noarch
pulp-agent-2.6.1-0.2.beta.el7.noarch
pulp-selinux-2.6.1-0.2.beta.el7.noarch
pulp-rpm-yumplugins-2.6.1-0.2.beta.el7.noarch
pulp-puppet-consumer-extensions-2.6.1-0.2.beta.el7.noarch
pulp-puppet-admin-extensions-2.6.1-0.2.beta.el7.noarch
pulp-puppet-handlers-2.6.1-0.2.beta.el7.noarch
pulp-admin-client-2.6.1-0.2.beta.el7.noarch
pulp-docker-admin-extensions-1.0.0-1.el7.noarch

run any pulp-admin command:

pulp-admin login -u admin -p admin

An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

less ~/.pulp/admin.log

2015-03-30 07:57:54,422 - 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 974, 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/python2.7/site-packages/pulp/client/admin/admin_auth.py", line 58, in login
result = 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 98, 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 150, in _request
self._handle_exceptions(response_code, response_body)
File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 191, in _handle_exceptions
raise code_class_mappings[response_code](response_body)
File "/usr/lib/python2.7/site-packages/pulp/bindings/exceptions.py", line 16, in init
self.href = response_body.pop('_href', None)
AttributeError: 'str' object has no attribute 'pop'

less ~/.pulp/server_calls.log

2015-03-30 07:57:54,422 - INFO - Response body :
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /pulp/api/v2/actions/login/ was not found on this server.</p>\n</body></html>\n"

Actions #1

Updated by mhrivnak about 9 years ago

  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes
Actions #2

Updated by bmbouter about 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX
Actions #3

Updated by bmbouter about 5 years ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

Actions #4

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF