How to resolve Ansible Automation Platform Project sync failure error "TypeError: join() missing 1 required positional argument: 'a' in ansible-galaxy" ?

Solution Verified - Updated -

Environment

  • Red Hat® Ansible Automation Platform 2.4
  • Ansible Automation Platform Operator 2.4
  • ansible-core 2.15.5

Issue

  • AAP project sync fails with an error during the installation of ansible role from ansible-galaxy:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/ansible/cli/__init__.py", line 659, in cli_executor
    exit_code = cli.run()
    File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 719, in run
    return context.CLIARGS['func']()
    File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 119, in method_wrapper
    return wrapped_method(*args, **kwargs)
    File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1370, in execute_install
    self._execute_install_role(role_requirements)
    File "/usr/local/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1469, in _execute_install_role
    installed = role.install()
    File "/usr/local/lib/python3.9/site-packages/ansible/galaxy/role.py", line 426, in install
    setattr(member, attr, os.path.join(*n_final_parts))
    TypeError: join() missing 1 required positional argument: 'a'
    

Resolution

  • This is a known issue with ansible-core 2.15.5 version and has been highlighed to Engineering team with a n internal JIRA (AAP-18322).

  • Follow the below steps as a workaround to get the project sync:

For On-prem installation:

  • Delete the current image of current Control Plane Execution Environment :

    # su - awx
    $ podman rmi registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
    
  • Pull the image with version 1.0.0-389 and tag it to latest :

    # su - awx
    $ podman pull registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:1.0.0-389
    $ podman tag registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:1.0.0-389 registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest
    
  • Change the Control Plane Execution Environment pull policy :

    AAP WebUI -> Administration -> Execution Environments -> Control Plane Execution Environment -> Edit -> Pull -> Only pull the image if not present before running -> save
    
  • Run the project sync the project again. It should be able to complete the it now.

For Operator based installation:

  • Create a Pull Image Secret from Workloads - Secrets section:

    • Secret Name: resoucename-cp-pull-credentials
    • Registry server address: https://registry.redhat.io
    • Username: registry_usernamme
    • Password: registry_passowrd
  • Add in the Controller YAML, under Controller specs, the following:

    ee_pull_credentials_secret: <resoucename>-cp-pull-credentials (The secret created previous step)
    
    control_plane_ee_image: >-
    registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8@sha256:dc1e48fb86bfd17b3a9896dc9c8cf6eaa34ca66a5f3cb136401f27bcc5e9f31a
    

    The image provided contains the ansible-core 2.15.0

  • Save and Reload the configuration. The task pod will be reloaded.

  • Login into Controller UI and resync the project.

Diagnostic Steps

  • The error something like the following can be observed when installing ansible roles from ansible-galaxy via requirements.yml file.:

    # ansible-galaxy install -r requirements.yml  --force -vvv -c
    ansible-galaxy [core 2.15.5]
    config file = /root/ansible.cfg
    configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python3.9/site-packages/ansible
    ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
    executable location = /usr/bin/ansible-galaxy
    python version = 3.9.16 (main, Dec 21 2022, 10:57:18) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)] (/usr/bin/python3.9)
    jinja version = 3.1.2
    libyaml = True
    Using /root/ansible.cfg as config file
    Reading requirement file at '/root/requirements.yml'
    found role {'name': 'selinux', 'src': 'https://github.com/linux-system-roles/selinux.git', 'version': '1.1.0', 'scm': 'git'} in yaml file
    Starting galaxy role install process
    Processing role selinux 
    changing role selinux from 1.3.4 to 1.1.0
    archiving ['/usr/bin/git', 'archive', '--prefix=selinux/', '--output=/root/.ansible/tmp/ansible-local-1705490ll5iiv/tmpusjz1i5i.tar', '1.1.0']
    extracting selinux to /root/.ansible/roles/selinux
    [WARNING]: Illegal filename '..': '..' is not allowed
    ERROR! Unexpected Exception, this is probably a bug: join() missing 1 required positional argument: 'a'
    the full traceback was:
    Traceback (most recent call last):
    File "/usr/lib/python3.9/site-packages/ansible/cli/__init__.py", line 659, in cli_executor
    exit_code = cli.run()
    File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 719, in run
    return context.CLIARGS['func']()
    File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 119, in method_wrapper
    return wrapped_method(*args, **kwargs)
    File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1370, in execute_install
    self._execute_install_role(role_requirements)
    File "/usr/lib/python3.9/site-packages/ansible/cli/galaxy.py", line 1469, in _execute_install_role
    installed = role.install()
    File "/usr/lib/python3.9/site-packages/ansible/galaxy/role.py", line 426, in install
    setattr(member, attr, os.path.join(*n_final_parts))
    TypeError: join() missing 1 required positional argument: 'a'
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments