Project

Profile

Help

Issue #3042

closed

Scheduled tasks break GET calls to /pulp/api/v2/tasks/

Added by Ichimonji10 about 7 years ago. Updated over 5 years ago.

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

Description

Let's say I install the pulp consumer on a host, bind it to an RPM repository, and schedule the installation of a package. If I wait for the task to start and start GETting /pulp/api/v2/tasks/, I'll get HTTP 500 responses. Looking at the system journal reveals entries like this:

Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: Unhandled Exception
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776) <TaskStatus: TaskStatus object> is not JSON serializable
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776) Traceback (most recent call last):
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     response = wrapped_callback(request, *callback_args, **callback_kwargs)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return self.dispatch(request, *args, **kwargs)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return handler(request, *args, **kwargs)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/views/decorators.py", line 241, in _auth_decorator
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/views/decorators.py", line 195, in _verify_auth
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     value = method(self, *args, **kwargs)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/views/tasks.py", line 75, in get
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return generate_json_response_with_pulp_encoder(serialized_task_statuses)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/views/util.py", line 52, in generate_json_response
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     json_obj = json.dumps(content, default=default)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib64/python2.7/json/__init__.py", line 250, in dumps
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     sort_keys=sort_keys, **kw).encode(obj)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     chunks = self.iterencode(o, _one_shot=True)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return _iterencode(o, 0)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/views/util.py", line 30, in pulp_json_encoder
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     return json_util.default(obj)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)   File "/usr/lib64/python2.7/site-packages/bson/json_util.py", line 257, in default
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776)     raise TypeError("%%r is not JSON serializable" %% obj)
Sep 26 14:13:35 rhel-7-pulp-2-14 pulp[14923]: pulp.server.webservices.middleware.exception:ERROR: (14923-99776) TypeError: <TaskStatus: TaskStatus object> is not JSON serializable

Beside being an issue in and of itself, this negatively impacts QE's ability to test pulp-consumer. For an example of an affected issue, see Pulp Smash #611.

Also available in: Atom PDF