Project

Profile

Help

Issue #4945

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

Added by jsherril@redhat.com 8 months ago. Updated about 1 month ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
API
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 56

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 role CLOSED - CURRENTRELEASE Actions

Associated revisions

Revision 295e55f2 View on GitHub
Added by bmbouter 7 months ago

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

History

#1 Updated by jsherril@redhat.com 8 months 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

#2 Updated by jsherril@redhat.com 8 months ago

  • Description updated (diff)

#3 Updated by jsherril@redhat.com 8 months ago

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

#4 Updated by jsherril@redhat.com 8 months 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.

#5 Updated by amacdona@redhat.com 8 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 54

#6 Updated by ttereshc 7 months ago

  • Sprint changed from Sprint 54 to Sprint 55

#7 Updated by dkliban@redhat.com 7 months ago

  • Sprint changed from Sprint 55 to Sprint 56

#8 Updated by bmbouter 7 months ago

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

#9 Updated by bmbouter 7 months ago

  • Status changed from ASSIGNED to POST

#10 Updated by bmbouter 7 months ago

  • Status changed from POST to MODIFIED

#11 Updated by bmbouter about 1 month ago

  • Sprint/Milestone set to 3.0.0

#12 Updated by bmbouter about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF