Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-123603

insights-client --version shows incorrect version of core

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • rhel-8.10, rhel-9.6
    • insights-client
    • None
    • None
    • None
    • subs-client-tools-1
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Description/Background:

      During RC testing of insights-client for RHEL 9.7, I saw that pipeline on Jenkins uses insights-client-3.2.8-1.el9 (which was released in August 2024, the newest version of insights-client for RHEL9 is insights-client-3.9.0-1.el9 - however, this version was never added to Errata). And it seems that this version of insights-client does not automatically updates core version before the tests run, because the first four tests are using the core version shipped with insights-client-3.2.8-1.el9, which is 3.4.9. The pipeline execution looks this:

      integration-tests/playbook_verifier/test_verifier.py::test_official_playbook[insights_setup.yml] PASSED [  0%]
      integration-tests/playbook_verifier/test_verifier.py::test_official_playbook[compliance_openscap_setup.yml] PASSED [  1%]
      integration-tests/test_checkin.py::test_client_checkin_unregistered FAILED [  2%]
      integration-tests/test_client.py::test_client_files_permission PASSED    [  3%]
      

      ^also playbook_verifier/test_verifier.py::test_official_playbook[bugs.yml] due to this old egg does not run.

      This is the failing test test_checkin.py::test_client_checkin_unregistered:

      def test_client_checkin_unregistered(insights_client):
          with contextlib.suppress(Exception):
              insights_client.unregister()
          assert conftest.loop_until(lambda: not insights_client.is_registered)
      
          checkin_result = insights_client.run("--checkin", check=False)
          if insights_client.core_version >= Version(3, 4, 25):
              assert checkin_result.returncode > 0
              assert "This host is not registered" in checkin_result.stdout
          else:
              assert checkin_result.returncode == 1
      >       assert (
                  "Error: failed to find host with matching machine-id"
                  in checkin_result.stdout
              )
      E           AssertionError: assert 'Error: failed to find host with matching machine-id' in 'Checking in...\nThis host is not registered. Use --register to register this host:\n# insights-client --register\n'
      E            +  where 'Checking in...\nThis host is not registered. Use --register to register this host:\n# insights-client --register\n' = CompletedProcess(args=['runcon', 'system_u:system_r:insights_client_t:s0', 'insights-client', '--checkin'], returncode=1, stdout='Checking in...\nThis host is not registered. Use --register to register this host:\n# insights-client --register\n', stderr='').stdout
      

      Manual check:

      $ insights-client --version
      Client: 3.2.8
      Core: 3.4.9-1
      $ insights-client --checkin
      Checking in...
      This host is not registered. To register, run 'insights-client --register'.
      ^this message was introduced in insights-core-3.4.25
      $ insights-client --version
      Client: 3.2.8
      Core: 3.4.9-1
      

      By looking at the logs, --checkin command uses core_version=3.5.0:

      2025-10-17 12:30:25,610    DEBUG insights.client.client:145 Logging initialized
      2025-10-17 12:30:25,610    DEBUG insights.client.crypto:272 starting gpg verification process for '/var/lib/insights/newest.egg'
      2025-10-17 12:30:25,610    DEBUG insights.client.crypto:80 setting up gpg temporary environment in '/var/lib/insights/tmpzgs8j7fs'
      2025-10-17 12:30:25,630    DEBUG insights.client.crypto:201 gpg command ['--import', '/etc/insights-client/redhattools.pub.gpg']: ok
      2025-10-17 12:30:25,631    DEBUG insights.client.crypto:223 running gpg in the temporary environment
      2025-10-17 12:30:25,649    DEBUG insights.client.crypto:201 gpg command ['--verify', '/var/lib/insights/newest.egg.asc', '/var/lib/insights/newest.egg']: ok
      2025-10-17 12:30:25,675    DEBUG insights.client.crypto:276 signature verification of '/var/lib/insights/newest.egg' passed
      2025-10-17 12:30:25,676    DEBUG insights_client:287 phase 'pre_update'; egg '/var/lib/insights/newest.egg'
      2025-10-17 12:30:26,364    DEBUG insights.client.client:143 Logging initialized
      2025-10-17 12:30:26,364    DEBUG insights.client:54 path=/var/lib/insights/newest.egg/insights/client/client.py, version=3.5.0, phase=pre_update, arguments=--checkin
      2025-10-17 12:30:26,365    DEBUG insights.client.auto_config:116 Trying to autoconfigure...
      2025-10-17 12:30:26,376    DEBUG rhsm.https:57 Using standard libs to provide httplib and ssl
      2025-10-17 12:30:26,383    DEBUG insights.client.auto_config:124 Checking if system is subscription-manager registered
      2025-10-17 12:30:26,383    DEBUG insights.client.auto_config:126 System is subscription-manager registered
      2025-10-17 12:30:26,383    DEBUG insights.client.auto_config:148 Found Host: subscription.rhsm.redhat.com, Port: 443
      2025-10-17 12:30:26,383    DEBUG insights.client.auto_config:154 Found CA: /etc/rhsm/ca/redhat-uep.pem
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:155 Setting authmethod to CERT
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:161 Connected to Red Hat Directly, using cert-api
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:178 Trying to set auto_configuration
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:62 Attempting to auto configure!
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:63 Attempting to auto configure hostname: cert-api.access.redhat.com
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:64 Attempting to auto configure CA cert: None
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:65 Attempting to auto configure proxy: None
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:66 Attempting to auto configure no_proxy: None
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:86 Auto-configured base_url: cert-api.access.redhat.com/r/insights
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:87 Not connected to Satellite, skipping branch_info
      2025-10-17 12:30:26,384    DEBUG insights.client.auto_config:264 Updated base_url: cert-api.access.redhat.com/r/insights/platform
      2025-10-17 12:30:26,473     INFO insights.client.connection:1143 Checking in...
      2025-10-17 12:30:26,474    ERROR insights.client.connection:1146 This host is not registered. To register, run 'insights-client --register'.
      

      The other commands also use different version:

      $ insights-client --status
      System is NOT registered locally via .registered file. Unregistered at 2025-10-17T11:52:34.549372
      Insights API says this machine is NOT registered.
      System unregistered locally via .unregistered file
      $ insights-client --version
      Client: 3.2.8
      Core: 3.4.9-1
      $ less /var/log/insights-client.log
      2025-10-17 12:33:30,280    DEBUG insights.client:54 path=/var/lib/insights/newest.egg/insights/client/client.py, version=3.6.7, phase=post_update, arguments=--status
      
      $ insights-client --show-results
      Could not get latest advisor report.
      This host is not registered. Use --register to register this host:
      # insights-client --register
      $ less /var/log/insights-client.log
      2025-10-17 12:38:35,952    DEBUG insights.client:54 path=/var/lib/insights/newest.egg/insights/client/client.py, version=3.6.7, phase=post_update, arguments=--show-results
      

      Acceptance Criteria:

      • All the insights-client commands should use the same core version

      Additional info:

      This applies only for insights-client-3.2.8

              csi-client-tools-bugs CSI Client Tools Bugs Bot
              pkoprda@redhat.com Peter Koprda
              CSI Client Tools Bugs Bot CSI Client Tools Bugs Bot
              CSI Client Tools Bugs Bot CSI Client Tools Bugs Bot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: