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 2049143 - Unable to run Convert2RHEL role on the host
Summary: Unable to run Convert2RHEL role on the host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.11.0
Assignee: Adam Ruzicka
QA Contact: Sam Bible
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-01 15:44 UTC by Leos Stejskal
Modified: 2022-07-05 14:33 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-smart_proxy_ansible-3.3.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:32:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
job work files and proxy log (46.02 KB, application/gzip)
2022-02-01 15:44 UTC, Leos Stejskal
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34395 0 Normal Ready For Testing ansible-runner running under a pty exhibits erratic behavior 2022-02-07 12:54:13 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:33:00 UTC

Description Leos Stejskal 2022-02-01 15:44:15 UTC
Created attachment 1858386 [details]
job work files and proxy log

Description of problem:
Convert2RHEL role is not executing its tasks and always ends with 

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

How reproducible:
Always

Steps to Reproduce:
1. Import Ansible roles
2. Create `satellite_organization` variable for `convert2rhel` role with value "Default Organization"
3. Assign "redhat.satellite.convert2rhel" to the Satellite host
4. Start "Run Ansible roles"
5. Check the output of the job

Actual results:
Job ends with success result even when only the first task from role have been run and nothing else.

The only output is:

```
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
TASK [Display all parameters known for the Foreman host] ***********************
...
...
...
TASK [Apply roles] *************************************************************
TASK [Upload Subscription Manifest and sync RHEL repository] *******************
[Key
 444:
Exit status: 0
```

Expected results:
Run the role


Additional info:
* job_work_files.tar.gz in attachment contains working files from the job and log from the proxy

Comment 1 Ondřej Ezr 2022-02-03 21:37:06 UTC
TLDR; this is simple ansible failure that should be very easy to debug, but Satellite makes it very hard.

This can be caused for two reasons (that I did not managed to investingate yet):
1) capsule terminates ansible-runner too soon before it can report what went wrong properly
2) ansible-runner fails too fast itself

In the `job_events` I have found a file `d16f1694-b480-444a-b44c-74c6e8e36e02-partial.json` with following content that finally gave away what happend:

{
   "parent_uuid":"94188218-2466-5ab3-79d8-00000000023e",
   "created":"2022-02-01T15:24:58.295828",
   "pid":42264,
   "event":"runner_on_failed",
   "event_data":{
      "play":"all",
      "event_loop":null,
      "task_args":"",
      "play_uuid":"94188218-2466-5ab3-79d8-000000000006",
      "task_uuid":"94188218-2466-5ab3-79d8-00000000023e",
      "playbook_uuid":"d29f8cd9-2458-450c-9615-f2af26596621",
      "playbook":"playbook.yml",
      "task_action":"redhat.satellite.subscription_manifest",
      "duration":0.011068,
      "ignore_errors":null,
      "task_path":"/usr/share/ansible/collections/ansible_collections/redhat/satellite/roles/manifest/tasks/main.yml:10",
      "play_pattern":"all",
      "task":"Upload Subscription Manifest to Foreman",
      "end":"2022-02-01T15:24:58.295642",
      "uuid":"d16f1694-b480-444a-b44c-74c6e8e36e02",
      "remote_addr":"<redacted_hostname>",
      "res":{
         "msg":"The task includes an option with an undefined variable. The error was: 'satellite_organization' is undefined\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/redhat/satellite/roles/manifest/tasks/main.yml': line 10, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Upload Subscription Manifest to Foreman\n  ^ here\n",
         "_ansible_no_log":false
      },
      "host":"<redacted_hostname>",
      "start":"2022-02-01T15:24:58.284574",
      "role":"manifest"
   },
   "uuid":"d16f1694-b480-444a-b44c-74c6e8e36e02"
}

Tho this does not appear in any final output, only in the ansible runner "partial" outputs which get ignored because it is supposed to get into the final output.

Comment 2 Ondřej Ezr 2022-02-03 21:50:09 UTC
Running `ansible-runner` manually results in a properly populated stdout and job_events/* so it's our fault and we terminate the runner before it manages to finish what it is doing.

Comment 5 Sam Bible 2022-04-13 19:35:33 UTC
Version-Release number of selected component (if applicable):
6.11 - 3 

Steps to Reproduce:
1. Import Ansible roles
2. Create `satellite_organization` variable for `convert2rhel` role with value "Default Organization"
3. Assign "redhat.satellite.convert2rhel" to the Satellite host
4. Start "Run Ansible roles"
5. Check the output of the job

Actual results:
Role is run, and doesn't end with a false success as in original case, any failures are properly reported

PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [dhcp-3-152.vms.sat.rdu2.redhat.com]
TASK [Display all parameters known for the Foreman host] ***********************
ok: [dhcp-3-152.vms.sat.rdu2.redhat.com] => {
  ...
TASK [Apply roles] *************************************************************
TASK [Upload Subscription Manifest and sync RHEL repository] *******************
TASK [Subscription Manifest] ***************************************************
TASK [redhat.satellite.manifest : Download Subscription Manifest from Red Hat Customer Portal] ***
skipping: [dhcp-3-152.vms.sat.rdu2.redhat.com]
TASK [redhat.satellite.manifest : Upload Subscription Manifest to Foreman] *****
 161:
fatal: [dhcp-3-152.vms.sat.rdu2.redhat.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'satellite_manifest_path' is undefined\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/redhat/satellite/roles/manifest/tasks/main.yml': line 10, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Upload Subscription Manifest to Foreman\n  ^ here\n"}
 162:
PLAY RECAP *********************************************************************
 163:
dhcp-3-152.vms.sat.rdu2.redhat.com : ok=2    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0
 164:
Exit status: 2

Comment 8 errata-xmlrpc 2022-07-05 14:32:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


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