Katello-nightly-rpm-pipeline 1214 failed

Katello nightly pipeline failed:

https://ci.theforeman.org/job/katello-nightly-rpm-pipeline/1214/

foreman-pipeline-katello-nightly-centos7-upgrade (failed) (remote job)
foreman-pipeline-katello-nightly-centos8-stream-upgrade (failed) (remote job)
foreman-pipeline-katello-nightly-centos7-install (failed) (remote job)
foreman-pipeline-katello-nightly-centos8-stream-install (failed) (remote job)

Something is failing with global registration. This run was triggered because of a foreman rpm pipeline so it could have promoted a new foreman.rpm.

From the CentOS 7 install pipeline:

[2022-01-25T19:45:27.640Z] not ok 4 register with global registration with activation key
[2022-01-25T19:45:27.640Z] # (in test file fb-katello-client-global-registration.bats, line 41)
[2022-01-25T19:45:27.640Z] #   `eval $registration_command' failed
[2022-01-25T19:45:27.640Z] # rc=0
[2022-01-25T19:45:27.640Z] # Loaded plugins: fastestmirror
[2022-01-25T19:45:27.640Z] # No Match for argument: katello-ca-consumer-*
[2022-01-25T19:45:27.640Z] # No Packages marked for removal
[2022-01-25T19:45:27.640Z] #   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[2022-01-25T19:45:27.640Z] #                                  Dload  Upload   Total   Spent    Left  Speed
[2022-01-25T19:45:27.640Z] # 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   528    0   478  100    50   1687    176 --:--:-- --:--:-- --:--:--  1695
[2022-01-25T19:45:27.640Z] # {"registration_command":"curl -sS  'https://pipe-katello-server-nightly-centos7.n58.example.com/register?activation_keys=Test+AK\u0026organization_id=4' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2NDMxMzk1OTgsImp0aSI6IjQ2N2E3Zjc0NzhiMzNhNzhlNTQ0MmUwMmY4OGI5ZmMwMDgxYTI3MTc1YWIyMzBlYWQ0ZjVhMzRiMzQ1M2FhY2IiLCJleHAiOjE2NDMxNTM5OTgsInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.T1Uk00HJ4WWhtMABHjn91ikOHCSpl-U6DEWd2kLzwwE' | bash"}
[2022-01-25T19:45:27.640Z] # #
[2022-01-25T19:45:27.640Z] # # Running registration
[2022-01-25T19:45:27.640Z] # #
[2022-01-25T19:45:27.640Z] # Loaded plugins: fastestmirror
[2022-01-25T19:45:27.640Z] # Loading mirror speeds from cached hostfile
[2022-01-25T19:45:27.640Z] #  * base: mirror.centos.org
[2022-01-25T19:45:27.640Z] #  * centos-sclo-rh: mirror.centos.org
[2022-01-25T19:45:27.640Z] #  * epel: download-cc-rdu01.fedoraproject.org
[2022-01-25T19:45:27.640Z] #  * extras: mirror.centos.org
[2022-01-25T19:45:27.640Z] #  * updates: mirror.centos.org
[2022-01-25T19:45:27.640Z] # Resolving Dependencies
[2022-01-25T19:45:27.640Z] # --> Running transaction check
[2022-01-25T19:45:27.640Z] # ---> Package subscription-manager.x86_64 0:1.24.50-1.el7.centos will be installed
[2022-01-25T19:45:27.640Z] # --> Finished Dependency Resolution
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # Dependencies Resolved
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # ================================================================================
[2022-01-25T19:45:27.640Z] #  Package                  Arch       Version                  Repository   Size
[2022-01-25T19:45:27.640Z] # ================================================================================
[2022-01-25T19:45:27.640Z] # Installing:
[2022-01-25T19:45:27.640Z] #  subscription-manager     x86_64     1.24.50-1.el7.centos     updates     1.1 M
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # Transaction Summary
[2022-01-25T19:45:27.640Z] # ================================================================================
[2022-01-25T19:45:27.640Z] # Install  1 Package
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # Total download size: 1.1 M
[2022-01-25T19:45:27.640Z] # Installed size: 4.4 M
[2022-01-25T19:45:27.640Z] # Downloading packages:
[2022-01-25T19:45:27.640Z] # Running transaction check
[2022-01-25T19:45:27.640Z] # Running transaction test
[2022-01-25T19:45:27.640Z] # Transaction test succeeded
[2022-01-25T19:45:27.640Z] # Running transaction
[2022-01-25T19:45:27.640Z] #   Installing : subscription-manager-1.24.50-1.el7.centos.x86_64             1/1 
[2022-01-25T19:45:27.640Z] #   Verifying  : subscription-manager-1.24.50-1.el7.centos.x86_64             1/1 
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # Installed:
[2022-01-25T19:45:27.640Z] #   subscription-manager.x86_64 0:1.24.50-1.el7.centos                            
[2022-01-25T19:45:27.640Z] # 
[2022-01-25T19:45:27.640Z] # Complete!
[2022-01-25T19:45:27.640Z] # Unauthorized: Invalid credentials for request.

