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

Excessive logging bloat from SSO client queries - get_sso_client_id() logs all clients

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Authentication
    • None
    • None

      Problem

      The SSOHost.get_sso_client_id() method in robottelo/hosts.py:2744-2762 causes significant log bloat by fetching and logging ALL clients from the SSO system, even though it only needs to find one specific client.

      Impact

      • ~11% of robottelo.log consists of kcadm client list output
      • In a 6 MB log file (50,230 lines), this command executes 8 times
      • Each execution returns 250-1000+ clients (average: ~518 clients per call)
      • Each call generates 750-3000+ log lines of JSON output
      • Example environments show 247 clients (RHBK) and 1052 clients (RHSSO)

      Root Cause

      1. Line 2755 executes: kcadm get clients --fields id,clientId which returns ALL clients
      2. Method lacks @lru_cache decorator (unlike similar methods like get_sso_user_details and get_sso_groups_details)
      3. All output is logged at DEBUG level by broker.hosts logger
      4. Method only needs to find ONE client matching {{

      {satellite.hostname}

      -foreman-openidc}}

      Example Log Entry

      2026-03-03 18:34:48 - gw0 - broker.hosts - DEBUG - env-rhsso-01-ipv4.infra.sat.rdu2.redhat.com executing command: /opt/rh/rh-sso7/root/usr/share/keycloak/bin/kcadm.sh get clients --fields id,clientId
      2026-03-03 18:34:49 - gw0 - broker.hosts - DEBUG - env-rhsso-01-ipv4.infra.sat.rdu2.redhat.com command result:
          stdout:
          [ {
            "id" : "1648ebda-db59-4996-ad73-052ca56ef52d",
            "clientId" : "account"
          }, {
            "id" : "7fe882ab-cb6b-41e2-8c5b-6209c5ac701d",
            "clientId" : "account-console"
          },
          ... (continues for 1000+ clients)
      

      Proposed Solutions

      1. Add @lru_cache decorator to get_sso_client_id() method (quick fix, prevents repeated queries)
      2. Use kcadm query parameter to filter by clientId: kcadm get clients -q clientId=[pattern] (if supported)
      3. Reduce log verbosity for this specific command execution
      4. Post-process output before logging (truncate or summarize)

      Location

      • File: robottelo/hosts.py
      • Class: SSOHost
      • Method: get_sso_client_id() (lines 2744-2762)

      Jenkins Job

      Job where issue was identified: https://jenkins-csb-satellite-qe-satqe.dno.corp.redhat.com/job/endeavour/job/ipv4/job/InteroperabilityTesting-rhel9-sat-6.19-server/1

              Unassigned Unassigned
              rhn-support-ogajduse Ondrej Gajdusek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: