Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1446727 - Repair repositories fail with 400 bad request in satellite 6.2
Summary: Repair repositories fail with 400 bad request in satellite 6.2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.2.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Radovan Drazny
URL:
Whiteboard:
Depends On:
Blocks: 1425437 1446729
TreeView+ depends on / blocked
 
Reported: 2017-04-28 16:30 UTC by Satellite Program
Modified: 2019-12-16 07:33 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1375075
Environment:
Last Closed: 2018-02-21 16:45:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17351 0 Normal Closed provide way to correct repos missing pulp 2020-08-21 00:12:42 UTC
Foreman Issue Tracker 18793 0 Normal Closed Content Views Create/Promotion Fails with "undefined method '[]' for nil:NilClass (NoMethodError) 2020-08-21 00:12:43 UTC
Foreman Issue Tracker 18816 0 High Closed RedHat Content sync stops working after upload of manifest 2020-08-21 00:12:43 UTC

Comment 2 Radovan Drazny 2017-10-10 14:00:23 UTC
Tested on Satellite 6.3 Snap 19. There was a showstopper right in the start - the "/usr/share/foreman/lib/tasks/repair_repos.rake" is missing in the Sat6.3 Snap 19. 

I have used "http://people.redhat.com/~mmccune/repair_repos_62.rake" mentioned in "https://access.redhat.com/solutions/1453313". I have tried "http://people.redhat.com/~mmccune/repair_repos.rake"

  - Run "foreman-rake katello:generate_repositories_to_fix"
  - Run "foreman-rake katello:generate_pulp_repositories"

Results for repair_repos.rake:

$ foreman-rake katello:generate_pulp_repositories
Unable to fix repository with the pulp_id '0379d32a-fb66-4a56-bdd4-c96a6321f8c7'. Error => [400 Bad Request]
["/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'", "/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.12.0/lib/runcible/base.rb:79:in `block in get_response'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'", "/opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in `start'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'", "/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post'", "/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.12.0/lib/runcible/base.rb:78:in `get_response'", "/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.12.0/lib/runcible/base.rb:66:in `call'", "/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.12.0/lib/runcible/resources/repository.rb:22:in `create'", "/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.12.0/lib/runcible/extensions/repository.rb:69:in `create_with_importer_and_distributors'", "/usr/share/foreman/lib/tasks/repair_repos.rake:48:in `run'", "/usr/share/foreman/lib/tasks/repair_repos.rake:148:in `fix_repo'", "/usr/share/foreman/lib/tasks/repair_repos.rake:163:in `block (3 levels) in <top (required)>'", "/usr/share/foreman/lib/tasks/repair_repos.rake:161:in `each'", "/usr/share/foreman/lib/tasks/repair_repos.rake:161:in `block (2 levels) in <top (required)>'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'", "/opt/rh/rh-ruby23/root/usr/share/ruby/monitor.rb:214:in `mon_synchronize'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'", "/opt/rh/rh-ruby23/root/usr/share/gems/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'", "/opt/rh/rh-ruby23/root/usr/bin/rake:23:in `load'", "/opt/rh/rh-ruby23/root/usr/bin/rake:23:in `<main>'"]
Unable to fix repository with the pulp_id '15317193-2638-43ea-a735-b4d687a3ac8d'. Error => [400 Bad Request]
<...>

Results for repair_repos_62.rake:

$ foreman-rake katello:generate_pulp_repositories
<...>
Completed generating pulp repo for the following repository

       name: Centos 7 repo
       pulp_id: b41297ef-c575-4934-8daa-d6df8ccdd488
       product: Centos 7
       organization: Default Organization

You need to manually sync this repository in the specified organization before proceeding.
Completed generating pulp repo for the following repository

       name: Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.3
       pulp_id: cf825035-8ace-4bbf-ba48-c4f92378b193
       product: Red Hat Enterprise Linux Server
       organization: Default Organization

You need to manually sync this repository in the specified organization before proceeding.
Completed generating pulp repo for the following repository

       name: Red Hat Enterprise Linux 6 for System Z RPMs s390x 6.9
       pulp_id: dae926a3-e493-4909-b604-fc1a82b70692
       product: Red Hat Enterprise Linux for IBM z Systems
       organization: Default Organization

You need to manually sync this repository in the specified organization before proceeding.


The old "repair_repos.rake" generates the "[400 Bad Request]" errors, no repos were fixed.
The new (I suppose) "repair_repos_62.rake" successfully generates repos.
Still, the main problem is that "repair_repos_62.rake" is missing in the compose.

Comment 3 Satellite Program 2017-10-10 16:24:24 UTC
Upstream bug assigned to jsherril

Comment 10 Radovan Drazny 2017-10-25 12:11:54 UTC
Ok, my fault - I went by the initial report talking about "katello:generate_pulp_repositories", found out there is no such task, searched for it, found https://access.redhat.com/solutions/1453313 and assumed there was a problem with Sat 6.3. Should have go deeper in the original BZ1375075, as I have missed the comment 11 there. Sorry about that.

Going through steps from BZ1375075 comment #11 on Sat 6.3 Snap 21:

$ foreman-rake console
Loading production environment (Rails 4.2.6)
Failed to load console gems, starting anyway
irb(main):001:0> Katello.pulp_server.resources.repository.delete(Katello::Repository.find(4).pulp_id)
=> {"spawned_tasks"=>[{"_href"=>"/pulp/api/v2/tasks/85934af6-f99a-466e-9d07-b1e76bcc50b9/", "task_id"=>"85934af6-f99a-466e-9d07-b1e76bcc50b9"}], "result"=>nil, "error"=>nil}
irb(main):002:0> 

$ COMMIT=true foreman-rake katello:correct_repositories
Processing Repository 1/2: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server (1)
Processing Repository 2/2: Satellite Tools 6.3 repo (4)
Repository 4 Missing
Recreating 4

$ foreman-rake katello:regenerate_repo_metadata
Regenerating 2 repositories.  You can monitor these on task id b895a75d-b57b-4579-9be8-36cff5d384b7
$ foreman-rake katello:refresh_pulp_repo_details

Refreshing 2 repositories.  You can monitor these on task id 8589af33-022b-4c99-a6a4-070560900f58

Tasks for katello:regenerate_repo_metadata and katello:refresh_pulp_repo_details both passed successfully.

Comment 11 Bryan Kearney 2018-02-21 16:41:44 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 12 Bryan Kearney 2018-02-21 16:45:20 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.