[Red Hat Satellite] Enabling Repos shows 400 BAD Request on Red Hat Satellite Server.
Environment
- Red Hat Satellite
Issue
- Enabling repository on Red Hat Satellite Server shows
400 Bad RequestError message.
Resolution
- Below Steps should be taken to resolve the issue:
- Cleaned out all of the stuck tasks on Red Hat Satellite server:
foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' VERBOSE=true STATES='paused'
- Reimport some potentially missing data to
katello(this might be redundant but harmless step):
foreman-rake katello:reimport
- Repositories was created in
katellobut notpulp, so ran a repository repair script as the most crucial step:
foreman-rake katello:correct_repositories COMMIT=true
For more KB articles/solutions related to Red Hat Satellite 6.x Repository Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Repository Issues.
Diagnostic Steps
- Satellite Server >>>> Production Log.
2017-03-17 08:48:14 [app] [I] Processing by Katello::ProductsController#available_repositories as */*
2017-03-17 08:48:14 [app] [I] Parameters: {"content_id"=>"4792", "_"=>"1489758479358", "id"=>"25"}
2017-03-17 08:48:17 [app] [I] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/views/katello/providers/redhat/_repos.html.erb (10.0ms)
2017-03-17 08:48:17 [app] [I] Completed 200 OK in 2460ms (Views: 23.7ms | ActiveRecord: 10.2ms)
2017-03-17 08:48:22 [app] [I] Started PUT "/katello/products/25/toggle_repository" for 10.1.16.66 at 2017-03-17 08:48:22 -0500
2017-03-17 08:48:22 [app] [I] Processing by Katello::ProductsController#toggle_repository as */*
2017-03-17 08:48:22 [app] [I] Parameters: {"repo"=>"1", "pulp_id"=>"EPM-ORG-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_2_for_RHEL_6_Server_RPMs_x86_64", "content_id"=>"4792", "basearch"=>"x86_64", "id"=>"25"}
2017-03-17 08:48:24 [katello/pulp_rest] [E] RestClient.post "https://satellite.example.com/pulp/api/v2/repositories/", 31768 byte(s) length, "Accept"=>"*/*; q=0.5, application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"31768", "accept"=>"application/json", "content_type"=>"application/json"
| \n# => 400 BadRequest | application/json 442 bytes
|
2017-03-17 08:48:24 [foreman-tasks/action] [E] 400 Bad Request (RestClient::BadRequest)
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
| /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/base.rb:79:in `block in get_response'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:228:in `process_result'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rbovirt-0.0.37/lib/restclient_ext/request.rb:50:in `block in transmit'
| /opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rbovirt-0.0.37/lib/restclient_ext/request.rb:44:in `transmit'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
| /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post'
| /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/base.rb:78:in `get_response'
| /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/base.rb:66:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/resources/repository.rb:22:in `create'
| /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/extensions/repository.rb:71:in `create_with_importer_and_distributors'
| /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/lib/actions/pulp/repository/create.rb:27:in `run'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `pass'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware.rb:17:in `pass'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware.rb:30:in `run'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:22:in `call'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `pass'
| /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware.rb:17:in `pass'
| /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/lib/actions/middleware/remote_action.rb:16:in `block in run'
| /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/lib/actions/middleware/remote_action.rb:40:in `block in as_remote_user'
| /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/models/katello/concerns/user_extensions.rb:20:in `cp_config'
| /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.95/app/lib/actions/middleware/remote_action.rb:27:in `as_cp_user'
SBR
Product(s)
Category
Tags
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.