Project

Profile

Help

Issue #2797

closed

Single consumer aplicability generation does not work unless profile already has applicability generated

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

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.12.2
Platform Release:
2.13.2
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 20
Quarter:

Description

Recently the pulp team advised the katello team to start using the single consumer applicability generation api here:

POST /pulp/api/v2/consumers/UUID/actions/content/regenerate_applicability/

however this does not seem to work unless the profile has already been generated.

Steps to reproduce:

On a fresh pulp server (or a pulp server that has never had this consumer registered with its package profile):

a) sync a repository with errata (such as https://jlsherrill.fedorapeople.org/fake-repos/needed-errata/)
b) register a consumer, upload its package profile with some older package than what is in the repo with an errata (such as walrus 0.71)
c) bind the consumer to the repository
d) generate applicability using the api above
e) fetch applicability using:

POST /pulp/api/v2/consumers/content/applicability/ with body:

      {
          'criteria' : { 'filters' : { 'id' : { '$in' : [UUID] } } },
          'content_types' : ['errata']
        }

note that the list is empty. If you generate it using this api that we have been using for years it works fine:
POST /pulp/api/v2/consumers/actions/content/regenerate_applicability/

    {
          'consumer_criteria' => { 'filters' : { 'id' : { '$in' => [UUID] } } }
        }

Note that once the profile is generated, it seems that the single consumer api seems to work fine.

Actions #1

Updated by ttereshc over 7 years ago

  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Triaged changed from No to Yes
Actions #2

Updated by cduryee over 7 years ago

It looks like there is an error in the Criteria obj created, it looks for 'consumer_id' instead of just 'id'. for example:

{'sort': None, 'skip': None, 'limit': None, 'filters': {'consumer_id': {'$eq': u'e1d8a941-c991-4235-9e99-f666f9236b90'}}, 'fields': None, '_id': ObjectId('5936cdef280a9f4d33ce55f8'), 'id': '5936cdef280a9f4d33ce55f8'}

(the one above has an extra $eq but you get the idea)

but the mongo document is:

{ "_id" : ObjectId("5936c1c5280a9f3673e58313"), "display_name" : "applic-katello-3-4.example.com", "description" : null, "_ns" : "consumers", "notes" : {  }, "rsa_pub" : null, "capabilities" : {  }, "id" : "e1d8a941-c991-4235-9e99-f666f9236b90" }

changing 'consumer_id' to 'id' in https://github.com/pulp/pulp/blob/master/server/pulp/server/webservices/views/consumers.py#L954 seems to make things happier.

Actions #4

Updated by amacdona@redhat.com over 7 years ago

I think this is the culprit: https://github.com/pulp/pulp/blob/master/server/pulp/server/webservices/views/consumers.py#L954

Another possibility and next step:
For models that were converted to mongoengine models (consumers were not) we have an internal translation to maintain backwards compatibility, but it should not be running on consumers. This is the line to start with to determine if translation is happening.

Added by ttereshc over 7 years ago

Revision 81e350c0 | View on GitHub

Fix criteria obj for consumer in applicability regeneration view

All kudos go to Chris (cduryee).

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

Actions #5

Updated by ttereshc over 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ttereshc
  • Sprint/Milestone set to 39
Actions #6

Updated by ttereshc over 7 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #10

Updated by pcreech over 7 years ago

  • Platform Release set to 2.13.2
Actions #11

Updated by pcreech over 7 years ago

  • Status changed from MODIFIED to 5
Actions #12

Updated by pcreech over 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #14

Updated by bmbouter almost 7 years ago

  • Sprint set to Sprint 20
Actions #15

Updated by bmbouter almost 7 years ago

  • Sprint/Milestone deleted (39)
Actions #16

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added
Actions #17

Updated by Exercitatio about 4 years ago

The people has talk about the character of Nigerian people on one Africa and take twist from this. I guess to some extent that the people of Nigeria is Fulfillment center philippines and a great nation in making.

Also available in: Atom PDF