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

TypeError: Cannot read properties of undefined (reading 'length') #6

Closed
jpadron-am opened this issue Nov 14, 2024 · 4 comments
Closed
Labels
bug Something isn't working inactive

Comments

@jpadron-am
Copy link

Summary

 
If I create the template in the GUI I am able to access the survey. The issue is when we create the template using Ansible and the infra.controller_configuration collection. When the playbook creates the template we are not able to see the survey in the GUI i to make changes. If I launch the template it does show the survey to answer. I did open a ticket with Redhat and they are having the same issue. I was told to open an issue here.
 

Issue Type

 

  • Bug Report
     

Ansible, Collection, Controller details

 

 

ansible --version
 
ansible-galaxy collection list
infra.controller_configuration
 
Controller version
Red Hat Ansible Automation Platform
2.4
 

 

  • ansible installation method: one of source, pip, OS package, EE
     

OS / ENVIRONMENT

 

 

Desired Behavior

 

 

Actual Behavior

 

 
Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:
The following is the error we get in the GUI:
TypeError: Cannot read properties of undefined (reading 'length')
TypeError: Cannot read properties of undefined (reading 'length') at Fle (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:3037132) at ao (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:831448) at Ks (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:883792) at Al (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:871038) at Tl (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:870966) at El (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:870829) at yl (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:867795) at https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:817240 at t.unstable_runWithPriority (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:913546) at Gi (https://ansiblecontroller-dev.company.com/static/js/main.359f10ea.js:2:817017)
 
 
The playbook runs successfully.
 
The following is in the main playbook.
  roles:
    - {role: infra.controller_configuration.job_templates, when: controller_templates is defined}
 

  • name: Create job
      ansible.builtin.include_role:
        name: infra.controller_configuration.job_templates
      vars:
        controller_templates: "{{ data }}"
      no_log: false
     
    The following is the .project file:

  • name: OnPrem-Server-Teardown-Manual-Test
      credentials:
        - serviceuser1
        - OnpremServerBuild-vault
      project: OS-Build-jctesting
      inventory: Localhost Automation
      execution_environment: ee-serverbuild-automation
      playbook: teardown-new.yml
      organization: GBSAuto
      extra_vars: {
        InfobloxBaseUri: "https://ansiblecontroller.company.com/",
        infoblox_job_template_id: 401
      }
      survey_enabled: true
      survey_spec: {
        name: "Teardown Server",
        description: "This survey will gather information needed to teardown a server",
        spec: [
          {
            type: "multiselect",
            "min": 0,
            "max": 0,
            question_name: "Which tasks to run?",
            question_description: " ",
            variable: "teardown_options",
            choices: ["all", "remove_dns", "poweroff_vm", "delete_vm", "remove_satellite", "remove_computer_AD", "remove_winaccess", "remove_sccm"],
            required: true
          },
          {
            type: "multiplechoice",
            "min": 0,
            "max": 0,
            question_name: "Is this a virtual server?",
            question_description: " ",
            variable: "virtual",
            choices: ["yes", "no"],
            required: true
          },
          {
            type: "text",
            question_name: "Server Name",
            question_description: " ",
            variable: "vm",
            "min": 0,
            "max": 20,
            required: true
          },
          {
            type: "multiplechoice",
            "min": 0,
            "max": 0,
            question_name: "Site",
            question_description: " ",
            required: true,
            variable: "site",
            choices: ["SITE1", "SITE2"]
          },
          {
            type: "multiplechoice",
            "min": 0,
            "max": 0,
            question_name: "Domain",
            question_description: " ",
            required: true,
            variable: "domain",
            choices: ["domain1.com", "domain2.com", "domain3.com"]
          },
          {
            type: "multiplechoice",
            "min": 0,
            "max": 0,
            question_name: "Environment",
            question_description: " ",
            required: true,
            variable: "env",
            choices: ["prod", "dev", "sandbox"]
          }
        ]
      }
     
  • playbook / task
  • configuration file / list
  • error
     

 

 

 

STEPS TO REPRODUCE

 

 

 
The playbook runs successfully and the template does get created in AAP. You just can't view or change the survey. The Web interface shows There was an error loading this content. Please reload the page.
You are able to launch the template and the survey does show up. You just can't do any manual updates to it.
 

 

 

 

 

 

@jpadron-am jpadron-am added the bug Something isn't working label Nov 14, 2024
@djdanielsson
Copy link
Contributor

is this in AAP 2.4 or 2.5?

@jpadron-am
Copy link
Author

is this in AAP 2.4 or 2.5?

2.4

@djdanielsson djdanielsson transferred this issue from redhat-cop/infra.aap_configuration Nov 14, 2024
@djdanielsson
Copy link
Contributor

moving this to the controller_configuration repo from aap_configuration. I would have to try and test passing this directly to the modules and see if that replicates the issue you are seeing or not

@djdanielsson
Copy link
Contributor

@sean-m-sullivan or @Tompage1994 if either of you have some time to look into this as well that would be helpful

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inactive
Projects
None yet
Development

No branches or pull requests

2 participants