Project

Profile

Help

Issue #4945

closed

Error thrown when fetching a task that created a distribution if CONTENT_HOST is not defined

Added by jsherril@redhat.com over 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
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:
Sprint:
Sprint 56
Quarter:

Description

The settings.py template (https://github.com/pulp/ansible-pulp/blob/master/roles/pulp/templates/settings.py.j2#L5-L7) in the installer makes it seem like CONTENT_HOST is optional, but if a user creates a distribution and polls the tasks, they will only get an ISE 500:

pulp: django.request:ERROR: Internal Server Error: /pulp/api/v3/tasks/15f3f04d-b917-4727-b964-024c81e454ab/
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/viewsets.py", line 116, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 495, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 455, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/views.py", line 492, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/mixins.py", line 58, in retrieve
return Response(serializer.data)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 563, in data
ret = super(Serializer, self).data
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 262, in data
self._data = self.to_representation(self.instance)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 530, in to_representation
ret[field.field_name] = field.to_representation(attribute)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/relations.py", line 542, in to_representation
for value in iterable
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/relations.py", line 542, in <listcomp>
for value in iterable
File "/usr/local/lib/pulp/src/pulpcore/pulpcore/app/serializers/task.py", line 25, in to_representation
return serializer.data.get('_href')
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 563, in data
ret = super(Serializer, self).data
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 262, in data
self._data = self.to_representation(self.instance)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rest_framework/serializers.py", line 530, in to_representation
ret[field.field_name] = field.to_representation(attribute)
File "/usr/local/lib/pulp/src/pulpcore/pulpcore/app/serializers/fields.py", line 248, in to_representation
host.strip('/'),
AttributeError: 'NoneType' object has no attribute 'strip'
127.0.0.1 - admin [03/Jun/2019:13:59:01 +0000] "GET /pulp/api/v3/tasks/15f3f04d-b917-4727-b964-024c81e454ab/ HTTP/1.1" 500 27 "-" "OpenAPI-Generator/3.0.0rc2
pulp: django.request:ERROR: Internal Server Error: /pulp/api/v3/tasks/15f3f04d-b917-4727-b964-024c81e454ab/
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)

Related issues

Related to Pulp - Issue #4946: pulp_content_host default value is set in the wrong ansible roleCLOSED - CURRENTRELEASEbmbouterActions
Actions #1

Updated by jsherril@redhat.com over 5 years ago

  • Subject changed from Exception thrown during task execution results in task object that cannot be retrieved to Error thrown when fetching a task that created a distribution if CONTENT_HOST is not defined
Actions #2

Updated by jsherril@redhat.com over 5 years ago

  • Description updated (diff)
Actions #3

Updated by jsherril@redhat.com over 5 years ago

  • Related to Issue #4946: pulp_content_host default value is set in the wrong ansible role added
Actions #4

Updated by jsherril@redhat.com over 5 years ago

Note this is releated to https://pulp.plan.io/issues/4946, but ideally this would be handled better, either some nicer error or the status api returning some bad status.

Actions #5

Updated by amacdona@redhat.com over 5 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 54
Actions #6

Updated by ttereshc over 5 years ago

  • Sprint changed from Sprint 54 to Sprint 55
Actions #7

Updated by dkliban@redhat.com over 5 years ago

  • Sprint changed from Sprint 55 to Sprint 56
Actions #8

Updated by bmbouter over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter

Added by bmbouter over 5 years ago

Revision 295e55f2 | View on GitHub

Adjust CONTENT_HOST setting default to ''

The CONTENT_HOST setting was hard to use with the default of None. It would first be checked in many places, and for example with Distribution it would give a 500.

This makes the default '' which should be much easier to use in many places.

https://pulp.plan.io/issues/4945 closes #4945

Actions #9

Updated by bmbouter over 5 years ago

  • Status changed from ASSIGNED to POST
Actions #10

Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED
Actions #11

Updated by bmbouter about 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #12

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #13

Updated by bmbouter over 4 years ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF