Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard Out tab empty even when there is related data on the API #11068

Closed
3 tasks done
nixocio opened this issue Sep 10, 2021 · 2 comments
Closed
3 tasks done

Standard Out tab empty even when there is related data on the API #11068

nixocio opened this issue Sep 10, 2021 · 2 comments

Comments

@nixocio
Copy link
Contributor

nixocio commented Sep 10, 2021

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I am not entitled to status updates or other assurances.

Summary

Standard Out tab empty even when there is related data on the API

AWX version

devel

Installation method

docker for mac

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

No response

Steps to reproduce

  1. Create a Project with https://github.com/ansible/test-playbooks
  2. Create a Job Template using the above, choose playbook test_angular_var_bind.yml
  3. Launch the job template - Task expected to fail
  4. Inspect fail by host

image

Job events endpoint could be queried to get the missing data.

api/v2/jobs/7/job_events/?id=19&
{
   "count":1,
   "next":null,
   "previous":null,
   "results":[
      {
         "id":19,
         "type":"job_event",
         "url":"/api/v2/job_events/19/",
         "related":{
            "job":"/api/v2/jobs/7/",
            "children":"/api/v2/job_events/19/children/",
            "host":"/api/v2/hosts/1/"
         },
         "summary_fields":{
            "host":{
               "id":1,
               "name":"localhost",
               "description":""
            },
            "job":{
               "id":7,
               "name":"Demo Job Template@2:38:34 PM",
               "description":"",
               "status":"failed",
               "failed":true,
               "elapsed":2.606,
               "type":"job",
               "job_template_id":9,
               "job_template_name":"Demo Job Template@2:38:34 PM"
            },
            "role":{
               
            }
         },
         "created":"2021-09-10T18:40:49.363388Z",
         "modified":"2021-09-10T18:40:49.367787Z",
         "job":7,
         "event":"runner_on_failed",
         "counter":8,
         "event_display":"Host Failed",
         "event_data":{
            "playbook":"test_angular_var_bind.yml",
            "playbook_uuid":"7b2ce1dd-e1c2-445b-850a-ca0a44f12f1c",
            "play":"Test that curly braces \"{\" in task names",
            "play_uuid":"12d7eca1-6d21-ae0c-8025-000000000006",
            "play_pattern":"all",
            "task":"Username is '{{username | default(ansible_env['SUDO_USER'])}}'",
            "task_uuid":"12d7eca1-6d21-ae0c-8025-000000000008",
            "task_action":"debug",
            "task_args":"",
            "task_path":"/tmp/bwrap_7_lxesnox_/awx_7_grgnwsl4/project/test_angular_var_bind.yml:5",
            "host":"localhost",
            "remote_addr":"localhost",
            "res":{
               "msg":"The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'SUDO_USER'\n\nThe error appears to be in '/tmp/bwrap_7_lxesnox_/awx_7_grgnwsl4/project/test_angular_var_bind.yml': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  tasks:\n    - name: \"Username is '{{username | default(ansible_env['SUDO_USER'])}}'\"\n      ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n",
               "_ansible_no_log":false
            },
            "start":"2021-09-10T18:40:49.334184",
            "end":"2021-09-10T18:40:49.363094",
            "duration":0.02891,
            "ignore_errors":null,
            "event_loop":null,
            "uuid":"1a79c3ab-4bd8-470f-af7a-e07574fbc0be"
         },
         "event_level":3,
         "failed":true,
         "changed":false,
         "uuid":"1a79c3ab-4bd8-470f-af7a-e07574fbc0be",
         "parent_uuid":"12d7eca1-6d21-ae0c-8025-000000000008",
         "host":1,
         "host_name":"localhost",
         "playbook":"test_angular_var_bind.yml",
         "play":"Test that curly braces \"{\" in task names",
         "task":"Username is '{{username | default(ansible_env['SUDO_USER'])}}'",
         "role":"",
         "stdout":"\u001b[0;31mfatal: [localhost]: FAILED! => {\"msg\": \"The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'SUDO_USER'\\n\\nThe error appears to be in '/tmp/bwrap_7_lxesnox_/awx_7_grgnwsl4/project/test_angular_var_bind.yml': line 5, column 7, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n  tasks:\\n    - name: \\\"Username is '{{username | default(ansible_env['SUDO_USER'])}}'\\\"\\n      ^ here\\nWe could be wrong, but this one looks like it might be an issue with\\nmissing quotes. Always quote template expression brackets when they\\nstart a value. For instance:\\n\\n    with_items:\\n      - {{ foo }}\\n\\nShould be written as:\\n\\n    with_items:\\n      - \\\"{{ foo }}\\\"\\n\"}\u001b[0m",
         "start_line":7,
         "end_line":8,
         "verbosity":0
      }
   ]
}

Expected results

Data present.

Actual results

Data missing.

Additional information

Also per @chrismeyersfsu feedback the API does not have a stderr field. Then we should remove that Standard Error tab.

@keithjgrant
Copy link
Member

these tabs aren't meant to be a simple re-display of the job event stdout, but rather details reported from the module itself, whether stdout or stderr

@InnocentK InnocentK self-assigned this Apr 18, 2022
@InnocentK
Copy link
Contributor

Resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants