Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1884988 - Inventory Upload fails on QueueForUploadJob
Summary: Inventory Upload fails on QueueForUploadJob
Keywords:
Status: CLOSED DUPLICATE of bug 1874619
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Shimon Shtein
QA Contact: Mirek Długosz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-04 09:55 UTC by Pavel Moravec
Modified: 2020-10-14 07:26 UTC (History)
2 users (show)

Fixed In Version: 1.0.12
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-13 14:25:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5488231 0 None None None 2020-10-14 07:26:29 UTC

Description Pavel Moravec 2020-10-04 09:55:21 UTC
Description of problem:
Enabling Insights per [1], clicking to Configure > Inventory Upload -> Restart fails in QueueForUploadJob. Each and every time for me. I might click to "Auto upload" before or during the very first Restart action (which can be the trigger here), but even when I disabled this, I constantly get the same error.

[1] https://access.redhat.com/documentation/en-us/red_hat_insights/2020-04/html-single/remediating_issues_across_your_red_hat_satellite_infrastructure_using_red_hat_insights/index#configuring-your-satellite-infrastructure-to-communicate-with-insights


Version-Release number of selected component (if applicable):
satellite-6.7.4 (was .2 during first attempt)


How reproducible:
???


Steps to Reproduce:
No deterministic reproducer known to me.


Actual results:
Restart button fails with backtrace:

rake aborted!

NoMethodError: undefined method `name' for nil:NilClass
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/slice.rb:70:in `block (2 levels) in report_host'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/json_stream.rb:11:in `array'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/json_stream.rb:35:in `array_field'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/slice.rb:64:in `block in report_host'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/json_stream.rb:17:in `object'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/slice.rb:43:in `report_host'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/generators/slice.rb:33:in `block (3 levels) in report_slice'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
..
Tasks: TOP => foreman_inventory_upload:report:generate
(See full trace by running task with --trace)
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
Must specify either portal_user or organization_id
I, [2020-10-04T11:48:34.254786 #30034] INFO -- : Started generating hosts report in /tmp/d20201004-30034-bq5km8
I, [2020-10-04T11:48:34.335063 #30034] INFO -- : Adding slice 1d605867-7037-42f6-9cba-4a1a5e85ef63


and production.log error:

2020-10-04T11:47:46 [I|app|74d67dec] Performing ForemanInventoryUpload::Async::GenerateReportJob (Job ID: 58ffcd62-6328-447e-a8fb-b72670c0af80) from Dynflow(default) with arguments: "/var/lib/foreman/red_hat_inventory/generated_reports/", "1"
2020-10-04T11:48:36 [I|app|74d67dec] Enqueued ForemanInventoryUpload::Async::QueueForUploadJob (Job ID: 5b99d645-123d-4413-b8b3-0557ac920ef8) to Dynflow(default) with arguments: "/var/lib/foreman/red_hat_inventory/generated_reports/", "report_for_1.tar.gz", "1"
2020-10-04T11:48:36 [I|app|74d67dec] Performed ForemanInventoryUpload::Async::GenerateReportJob (Job ID: 58ffcd62-6328-447e-a8fb-b72670c0af80) from Dynflow(default) in 49621.81ms
2020-10-04T11:48:36 [I|app|74d67dec] Performing ForemanInventoryUpload::Async::QueueForUploadJob (Job ID: 5b99d645-123d-4413-b8b3-0557ac920ef8) from Dynflow(default) with arguments: "/var/lib/foreman/red_hat_inventory/generated_reports/", "report_for_1.tar.gz", "1"
2020-10-04T11:48:36 [E|app|74d67dec] Error performing ForemanInventoryUpload::Async::QueueForUploadJob (Job ID: 5b99d645-123d-4413-b8b3-0557ac920ef8) from Dynflow(default) in 1.78ms: Errno::ENOENT (No such file or directory @ rb_file_s_rename - (/var/lib/foreman/red_hat_inventory/generated_reports/report_for_1.tar.gz, /var/lib/foreman/red_hat_inventory/uploads/report_for_1.tar.gz)):
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:471:in `rename'
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:471:in `block in mv'
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:1463:in `block in fu_each_src_dest'
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:1479:in `fu_each_src_dest0'
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:1461:in `fu_each_src_dest'
/opt/rh/rh-ruby25/root/usr/share/ruby/fileutils.rb:460:in `mv'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-1.0.10/lib/foreman_inventory_upload/async/queue_for_upload_job.rb:12:in `perform'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activejob-5.2.1/lib/active_job/execution.rb:39:in `block in perform_now'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
..

Indeed, /var/lib/foreman/red_hat_inventory/ directory does not contain report_for_1.tar.gz any time.



Expected results:
No such error.


Additional info:
Maybe unrelated:
Trying to download the report (Uploading tab -> Download Report) raises:

undefined local variable or method `foreman_inventory_upload_index_path' for #<ForemanInventoryUpload::UploadsController:0x00007fcbf7d6e730> Did you mean? foreman_inventory_upload_path foreman_inventory_upload_tasks_path foreman_inventory_upload_accounts_path foreman_inventory_upload_tasks_url

Comment 1 Mirek Długosz 2020-10-12 15:21:10 UTC
Do you have reproducer machine you could share internally for debugging?
What was history of this machine? Could it be caused by failure during update? Could you try on fresh Satellite?
Do you have valid manifest uploaded to this organization?

Comment 4 Pavel Moravec 2020-10-14 07:11:41 UTC
OK, I will try to verify on my Sat once 6.7.5 is out. Thanks for checking the cause on background!


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