Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-39084

Pulpcore 3.85 breaks n-1 capsule syncing: gpgcheck cannot be nil

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 6.19.0
    • 6.19.0
    • Capsule - Content
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      Capsule servers running older Pulp versions (pre-3.30.0) cannot sync with Katello server after upgrading to pulp_rpm_client 3.32.2 bindings. The sync fails with ArgumentError when attempting to list or read repositories and publications from the Capsule's Pulp instance.

      This breaks the n-1 version compatibility requirement where Capsules should be able to run one major version behind the Katello server during rolling upgrades.

      The root cause is that `gpgcheck` and `repo_gpgcheck` fields were deprecated in pulp_rpm 3.30.0 and return `null` in older Pulp versions. The new bindings have strict validation rejecting nil values, causing repository and publication API calls to fail during Capsule sync operations.

      Affected models:

      • PulpRpmClient::RpmRpmRepositoryResponse
      • PulpRpmClient::RpmRpmPublicationResponse

      How reproducible:

      100% reproducible when Katello server with pulp_rpm_client 3.32.2 attempts to sync with Capsule running Pulp < 3.30.0

      Is this issue a regression from an earlier version:

      Yes - this is a regression introduced when upgrading to pulp_rpm_client 3.32.2 bindings. Previously supported n-1 Capsule syncing is now broken.

      Steps to Reproduce:

      1. Upgrade Katello server to version with pulp_rpm_client 3.32.2 bindings
      2. Maintain Capsule server on Pulp version < 3.30.0 (e.g., Pulp 3.21, 3.25)
      3. Attempt to sync content to the Capsule or perform repository mirroring operations
      4. Observe Capsule sync operations that query the Capsule's Pulp API (e.g., checking publication status, listing repositories)

      Actual behavior:

      Capsule sync fails with:
      ArgumentError: gpgcheck cannot be nil from /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/pulp_rpm_client-3.32.2/lib/pulp_rpm_client/models/rpm_rpm_repository_response.rb:418:in `gpgcheck='

      Or:
      ArgumentError: gpgcheck cannot be nil from /home/vagrant/foreman/.vendor/ruby/3.0.0/gems/pulp_rpm_client-3.32.2/lib/pulp_rpm_client/models/rpm_rpm_publication_response.rb:264:in `gpgcheck='

      Stack traces show failures in:

      • `/app/services/katello/pulp3/repository_mirror.rb:84:in 'publication_href'`
      • `/app/services/katello/pulp3/repository.rb` during `repositories_api.list()`
      • `/app/services/katello/pulp3/smart_proxy_repository.rb` during repository operations

      The error occurs when Katello tries to deserialize JSON responses from the older Capsule's Pulp API, which contains `"gpgcheck":null` and `"repo_gpgcheck":null` for these deprecated fields.

      Expected behavior:

      Katello server should successfully sync with Capsule servers running n-1 Pulp versions. API calls to the Capsule's Pulp instance should properly deserialize responses even when deprecated fields contain null values.

      The bindings should gracefully handle nil for deprecated fields since:
      1. These fields are marked as REMOVED/deprecated in pulp_rpm 3.30.0
      2. Older Pulp versions legitimately return null for these fields
      3. The fields are not operationally used since pulp_rpm 3.30.0
      4. n-1 compatibility is a documented support requirement

      Business Impact / Additional info:

      {}Workaround implemented:{}
      A monkey patch has been added to Katello in `lib/monkeys/fix_rpm_repository_gpgcheck.rb` that overrides the setter methods for `gpgcheck` and `repo_gpgcheck` in both `RpmRpmRepositoryResponse` and `RpmRpmPublicationResponse` to allow nil values while maintaining range validation for non-nil values.

      The patch is loaded via `config/initializers/monkeys.rb` and restores n-1 Capsule compatibility.

      {}Root cause:{}
      The OpenAPI generator created strict validation (`fail ArgumentError, 'gpgcheck cannot be nil'`) based on the current Pulp spec. However, the generator didn't account for backward compatibility with older Pulp versions that return null for these deprecated fields, breaking the n-1 version support requirement.

       

              iballou@redhat.com Ian Ballou
              iballou@redhat.com Ian Ballou
              Vladimír Sedmík Vladimír Sedmík
              Samir Jha Samir Jha
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: