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 2274152 - Cannot perform an incremental syncable export after doing a full importable Library export - RHEL9 Satellite 6.16
Summary: Cannot perform an incremental syncable export after doing a full importable L...
Keywords:
Status: POST
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.16.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: stream
Assignee: Chris Roberts
QA Contact: Satellite QE Team
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-09 12:35 UTC by Giovanni Formisano
Modified: 2024-05-21 17:32 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 37381 0 Normal New content export actions are failing in ruby 3 2024-04-30 16:57:26 UTC
Github Katello katello pull 11002 0 None Merged Fixes #37381 - Change export tasks to Ruby3 kwargs 2024-05-21 17:32:08 UTC
Red Hat Issue Tracker SAT-24479 0 None None None 2024-04-09 12:38:02 UTC
Red Hat Issue Tracker SAT-24774 0 None None None 2024-05-14 17:17:31 UTC

Description Giovanni Formisano 2024-04-09 12:35:51 UTC
Description of problem:
----------------------

Incremental export of Library in regular format is not possible after a syncable full


Version-Release number of selected component (if applicable):
------------------------------------------------------------

Red Hat Satellite 6.16 on RHEL-9



How reproducible:
----------------


Steps to Reproduce:
------------------

1. Ensure that you set the download policy to Immediate for the repository within the Library lifecycle environment you export. .

2. Synchronize the repository.

3. Execute this command

  ~~~
   # hammer content-export complete repository --name="Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server" --organization-id=1 --product="Red Hat Enterprise Linux Server" --format=syncable
  ~~~


Actual results:
--------------

Could not export the repository:
  500 Internal Server Error



Expected results:
----------------

Generated /var/lib/pulp/exports/<ORG>/Export-SYNCABLE-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server-176/1.0/2024-04-09T17-07-52-02-00/metadata.json


Additional info:
---------------

Log message from /var/log/foreman/production.log

=========================
2024-04-09T14:21:59 [I|app|f2ed5aee] Started POST "/katello/api/content_exports/repository" for 10.37.195.22 at 2024-04-09 14:21:59 +0200
2024-04-09T14:21:59 [I|app|f2ed5aee] Processing by Katello::Api::V2::ContentExportsController#repository as */*
2024-04-09T14:21:59 [I|app|f2ed5aee]   Parameters: {"id"=>6, "api_version"=>"v2", "content_export"=>{"format"=>"syncable", "id"=>6}}
2024-04-09T14:21:59 [I|app|f2ed5aee] Authorized user admin(Admin User)
2024-04-09T14:22:00 [I|bac|f2ed5aee] Task {label: , execution_plan_id: 5cba365c-30db-4a51-8b90-e3aac884841e} state changed: pending 
2024-04-09T14:22:00 [I|bac|f2ed5aee] Task {label: Actions::Pulp3::Orchestration::ContentViewVersion::ExportRepository, id: 95fba8f1-1465-4431-a13e-c5c5cbf93c72, execution_plan_id: 5cba365c-30db-4a51-8b90-e3aac884841e} state changed: planning 
2024-04-09T14:22:00 [E|bac|f2ed5aee] wrong number of arguments (given 2, expected 1) (ArgumentError)
 f2ed5aee | /usr/share/gems/gems/katello-4.13.0.pre.master/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb:6:in `plan'
 f2ed5aee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/action.rb:534:in `block (3 levels) in execute_plan'
 f2ed5aee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/middleware/stack.rb:28:in `pass'
 f2ed5aee | /usr/share/gems/gems/dynflow-1.8.3/lib/dynflow/middleware.rb:20:in `pass'
=========================

From the documentation this is the command to execute: 

 ~~~
 # hammer content-export complete repository \
   --organization="My_Organization" \
   --product="My_Product" \
   --name="My_Repository" \
   --format=syncable
 ~~~

Comment 1 Giovanni Formisano 2024-04-10 14:05:32 UTC
Hello Team, 

I am not expert about Katello but doing troubleshooting I would like to share my finding, maybe can help.

Reading the production.log I have seen this call:

============================
2024-04-09T14:22:00 [I|bac|f2ed5aee] Task {label: , execution_plan_id: 5cba365c-30db-4a51-8b90-e3aac884841e} state changed: pending 
2024-04-09T14:22:00 [I|bac|f2ed5aee] Task {label: Actions::Pulp3::Orchestration::ContentViewVersion::ExportRepository, id: 95fba8f1-1465-4431-a13e-c5c5cbf93c72, execution_plan_id: 5cba365c-30db-4a51-8b90-e3aac884841e} state changed: planning 
2024-04-09T14:22:00 [E|bac|f2ed5aee] wrong number of arguments (given 2, expected 1) (ArgumentError)
 f2ed5aee | /usr/share/gems/gems/katello-4.13.0.pre.master/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb:6:in `plan'
============================

Checking inside call I though that there is something in this rb file /usr/share/gems/gems/katello-4.13.0.pre.master/app/controllers/katello/api/v2/exports_controller.rb

And here my assumption, I guess is called this function:

====================================
    def find_exportable_repository
      @repository = Repository.find_by_id(params[:id])
      if @repository.blank?
        throw_resource_not_found(name: 'repository', id: params[:id])
      end

      unless @repository.organization.can_export_content?
        throw_resource_not_found(name: 'organization', id: @repository.organization.id)
      end
    end
====================================

But the Repository.find needs 1 parameter. Looks like satellite try to pass <id> and <execution_plan_id>

If I am right seems is not correct since that in the function is specify only the <:id>

This is why I receive 

====================
 wrong number of arguments (given 2, expected 1) (ArgumentError)
===================

I hope this comment can be helpful.

Comment 2 Oleh Fedorenko 2024-04-11 14:06:55 UTC
For the maintainer: this looks like an overlook of https://github.com/Katello/katello/pull/10885. The actual issue seems to be in https://github.com/Katello/katello/blob/master/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb#L6-L9, which should be fixed by extracting of keyword arguments into a hash similarly to https://github.com/Katello/katello/pull/10885/files#diff-b15de70362926747b6c8b3158a9c435bf00bb65745ee9a256552cac5a4d6175f.

Comment 3 Partha Aji 2024-04-30 16:57:26 UTC
Connecting redmine issue https://projects.theforeman.org/issues/37381 from this bug


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