Content View Publish or Remove tasks fails with Error "PulpRpmClient::ApiError Error message: the server returns an error HTTP status code: 400 Response headers" on Red Hat Satellite.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.10
  • Pulp 3

Issue

  • Publish or Incremental Publish or Remove action for a Content View fails with following error:

       Input:
    
       filter_ids:
       - 55
       solve_dependencies: false
       rpm_filenames: 
       remove_all: true
       source_repository_id: 984
       target_repository_id: 8159
       smart_proxy_id: 1
       remote_user: admin
       remote_cp_user: admin
       current_request_id: '05192271-a452-4845-833d-5bbef6661108'
       current_timezone: Europe/Prague
       current_organization_id: 1
       current_location_id: 
       current_user_id: 4
       Output:
       
       Error:
    
       PulpRpmClient::ApiError
    
       Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"Tue, 14 Dec 2021 10:56:16 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"1049", "Correlation-ID"=>"05192271-a452-4845-833d-5bbef6661108", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 satellite.example.com", "Connection"=>"close"} Response body: ["Could not find the following content units: ['/pulp/api/v3/content/rpm/advisories/8ab5fcfb-3b52-4651-86da-59dea3bde275/', '/pulp/api/v3/content/rpm/advisories/67455a3f-f739-49a4-a0c8-ff035ff51bb5/', '/pulp/api/v3/content/rpm/advisories/81c59401-6697-4c62-b335-35c1b625dd11/', '/pulp/api/v3/content/rpm/advisories/40642ec2-9fc6-4dae-ac28-97291a2e1530/', '/pulp/api/v3/content/rpm/advisories/c25b64ba-0210-4cac-b4a6-57bee96cba57/', '/pulp/api/v3/content/rpm/advisories/48037fa4-a4f1-4bf3-adcc-231cfc365c7a/', '/pulp/api/v3/content/rpm/advisories/56dae5a6-3826-45df-b644-74204f0c41a0/', '/pulp/api/v3/content/rpm/advisories/327f608d-5a97-4336-a726-dcb532be480f/', '/pulp/api/v3/content/rpm/advisories/d93a95c3-d98f-49ca-ac19-88cbf477a048/', '/pulp/api/v3/content/rpm/advisories/babda2f9-5bff-426b-9ef6-462fa763b47a/', '/pulp/api/v3/content/rpm/advisories/519083ed-cc59-4193-ac28-81e742501914/', '/pulp/api/v3/content/rpm/advisories/0b520468-ba34-4c45-bcaa-63d7b9208472/', '/pulp/api/v3/content/rpm/advisories/74221edc-878c-4064-9aa3-b1faebc5916e/']"]
    
    

Resolution

  • This This content is not included.bug is fixed with the release of the Red Hat Satellite 6.11, under errata RHSA-2022:5498.

  • The workaround is to delete the repository errata associations and reimport them from Pulp.

    • Clear any paused CV-related tasks if any present. [ Don't try to cancel the same ].

      # foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ Actions::Katello::ContentView' STATES='paused' VERBOSE=true
      
    • Use the rake script below to apply the workaround of the main problem.

            # foreman-rake console                                 ## Let it get loaded properly 
         
            conf.echo = false
            Katello::Repository.all.select(&:yum?).select(&:library_instance?).each do |repo|
              p "Fixing repo: '#{repo.pulp_id}' Relative path: #{repo.relative_path}"
              p "Deleted associations: #{Katello::RepositoryErratum.where(repository_id: repo).destroy_all.size}"
              Katello::Erratum.import_for_repository(repo)
              # verify data
              p "Created associations: #{Katello::RepositoryErratum.where(repository_id: repo).size}"
            end
      
            exit
      
  • Once the command completes successfully, Retry the same action on the CV that was failing earlier and observe the progress.

 

For more KB articles/solutions related to Red Hat Satellite 6.x Content View Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Content View Issues

Root Cause

  • There are some errata/advisory's fields that Katello doesn't store in its database but Pulp does, such as version, pushcount, fromstr, rights etc. When one of those fields changes after syncing a repo, Katello can't notice the change and "index_content" will not update the hrefs. For more information please refer to this This content is not included.bug.
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.