Issue #2797

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

Added by over 4 years ago. Updated about 1 year ago.

Start date:
Due date:
Estimated time:
3. High
Platform Release:
Sprint Candidate:
Pulp 2
Sprint 20


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
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.

Associated revisions

Revision 81e350c0 View on GitHub
Added by ttereshc over 4 years ago

Fix criteria obj for consumer in applicability regeneration view

All kudos go to Chris (cduryee).

closes #2797


#1 Updated by ttereshc over 4 years ago

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

#2 Updated by cduryee over 4 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" : "", "description" : null, "_ns" : "consumers", "notes" : {  }, "rsa_pub" : null, "capabilities" : {  }, "id" : "e1d8a941-c991-4235-9e99-f666f9236b90" }

changing 'consumer_id' to 'id' in seems to make things happier.

#4 Updated by over 4 years ago

I think this is the culprit:

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.

#5 Updated by ttereshc over 4 years ago

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

#6 Updated by ttereshc over 4 years ago

  • Status changed from ASSIGNED to MODIFIED

#10 Updated by pcreech over 4 years ago

  • Platform Release set to 2.13.2

#11 Updated by pcreech over 4 years ago

  • Status changed from MODIFIED to 5

#12 Updated by pcreech over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#14 Updated by bmbouter almost 4 years ago

  • Sprint set to Sprint 20

#15 Updated by bmbouter almost 4 years ago

  • Sprint/Milestone deleted (39)

#16 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

#17 Updated by Exercitatio about 1 year 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