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 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:
Embargoed:


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.