@lstejska any insight in why this would be failing?

A new version of candlepin was added which depends on Fixes #34306 - Update how we parse CN from subman identity certs by chris1984 · Pull Request #9902 · Katello/katello · GitHub

It didn’t make the last build, but should be in the next pipeline

Hmm, I’ll look into that

So did quick test on latest foreman develop & katello master and registration process works as expected.

Can someone elaborate a bit more in the actual test? It seems to be failing in the very last step, when the registration template calls home. It uses the build token of a host if I’m not mistaken (the same as with provisioning).

This is roughly what follows after the subscription-manager is installed

    # Configure subscription-manager
    test -f $RHSM_CFG.bak || cp $RHSM_CFG $RHSM_CFG.bak
    subscription-manager config \
      --server.hostname="<%= @rhsm_url.host if @rhsm_url %>" \
      --server.port="<%= @rhsm_url.port if @rhsm_url %>" \
      --server.prefix="<%= @rhsm_url.path if @rhsm_url %>" \
      --rhsm.repo_ca_cert="$KATELLO_SERVER_CA_CERT" \
      --rhsm.baseurl="<%= @pulp_content_url %>"

    # Older versions of subscription manager may not recognize
    # report_package_profile and package_profile_on_trans options.
    # So set them separately and redirect out & error to /dev/null
    # to fail silently.
    subscription-manager config --rhsm.package_profile_on_trans=1 > /dev/null 2>&1 || true
    subscription-manager config --rhsm.report_package_profile=1 > /dev/null 2>&1 || true

    # Configuration for EL6
    if grep --quiet full_refresh_on_yum $RHSM_CFG; then
      sed -i "s/full_refresh_on_yum\s*=.*$/full_refresh_on_yum = 1/g" $RHSM_CFG
    else
      full_refresh_config="#config for on-premise management\nfull_refresh_on_yum = 1"
      sed -i "/baseurl/a $full_refresh_config" $RHSM_CFG
    fi

    subscription-manager register <%= '--force' if truthy?(@force) %> \
      --org='<%= @organization.label if @organization %>' \
      --activationkey='<%= activation_keys %>' || <%= truthy?(@ignore_subman_errors) ? 'true' : 'cleanup_and_exit 1' %>

        UUID=$(subscription-manager identity | head -1 | awk '{print $3}')
        curl --silent --show-error --cacert $KATELLO_SERVER_CA_CERT --request POST "<%= @registration_url %>" \
             --data "uuid=$UUID" \
             <%= headers.join(' ') %> \
<%= "          --data 'host[organization_id]=#{@organization.id}' \\\n" if @organization -%>
<%= "          --data 'host[location_id]=#{@location.id}' \\\n" if @location -%>
<%= "          --data 'host[hostgroup_id]=#{@hostgroup.id}' \\\n" if @hostgroup -%>
<%= "          --data 'host[lifecycle_environment_id]=#{@lifecycle_environment_id}' \\\n" if @lifecycle_environment_id.present? -%>
<%= "          --data 'setup_insights=#{@setup_insights}' \\\n" unless @setup_insights.nil? -%>
<%= "          --data 'setup_remote_execution=#{@setup_remote_execution}' \\\n" unless @setup_remote_execution.nil? -%>
<%= "          --data remote_execution_interface=#{shell_escape(@remote_execution_interface)} \\\n" if @remote_execution_interface.present? -%>
<%= "          --data packages=#{shell_escape(@packages)} \\\n" if @packages.present? -%>
<%= "          --data 'update_packages=#{@update_packages}' \\\n" unless @update_packages.nil? -%>

This is a change from 3 days ago Registration and host_init_config templates previews by stejskalleos · Pull Request #9033 · theforeman/foreman · GitHub which touched the global registration template. I haven’t found anything else related from recently.

I believe what @Justin_Sherrill said was the problem. The latest nightly failed on another issue.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.