Project

Profile

Help

Issue #4329

closed

Not able to get URLs for the content types present in the repository version

Added by kersom almost 6 years ago. Updated over 5 years ago.

Status:
CLOSED - DUPLICATE
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 47
Quarter:

Description

Using Pulp 3 installation from source.

After a sync using the following the remote:

{'_created': '2018-12-20T23:12:31.533660Z',
 '_href': '/pulp/api/v3/remotes/file/9/',
 '_last_updated': '2018-12-20T23:12:31.533682Z',
 '_type': 'pulp_file.file',
 'download_concurrency': 20,
 'name': '9086ce91-904d-4e85-b365-3ffb25cdb66b',
 'policy': 'immediate',
 'proxy_url': '',
 'ssl_validation': True,
 'url': 'https://repos.fedorapeople.org/pulp/pulp/fixtures/file/PULP_MANIFEST',
 'validate': True}

Using pulp-smash utils to get repo versions:

from pulp_smash.pulp3.utils import get_versions
# versions
repo_versions = 
[{'_created': '2018-12-20T23:12:31.750448Z',
  '_href': '/pulp/api/v3/repositories/9/versions/1/',
  'base_version': None,
  'content_added_hrefs': {'pulp_file.file': '/pulp/api/v3/content/file/files/?repository_version_added=/pulp/api/v3/repositories/9/versions/1/'},
  'content_added_summary': {'pulp_file.file': 3},
  'content_hrefs': {'pulp_file.file': '/pulp/api/v3/content/file/files/?repository_version=/pulp/api/v3/repositories/9/versions/1/'},
  'content_removed_hrefs': {},
  'content_removed_summary': {},
  'content_summary': {'pulp_file.file': 3},
  'number': 1}]

Attempting to use the `` content_hrefs`` returned to issue a GET URLs for content types, a 500 HTTP is raised.

  1. get content_hrefs

    client.get(repo_versions[0]['content_hrefs']['pulp_file.file'])    
    

Traceback:


Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: pulp: django.request:ERROR: Internal Server Error: /pulp/api/v3/content/file/files/
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: Traceback (most recent call last):
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/options.py", line 564, in get_field
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return self.fields_map[field_name]
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: KeyError: 'artifact'
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: During handling of the above exception, another exception occurred:
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: Traceback (most recent call last):
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/base.py", line 635, in serializable_value
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     field = self._meta.get_field(field_name)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/options.py", line 566, in get_field
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name))
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: django.core.exceptions.FieldDoesNotExist: FileContent has no field named 'artifact'
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: During handling of the above exception, another exception occurred:
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: Traceback (most recent call last):
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     response = get_response(request)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     response = self.process_exception_by_middleware(e, request)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/core/handlers/base.py", line 124, in _get_response
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     response = wrapped_callback(request, *callback_args, **callback_kwargs)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return view_func(*args, **kwargs)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/viewsets.py", line 116, in view
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return self.dispatch(request, *args, **kwargs)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/views.py", line 495, in dispatch
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     response = self.handle_exception(exc)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/views.py", line 455, in handle_exception
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     self.raise_uncaught_exception(exc)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/views.py", line 492, in dispatch
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     response = handler(request, *args, **kwargs)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/mixins.py", line 45, in list
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return self.get_paginated_response(serializer.data)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/serializers.py", line 765, in data
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     ret = super(ListSerializer, self).data
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/serializers.py", line 262, in data
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     self._data = self.to_representation(self.instance)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/serializers.py", line 683, in to_representation
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     self.child.to_representation(item) for item in iterable
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/serializers.py", line 683, in <listcomp>
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     self.child.to_representation(item) for item in iterable
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/serializers.py", line 514, in to_representation
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     attribute = field.get_attribute(instance)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/rest_framework/relations.py", line 182, in get_attribute
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     value = attribute_instance.serializable_value(self.source_attrs[-1])
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/base.py", line 637, in serializable_value
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return getattr(self, field_name)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_file/app/models.py", line 33, in artifact
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return self._artifacts.get().pk
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     return getattr(self.get_queryset(), name)(*args, **kwargs)
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:   File "/usr/local/lib/pulp/lib64/python3.7/site-packages/django/db/models/query.py", line 399, in get
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]:     self.model._meta.object_name
Dec 20 18:18:08 p3.pulp.vm gunicorn[10767]: pulpcore.app.models.content.Artifact.DoesNotExist: Artifact matching query does not exis

The same error is raised using different download policies on the remote.

OS

[root@p3 ~]# cat /etc/redhat-release 
Fedora release 29 (Twenty Nine)

Related issues

Related to File Support - Issue #4340: "artifact" field causes serialization to blow up if the content units were lazily syncedCLOSED - CURRENTRELEASEdalleyActions
Actions #1

Updated by CodeHeeler almost 6 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 47
Actions #2

Updated by dalley almost 6 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
Actions #3

Updated by dalley almost 6 years ago

kersom Was the immediate-mode sync the only sync you ran on this machine? Did you do any syncs before that one, specifically, a sync in "cache_only" or "streamed" mode?

Actions #4

Updated by kersom almost 6 years ago

I do not record this one. I will try to re-create this one again, and update here.

Actions #5

Updated by kersom almost 6 years ago

dalley, there were syncs like `on_demand` and `streamed` before the `immediate` sync ran.

Actions #6

Updated by dalley almost 6 years ago

  • Status changed from ASSIGNED to CLOSED - DUPLICATE
Actions #7

Updated by dalley almost 6 years ago

  • Related to Issue #4340: "artifact" field causes serialization to blow up if the content units were lazily synced added
Actions #8

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #9

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)

Also available in: Atom PDF