Bug #36334
closedContent view publish with filters is getting failed with the error "Could not find the following content units:"
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2172355
Description of problem:
While publishing the content view with filters applied it is getting failed with below error:
Errors:
Error message: the server returns an error
HTTP status code: 400
Response body: ["Could not find the following content units: ['/pulp/api/v3/content/rpm/modulemds/08018868-b067-4907-b24e-ec5571b0d0b2/']"]
But content view publish successfully if filters are not applied to it.
Version-Release number of selected component (if applicable):
Any Pulp 3 Katello
How reproducible:
Unknown
Steps to Reproduce:
To force, change the pulp_href of a filterable content unit in Katello to something fake.
Actual results:
Content view publish with filters get fails with the below error:
Response body: ["Could not find the following content units: ['/pulp/api/v3/content/rpm/modulemds/08018868-b067-4907-b24e-ec5571b0d0b2/']"]
Expected results:
Content view publish with filters should complete successfully.
Additional info:
Same issue observed here https://community.theforeman.org/t/strange-pulp3-error/25550
Updated by Ian Ballou over 1 year ago
- Subject changed from Content view publish with filters is getting failed with error "Could not find the following content units:" to Content view publish with filters is getting failed with error "Could not find the following content units:"
The following content units could potentially by affected (since they can be filtered by ID):
- Package groups
- Errata
- Module streams
Updated by Ian Ballou over 1 year ago
Question to myself -- can this just be fixed with a sync and reindex? The reindex should be destroying the old records.
Updated by Ian Ballou over 1 year ago
- Description updated (diff)
For filter rules that are specifically associated to content units, like module streams or errata, the filter rules will also need to be disassociated from the orphaned unit. This could be done by destroying the orphaned unit.
Updated by Ian Ballou over 1 year ago
Potential solution: update content view publishing to catch the missing units error and tell the user what repositories need a complete sync. Also ensure that indexing deletes units that no longer exist in Pulp. Perhaps this is only an issue with some units, like modulemds? It's possible that there was an indexing bug from the past that is now fixed. Each content type that is filterable should be checked.
Updated by Ian Ballou over 1 year ago
It looks like this may be a bug where, if a module stream changes pulp_href, the new one will be pulled in, but the old one will not be destroyed. As alluded to in my previous message, the old one stays connected to the content view filters and causes the error. We need to make sure that the existing module streams get updated so filters aren't broken.
Updated by Ian Ballou over 1 year ago
One question that needs to be answered is if Pulp changes module streams when they get updates outside of the NSVCA. If yes, then we need to "properly" handle this issue by either updating the existing module streams at index time (which will slow down indexing) or by deleting the old module stream and updating the filters with the new one (which will also slow down indexing but likely less).
If Pulp doesn't expect module streams to be replaced with new ones outside of NSVCA changes, then the disappearing units are probably quite rare and we can simply warn the user appropriately to perform a complete resync and report which filters may need fixing.
Updated by Ian Ballou over 1 year ago
After some testing, the only way I could see module streams "disappearing" would be if they were removed from a repository entirely. In that case, if the module stream is in a CV filter, it continues being there rather than getting removed. So, we should ensure that filters (by record ID) get updated when content is removed.
Updated by The Foreman Bot over 1 year ago
- Status changed from New to Ready For Testing
- Assignee set to Ian Ballou
- Pull request https://github.com/Katello/katello/pull/10542 added
Updated by Samir Jha over 1 year ago
- Target version set to Katello 4.9.0
- Triaged changed from No to Yes
Updated by The Foreman Bot over 1 year ago
- Fixed in Releases Katello 4.10.0 added
Updated by Anonymous over 1 year ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|aed629926451904e6d00d679d10d1b68314bf4a4.
Updated by David Moore about 1 year ago
- Subject changed from Content view publish with filters is getting failed with error "Could not find the following content units:" to Content view publish with filters is getting failed with the error "Could not find the following content units:"