[Satellite 6] Manifest refresh fails with error " [foreman-tasks/action] [E] 400 Bad Request (RestClient::BadRequest) "
Environment
- Red Hat Satellite 6.x
Issue
- Manifest refresh fails with following error:
[foreman-tasks/action] [E] 400 Bad Request (RestClient::BadRequest)
Resolution
For Satellite v.6.3 and above
- Download a new manifest from the Portal. Import this manifest to the Satellite:-
Satellite WebUI -> Content -> Subscriptions -> Manage Manifest -> Choose File -> Upload
For Satellite v.6.2
- There is already Bugzilla related to this issue This content is not included.150463, which has been fixed in
Satellite 6.3. - As a workaround please perform the following steps :
Take the backup of the following file and perform the below steps :
Modify the file as given below (the line numbers are given as a reference point, but may differ depending on katello version):
[root@satellite ~]# git init .
[root@satellite ~]# git add .
[root@satellite ~]# git commit -m "original"
[root@satellite ~]# # vi /opt/theforeman/tfm/root/usr/share/gems/gems/katello-<version>/app/lib/katello/resources/candlepin.rb
From:
281 RestClient::Resource.new(url,
282 :ssl_client_cert => OpenSSL::X509::Certificate.new(client_cert),
283 :ssl_client_key => OpenSSL::PKey::RSA.new(client_key),
284 :ssl_ca_file => ca_file,
285 :verify_ssl => ca_file ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
286 )
To:
281 RestClient::Resource.new(url,
282 :ssl_client_cert => OpenSSL::X509::Certificate.new(client_cert),
283 :ssl_client_key => OpenSSL::PKey::RSA.new(client_key),
284 :ssl_ca_file => ca_file,
285 :verify_ssl => ca_file ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE,
286 :open_timeout => 60*20,
287 :timeout => 60*20
288 )
[root@satellite ~]# vi /opt/theforeman/tfm/root/usr/share/gems/gems/katello-<version>/app/models/katello/glue/provider.rb
From:
---
221 begin
222 if manifest_refresh
223 zip_file_path = "/tmp/#{rand}.zip"
224 upstream = options[:upstream]
225 pre_queue.create(:name => "regenerate upstream certificates for: #{self.organization.name}",
226 :priority => 1, :action => [self, :owner_regenerate_upstream_certificates, upstream],
227 :action_rollback => nil)
228 pre_queue.create(:name => "export upstream manifest for owner: #{self.organization.name}",
229 :priority => 2, :action => [self, :owner_upstream_update, upstream, options],
230 :action_rollback => nil)
231 pre_queue.create(:name => "export upstream manifest for owner: #{self.organization.name}",
232 :priority => 3, :action => [self, :owner_upstream_export, upstream, zip_file_path, options],
233 :action_rollback => nil)
234 else
235 zip_file_path = options[:zip_file_path]
236 end
---
To:
---
221 begin
222 if manifest_refresh
223 zip_file_path = "/tmp/#{rand}.zip"
224 upstream = options[:upstream]
225 # pre_queue.create(:name => "regenerate upstream certificates for: #{self.organization.name}",
226 # :priority => 1, :action => [self, :owner_regenerate_upstream_certificates, upstream],
227 # :action_rollback => nil)
228 pre_queue.create(:name => "export upstream manifest for owner: #{self.organization.name}",
229 :priority => 2, :action => [self, :owner_upstream_update, upstream, options],
230 :action_rollback => nil)
231 pre_queue.create(:name => "export upstream manifest for owner: #{self.organization.name}",
232 :priority => 3, :action => [self, :owner_upstream_export, upstream, zip_file_path, options],
233 :action_rollback => nil)
234 else
235 zip_file_path = options[:zip_file_path]
236 end
[root@satellite ~]# katello-service restart
For more KB articles/solutions related to Red Hat Satellite 6.x Manifest Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Manifest Issues
Root Cause
- Connection time out occurring while attaching a bigger sized manifest.
- Corrupt manifest file.
Diagnostic Steps
- Check the log file from
/var/log/foreman/production.log
2017-10-18 10:12:22 9460d5aa [app] [I] Parameters: {"product"=>"Red Hat Satellite or Proxy", "version"=>"6.2", "summary"=>"Refreshing the manifest fails", "description"=>"Refreshing the manifest fails with messages \n\n2017-10-18 09:47:16 [app] [E] Error during manifest refresh: {\"displayMessage\"=>\"Manifest refresh failed\", \"conflicts\"=>[]}\n2017-10-18 09:47:16 [foreman-tasks/action] [E] 400 Bad Request (RestClient::BadRequest)", "redhat_client"=>"foreman_plugin_satellite_1.0.15", "account_number"=>"5264565", "limit"=>"5", "highlight"=>"false", "path"=>"rs/problems", "strata_proxy"=>{"product"=>"Red Hat Satellite or Proxy", "version"=>"6.2", "summary"=>"Refreshing the manifest fails", "description"=>"Refreshing the manifest fails with messages \n\n2017-10-18 09:47:16 [app] [E] Error during manifest refresh: {\"displayMessage\"=>\"Manifest refresh failed\", \"conflicts\"=>[]}\n2017-10-18 09:47:16 [foreman-tasks/action] [E] 400 Bad Request (RestClient::BadRequest)"}}
SBR
Product(s)
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.